"clone" discards all but one frame of animated GIF
Posted: 2014-04-24T12:08:57-07:00
We use command lines like this to resize an image to various sizes in a single command so we don't decode the original image over and over. It's quite fast:
convert input.jpg -resize '1600x1280>' '(' +clone -resize '1140x1440>' -write big.jpg '+delete' ')' '(' +clone -resize '760x760>' -write small.jpg '+delete' ')' null:
Here I'm first scaling to a maximum size as a more efficient starting point for the other resizes than the original image, which could be enormous.
Then I'm cloning, resizing, and writing two different sizes.
Then I discard the 1600x1280 version which I don't actually need to keep (thus null:).
This works fine with a JPEG (as shown here), PNG, or single-frame GIF file.
However with an animated GIF the animation is lost in all of the scaled versions.
It appears that +clone discards information about all but the first (?) frame of the GIF.
Is this a bug or am I misunderstanding the intended feature set of +clone?
I'm using 6.8.7-7.
Thanks!
convert input.jpg -resize '1600x1280>' '(' +clone -resize '1140x1440>' -write big.jpg '+delete' ')' '(' +clone -resize '760x760>' -write small.jpg '+delete' ')' null:
Here I'm first scaling to a maximum size as a more efficient starting point for the other resizes than the original image, which could be enormous.
Then I'm cloning, resizing, and writing two different sizes.
Then I discard the 1600x1280 version which I don't actually need to keep (thus null:).
This works fine with a JPEG (as shown here), PNG, or single-frame GIF file.
However with an animated GIF the animation is lost in all of the scaled versions.
It appears that +clone discards information about all but the first (?) frame of the GIF.
Is this a bug or am I misunderstanding the intended feature set of +clone?
I'm using 6.8.7-7.
Thanks!