animated GIF total size given on each frame

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

animated GIF total size given on each frame

Post by naoliv »

Hi!

As a wishlist for the identify program (from http://bugs.debian.org/493103):

Code: Select all

$ identify f.gif
f.gif[0] GIF 180x240 180x240+0+0 PseudoClass 256c 8-bit 59.2402kb
f.gif[1] GIF 37x21 180x240+77+61 PseudoClass 256c 8-bit 59.2402kb
f.gif[2] GIF 97x41 180x240+74+58 PseudoClass 256c 8-bit 59.2402kb...
This makes it look like each frame is 59.2402kb big, when in fact it
is a total... perhaps give the actual size, and a grand total at the end.
Thank you!

Best regards,
Nelson
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: animated GIF total size given on each frame

Post by fmw42 »

Good idea!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: animated GIF total size given on each frame

Post by anthony »

Yes it is a good idea. but it may not be practical, as IM can't calculate a partial filesize!!! Especially of a multi-image file format like GIF, where parts of later 'frames' could share a common 'global colormap'. It just does not make sense.

Of course other multi-image formats, like MIFF 9which is just a concatenation of uncompressed single images, it would be reasonably simple to do, but will need to be done by the coder.

You can tell it is from the same file in "identify" as the filename at the start of the line is the same.

Yes it is a good idea. but not one that can can be implemented easily.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: animated GIF total size given on each frame

Post by fmw42 »

why not then internally convert the image to MIFF and then compute the file size of each frame and return that with the result of the identify? it could be a special option (like -verbose) with identify so that one knows it is going to be extra processing.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: animated GIF total size given on each frame

Post by anthony »

That is do-able, A rough calculation of just the uncompressed binary data size may also be possible, but it will not be a file size for a specific file format, with specific compression.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply