ImageMagick: PNG to GIF: make any not completely transparent pixel solid
3
votes
0
answers
330
views
I'm trying to create a GIF animation from a set of transparent PNG images in various resolutions. When I
-resize
the edges are aliased. The background is probably quite predictable so I could make it just a solid color, but if possible I want something better: I want all pixels that would be semi-transparent if the output image would be PNG to be solid with white as the background.
Is there some combination of options to ImageMagick that let me do this? My command currently looks like that:
for size in 28 42 56 84 112; do
echo $size
convert -delay 6 -dispose previous {0007..0145}.png -resize ${size}x${size} -coalesce -layers OptimizeFrame scotch_${size}_short.gif
done
This is how the images look right now:





See the jagged edges of the smaller versions.
Why do I not just make the background solid? It will be used on Twitch as a cheer emote. There the background of the are where it will be displayed is #FFFFFF
, but who knows, it might change. So I'd like it to gracefully degrade so it will *then* have visible aliasing until I update the emote. (Note that there is also a dark mode, so I have to do this all twice also for a dark background, but I somehow got that already.)
Asked by panzi
(131 rep)
May 24, 2017, 01:20 AM
Last activity: May 25, 2017, 12:41 PM
Last activity: May 25, 2017, 12:41 PM