天天看點

java rgb cmyk,如何在Java中将RGB圖像轉換為CMYK,反之亦然?

java rgb cmyk,如何在Java中将RGB圖像轉換為CMYK,反之亦然?

our web app let users download dynamically generated images in different formats (bmp, png and jpeg). Some of our users download the images for printing, thus we would like to allow them to choose between RGB or CMYK.

Is there a way to specify the color model when creating a RenderedImage/BufferedImage? If not, what is the default color model and how can I change it to another?

Code snippets are welcome :)

Thanks,

Olivier.

解決方案

Some image formats doesn't allow CMYK color spaces (PNG, JPEG/JFIF, GIF...) and for normal users printing in RGB is desirable.

What are the reasons you need to provide CMYK images to your customers?