I also tried out the following commands: ffmpeg -i out-convert.gif -vf scale=256:-1 out-ffmpeg-small.gif Not considerably smaller than out-coalesce.gif, but I think this is just because the black ground compresses really well, and it could be very significant in general. Out-deconstruct.gif: compressed frames, final output size 1.9 MiB. Output looks visually correct, but the output file size is 2.0 MiB, which is larger than out-deconstruct.gif Out-coalesce.gif: all frames are 256x256 and have the correct offset 0+0. Visually incorrect, since those approximately 256x256 frames have a non-zero offset, e.g. Out.gif: All frames are 256x256 or larger, and huge at about 5MiB, TODO why? Then, if we compare the three conversions: $ identify out-deconstruct.gif | head -n 3 $ convert out-convert.gif -coalesce -resize 256x -deconstruct out-deconstruct.gif $ convert out-convert.gif -coalesce -resize 256x out-coalesce.gif $ convert out-convert.gif -resize 256x out.gif Using the test data from this answer: How do I create an animated gif from still images (preferably with the command line)? we can see this clearly with identify: $ identify out-convert.gif | head -n 3 coalesce then expands all the frames to the original size, which makes the resize work, but it does not re-compress the frames again as your input image: -deconstruct is needed for that! The root cause of the problem is that your input GIF was properly minimized: GIF allows the next frame to be just the modified rectangle from the previous one at an offset. Convert an image from one format to another (e.g.After -coalesce, you likely want to add a -deconstruct: convert in.gif -coalesce -resize 256x -deconstruct out-deconstruct.gif.Here are just a few examples of what ImageMagick can do: ImageMagick supports many image formats (over 90 major formats) including formats like GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. This makes it possible to modify or create images automatically and dynamically. Most of the functionality of ImageMagick can be used interactively from the command line more often, however, the features are used from programs written in the programming languages C, Ch, C++, Java, Perl, PHP, Python, Ruby, Tcl/Tk, for which ready-made ImageMagick interfaces ( PerlMagick, Magick++, PythonMagick, MagickWand for PHP, RMagick, TclMagick, and JMagick) are available. ImageMagick is free software: it is delivered with full source code and can be freely used, copied, modified and distributed. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and Bézier curves can be added to images and stretched and rotated. It can read, convert and write images in a large variety of formats. ImageMagick® is a free software suite to create, edit, and compose bitmap images. PythonMagick is the Python binding of the ImageMagick library.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |