A couple months ago a coworker and I were trying to figure out how to use ImageMagick to convert a bunch of .png images to .gif. Using mogrify, the process is fairly straightforward, but preserving the transparency by matting alpha pixels against a white background was pretty tricky.
Here’s the issue:
| Original png | ![]() |
| Bad gif | ![]() |
| Good gif | ![]() |
The epic search turned up the following command:
mogrify -format gif -bordercolor white -border 0x0 application-zip.png.png
Which gives you the good gif above.


