imageflow icon indicating copy to clipboard operation
imageflow copied to clipboard

Turn off GIF animation

Open dominikfiala opened this issue 8 months ago • 4 comments

Is there a way to turn off animation of a GIF picture in imageflow? Or is this out of scope of imageflow?

I searched the docs and issues, but didnt find any related options.

Also the size of resized animated GIF is huge. I resized 740 KB 1000x230 px GIF to 800x184 and the resulting size is 29 MB.

After brief investigation it seems that the orignal GIF is stored as the differences between the frames of the animation, but after resizing with imageflow_tool, the result is full size frames.

See the result of imagick identify command (abbrevated):

identify orig.gif
orig.gif[0] GIF 1000x230 1000x230+0+0 8-bit sRGB 256c 0.020u 0:00.006
orig.gif[1] GIF 238x184 1000x230+356+18 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[2] GIF 262x224 1000x230+355+0 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[3] GIF 263x224 1000x230+354+0 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[4] GIF 240x184 1000x230+354+18 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[5] GIF 293x184 1000x230+355+18 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[6] GIF 295x186 1000x230+356+17 8-bit sRGB 256c 0.020u 0:00.009
orig.gif[7] GIF 294x186 1000x230+357+17 8-bit sRGB 256c 0.020u 0:00.009
...
identify resized.gif
res.gif[0] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.092
res.gif[1] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.093
res.gif[2] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.093
res.gif[3] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.092
res.gif[4] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.092
res.gif[5] GIF 800x184 800x184+0+0 8-bit sRGB 256c 0.020u 0:00.092
...

The image tested: Image

dominikfiala avatar Jun 06 '25 14:06 dominikfiala

Yeah, I have a branch where I'm reimplementing the git codec and the compression logic. Are you using the library, server, or tool?

lilith avatar Jun 07 '25 01:06 lilith

Cool. Looking forward to see the release. I used imageflow_tool CLI inside a Debian machine: imageflow_tool release 1.5.8-rc62 (1f6dc67ee* 2021-03-29) for x86_64-unknown-linux-gnu

dominikfiala avatar Jun 09 '25 11:06 dominikfiala

https://gif.ski/

^ I will probably end up using a very similar approach to gifski - I license from Kornel already.

Are you looking for a command that will just process the first frame? Like &frame=0 ?

lilith avatar Jun 09 '25 20:06 lilith

Im using imafeflow to create thumbnails of images to use as placeholders.

So my usage would be something like: when creating a placeholder, find out whether the picture is animated, if so, pick just first frame and resize it.

dominikfiala avatar Jun 10 '25 14:06 dominikfiala