Transparent color: black

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
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Transparent color: black

Post by youds »

Hi

The "identify -verbose" command is telling me that the transparent colour is black.
How do I specify the transparent colour to be white when using the convert command?

Thanks
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent color: black

Post by snibgo »

Is this for 256-pallette Gif?

The "-transparent-color" option is probably what you need.
snibgo's IM pages: im.snibgo.com
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Transparent color: black

Post by youds »

Thanks for the reply.

I'm doing:

Code: Select all

convert -transparent-color #FFFFFFFF original_newsletter.4b7d31b7d810c.png original_newsletter.4b7d31b7d810c.jpg
But I keep getting back the help message.

Can you help?
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent color: black

Post by snibgo »

Can you post a link to your image?
snibgo's IM pages: im.snibgo.com
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Transparent color: black

Post by youds »

Sure, no problem.
http://public.me.com/craigfairhurst saved with name "newsletter.png"
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent color: black

Post by snibgo »

"identify verbose" tells me the image has a conventional alpha channel. If you effectively want to place this image in front of a white background, so the white shows through the transparent areas, try:

convert newsletter.png -background white -flatten newsWhite.png

[Edited: added "-" in front of "flatten"]
snibgo's IM pages: im.snibgo.com
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Transparent color: black

Post by youds »

Thanks. Why the -flatten option?
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent color: black

Post by snibgo »

"Flatten" is what does the work. The "-background" just declares the colour that will be used by any operation that needs a background.
snibgo's IM pages: im.snibgo.com
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Transparent color: black

Post by youds »

What about PDF / EPS files, text will still be editable and the document will contain layers?
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Transparent color: black

Post by snibgo »

Editable only as pixels. ImageMagick is a raster processor -- it deals with pixels.
snibgo's IM pages: im.snibgo.com
synexis
Posts: 4
Joined: 2010-12-30T15:34:00-07:00
Authentication code: 8675308

Re: Transparent color: black

Post by synexis »

I was having this issue with 6.6.5-10. I downgraded to version 6.6.4-10 (I believe with the same configuration options), and the problem went away.
This was after a similar issue with 6.6.6-8, where black values would turn transparent with png output.
Hope that helps someone. Cheers.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Transparent color: black

Post by fmw42 »

synexis wrote:I was having this issue with 6.6.5-10. I downgraded to version 6.6.4-10 (I believe with the same configuration options), and the problem went away.
This was after a similar issue with 6.6.6-8, where black values would turn transparent with png output.
Hope that helps someone. Cheers.

This has already been reported and is being worked on. See bugs at viewtopic.php?f=3&t=17748
youds
Posts: 53
Joined: 2010-01-28T05:38:11-07:00
Authentication code: 8675309

Re: Transparent color: black

Post by youds »

Thanks
ImageMagick 6.5.9-1
GhostScript 8.7
libpng-1.2.43RC1
iMagick 3.0.0RC1
Post Reply