Page 1 of 1

Transparency fallback color?

Posted: 2015-04-26T10:39:33-07:00
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.

Re: Transparency fallback color?

Posted: 2015-04-26T12:53:37-07:00
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.

Re: Transparency fallback color?

Posted: 2015-04-27T00:27:00-07:00
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.