The last big encoder feature I need to implement is auto-cropping each frame, and writing corresponding offsets into the file. ![]() This change also makes GIF exporting somewhat faster, because FreeImage's GIF encoder is slow as molasses, but large runs of duplicate pixels are encoded faster than regular ones. goes from 2607 KB before these optimizations to 326 KB afterwards. As a concrete example, this animated GIF from the GIF wikipedia page: This cuts file size significantly, especially for images where only a portion of the image actually changes from frame-to-frame. When found, it intelligently flags the previous frame for retention during rendering (instead of clearing it), and replaces duplicate pixels on the subsequent frame with transparency (allowing the previous frame to "show through" anywhere the two frames are identical). PhotoDemon's GIF encoder now analyzes neighboring frames to identify duplicate pixel regions. This whole animated-GIF-export thing is coming along nicely! Investigate options for previewing animated gifs - maybe use the navigator window on the right panel?.(optionally) provide a dialog when importing animated gifs, to allow the user to import only selected frames (or all frames) - note that this option will need to be suspended during batch processing.Mockup an "export animated gif" dialog, which needs a lot of options (GIMP could be helpful here, as it supports animated-gif-as-layers import and export) - note also that it needs to be smart about reusing metadata, like gif frame times, if the image was originally imported from an animated gif file. ![]()
0 Comments
Leave a Reply. |