convert inverting color on resize

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

You are converting a image with transparency (GIF) to an image format that can NOT handle transparency (JPG). the result is transparent areas are now black.

To fix set a backgound color and -flatten the image onto that color.

Code: Select all

convert image.gif -resize 125x125 -background grey -flatten image.jpg
Or if you likemage.gif the 'transparent color' that GIF uses. Remove the transparency before doing ANY form of image processing.

Code: Select all

convert image.gif +matte -resize 125x125  image.jpg
Finally -geometry as a resize operator is depreciated in favor of -resize, See
http://www.cit.gu.edu.au/~anthony/graph ... ics/#notes
for details, and its backward compatiblity handling.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply