PNG image has a black background after resizing with im.

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
janekyun

PNG image has a black background after resizing with im.

Post by janekyun »

I have a png image which opens in IE6 with a white background but after using resize the png opens with the black background.
I am using the following command to resize the image.
convert Tara-Cell1_2.png -resize 640x480 Tara-Cell1_22.png

Any replies appreciated.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG image has a black background after resizing with im.

Post by fmw42 »

does your png have any transparency or alpha channel?

identify -verbose Tara-Cell1_2.png
janekyun

Re: PNG image has a black background after resizing with im.

Post by janekyun »

I am posting only the alpha values
for Image: Tara-Cell1_2.png
Alpha: rgba(255,255,255,0) #FFFFFF00

for Image: Tara-Cell1_22.png
Alpha: rgba(35,31,32,0) #231F2000

Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG image has a black background after resizing with im.

Post by fmw42 »

try

convert Tara-Cell1_2.png -channel rgba -alpha on -resize 640x480 Tara-Cell1_22.png
janekyun

Re: PNG image has a black background after resizing with im.

Post by janekyun »

Sorry it did not work.
Image Tara-Cell1_22.png still has the old alpha.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG image has a black background after resizing with im.

Post by fmw42 »

can you post a link to Tara-Cell1_2.png so others can examine it and try to convert it.

Also what version of IM are you using? If too old, perhaps you should upgrade.
Post Reply