i have a large number of gif images all with the same layout:
There's a photo with variable proportions surrounded by a 2px border of a
unique color. Underneath there's some text.
What I'd like to do is create a command that would use the lasso tool to
select that border by color, crop the doent to the selection (now only
the photo with the border is visible), then invert the selection and crop
again, so that the photo remains as only contents of the doent, then
export as JPEG.

FW, however, can't save bitmap editing actions to commands. Has anyone an
idea on how to automate the task? Simply resizing the canvas wouldn't do, as
only know the width of the photo for sure, but the height is flexible...

Any hints highly appreciated,