Forum How do I...?

images in black and white

lcarey
Is there a way I can get Prince to make a black and white version of a colour image when generating the pdf?
mikeday
Not at the moment, you will need to have a black and white version of the image available (eg. created using Photoshop or a similar program) and use that.
jay@zenefits.com
Is this feature available now?
If not, could you please suggest a work around?
mikeday
Prince does not support the CSS "filter" property. We might be able to partly implement this property, if it is restricted to applying only to image elements. But it will take some time.

Alternatively, you can use a command-line program like ImageMagick to convert the images to grayscale before running Prince. For example:

$ convert <img_in> -set colorspace Gray -separate -average <img_out>

There is further discussion of this on StackOverflow here:

http://stackoverflow.com/questions/13317753/convert-rgb-to-grayscale-in-imagemagick-command-line

Finally, it may be possible to use JavaScript and the <canvas> element to do the conversion, but it may be a bit slow to run, so it's not the best option if speed is a concern.