Use ColorConvertOpthis to do the color space conversion. You have several options for setting the icc color profile. Either you use a predefined profile using getInstancethe correct color space constant, or you can specify a file containing the profile. Here is an example:
ICC_Profile ip = ICC_Profile.getInstance( ColorSpace.CS_sRGB );
ICC_ColorSpace ics = new ICC_ColorSpace( ip );
ColorConvertOp cco = new ColorConvertOp( ics, null );
BufferedImage result = cco.filter( sourceImage, null );
resultwill contain an image with color space sRGB.
source
share