"Oracle3001" <ad*************@hotmail.com> wrote in message news:<bl**********@wisteria.csv.warwick.ac.uk>...
Hi All,
I want to take an image maybe in a jpeg or gif format or rgb and convert it
to a series of CMYK images (one for each colour). If there an easy way using
the API of java 2, or JAI. If not does anybody no an algorithm I can use to
implement this conversion.
Cheers,
Adam
Write a reverse function of this:
/** CMYK to RGB conversion */
/* Adobe PhotoShop algorithm
cyan = Math.min(255, cyan + black); //black is from K
magenta = Math.min(255, magenta + black);
yellow = Math.min(255, yellow + black);
rgb[0] = 255 - cyan;
rgb[1] = 255 - magenta;
rgb[2] = 255 - yellow;
*/
/* GNU Ghostscript algorithm -- this is better*/
int colors = 255 - black;
rgb[0] = colors * (255 - cyan)/255;
rgb[1] = colors * (255 - magenta)/255;
rgb[2] = colors * (255 - yellow)/255;