By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,468 Members | 1,865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,468 IT Pros & Developers. It's quick & easy.

Please, I need a little help of a "coloured guru".

P: n/a
rmn
Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.
Please, I need a little help of a "coloured guru".
-----------------------------------------------------
import java.awt.*;
import java.awt.image.ColorModel;
import java.awt.color.ColorSpace;
.... ....
.... ...

float[] xyz={0,0,0,0};
float[] cmk={0,0,0,0};
Color rbg=new Color(0.5f,0.5f,0.5f);
try{

ColorSpace cS=ColorSpace.getInstance(ColorSpace.TYPE_CMYK);
ColorSpace cE=ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK

rbg.getColorComponents(cE,xyz);
Color cie=new Color(cE,xyz,0);
cie.getColorComponents(cS,cmk);

}catch(InterruptedException e){
System.out.println("no va");
}
finally{
System.out.println("RGB..."+rbg.toString()); // shows rgb values
System.out.print("CIE...");
System.out.println(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
shows 0.0 0.0 0.0 0.0 ...
System.out.print("CMYK...");
System.out.println(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- ; (thanks in
advance)




Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
rmn wrote:
Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.
Please, I need a little help of a "coloured guru".


Hey! Caucasians are smart too!

-Peter
Jul 17 '05 #2

P: n/a
rmn

Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.

ramon.
----------------------------------------------------- (thanks in advance)
import java.awt.*;
import java.awt.image.ColorModel;
import java.awt.color.ColorSpace;
.... ....
.... ...

float[] xyz={0,0,0,0};
float[] cmk={0,0,0,0};
Color rbg=new Color(0.5f,0.5f,0.5f);
try{

ColorSpace cS=ColorSpace.getInstance(ColorSpace.TYPE_CMYK);
ColorSpace cE=ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK

rbg.getColorComponents(cE,xyz);
Color cie=new Color(cE,xyz,0);
cie.getColorComponents(cS,cmk);

}catch(InterruptedException e){
System.out.println("no va");
}
finally{
System.out.println("RGB..."+rbg.toString()); // shows rgb values
System.out.print("CIE...");
System.out.println(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
file://shows 0.0 0.0 0.0 0.0 ...
System.out.print("CMYK...");
System.out.println(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
file://shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- (thanks in advance)

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.