Transparency fallback color?

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
Marsu42
Posts: 75
Joined: 2014-06-12T03:17:45-07:00
Authentication code: 6789
Location: Berlin

Transparency fallback color?

Post by Marsu42 »

I'm generating transparent round corners with "-matte mask.mpc -compose DstIn" ... works fine in an image viewer on screen (tiff) and for the web (png).

However, when I paste the same tiff into a layout software (InDesign) it insists on rendering the transparency *black* (even though the page canvas behind the picture is white). Is this some quirk of InDesign and I have to generate white (i.e. non-transparent) corners in the first place, or is there a "fallback" color option that directs software which color to render the transparency data with?

Edit: Do note that I'm aware that it's probably smarter to add round edges in the layout software itself and I'm aware of how to do that, I'm just wondering about if there's a way to specify this transparency "color" with IM and why it turns up as black in the first place.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Transparency fallback color?

Post by glennrp »

Try "-background white". This should cause the PNG encoder to write a "bKGD" chunk. e.g.,

Code: Select all

convert logo: -background white -transparent white logo_with_white_bkgd.png
Some applications use the color from the bKGD chunk to fill in transparent or unused areas. I don't
know what InDesign will do, though.

The IM options documentation at http://www.imagemagick.org/script/comma ... ptions.php
says that the default background is white, but in fact

Code: Select all

convert logo: -transparent white logo_with_undefined_bkgd.png
writes a bKGD chunk
with color 4,7,7 which is almost black (255,255,255 is white). That seems to be a bug.
User avatar
Marsu42
Posts: 75
Joined: 2014-06-12T03:17:45-07:00
Authentication code: 6789
Location: Berlin

Re: Transparency fallback color?

Post by Marsu42 »

glennrp wrote:Try "-background white".
Thanks, good to know - though unfortunately Indesign doesn't recognize this set background color, I have to do "-alpha Remove" via IM.
Post Reply