How to set background color for grayscale image

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
harryspier
Posts: 6
Joined: 2012-06-17T17:10:46-07:00
Authentication code: 13

How to set background color for grayscale image

Post by harryspier »

Using MagickWand API I want to set the background color to white for a grayscale image.

I have an example for doing this in rgb as follows but I'm not sure how to specify "white for a grayscale image in the following example:
pwo = NewPixelWand();
PixelSetColor(pwo,"rgb(60%,60%,60%)");
MagickSetImageBackgroundColor(mwf,pw0);

Thanks,
Harry Spier
Post Reply