![]() 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. I have also published a blog post on the development that serves as a mini tutorial for batch/bash for those interested.After -coalesce, you likely want to add a -deconstruct: convert in.gif -coalesce -resize 256x -deconstruct out-deconstruct.gif Obviously this one liner doesn't give you the option to pick and choose the source image per size though. This does the work of resizing an image and creating an icon with one line of script (or multiline with the \ character at the end of the line). delete 0 -alpha off -colors 256 favicon.ico convert image.png -bordercolor white -border 0 \ The website also has some other usage examples such as the one found here. convert "image1.png" "image2.png" "image3.png" "result.ico" There is a subroutine named createIcon where I do the work, but here is a short example of using ImageMagick directly to package different source files into a. You can read more about it on the project page and I have also included a link to download the ImageMagick binaries I was using during development. I would like to encourage anyone to contribute to the project as well, including feature requests. I also provide a bat file for anyone on Windows. ![]() This is a link to the shell script I wrote for Unix / Mac (and Windows if you use Cygwin). I recently wrote a little utility faviconbuild which I have released on github under the MIT Open Source license. This is actually very easy to do with ImageMagick. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |