question: public static BufferedImage createRGBImageFromInvertedYCCK ( Raster ycckRaster , ICC_Profile cmykProfile ) { BufferedImage image ; if ( cmykProfile != null ) { ycckRaster = convertInvertedYCCKToCMYK ( ycckRaster ) ; image = createRGBImageFromCMYK ( ycckRaster , cmykProfile ) ; } else { int w = ycckRaster . getWidth ( ) , h = ycckRaster . getHeight ( ) ; int [ ] rgb = new int [ w * h ] ; int [ ] Y = ycckRaster . getSamples ( 0 , 0 , w , h , 0 , ( int [ ] ) null ) ; int [ ] Cb = ycckRaster . getSamples ( 0 , 0 , w , h , 1 , ( int [ ] ) null ) ; int [ ] Cr = ycckRaster . getSamples ( 0 , 0 , w , h , 2 , ( int [ ] ) null ) ; int [ ] K = ycckRaster . getSamples ( 0 , 0 , w , h , 3 , ( int [ ] ) null ) ; float vr , vg , vb ; for ( int i = 0 , imax = Y . length ; i < imax ; i ++ ) { float k = 255 - K [ i ] , y = 255 - Y [ i ] , cb = 255 - Cb [ i ] , cr = 255 - Cr [ i ] ; vr = y + 1.402f * ( cr - 128 ) - k ; vg = y - 0.34414f * ( cb - 128 ) - 0.71414f * ( cr - 128 ) - k ; vb = y + 1.772f * ( cb - 128 ) - k ; rgb [ i ] = ( 0xff & ( vr < 0.0f ? 0 : vr > 255.0f ? 0xff : ( int ) ( vr + 0.5f ) ) ) << 16 | ( 0xff & ( vg < 0.0f ? 0 : vg > 255.0f ? 0xff : ( int ) ( vg + 0.5f ) ) ) << 8 | ( 0xff & ( vb < 0.0f ? 0 : vb > 255.0f ? 0xff : ( int ) ( vb + 0.5f ) ) ) ; } Raster rgbRaster = Raster . createPackedRaster ( new DataBufferInt ( rgb , rgb . length ) , w , h , w , new int [ ] { 0xff0000 , 0xff00 , 0xff } , null ) ; ColorSpace cs = ColorSpace . getInstance ( ColorSpace . CS_sRGB ) ; ColorModel cm = new DirectColorModel ( cs , 24 , 0xff0000 , 0xff00 , 0xff , 0x0 , false , DataBuffer . TYPE_INT ) ; image = new BufferedImage ( cm , ( WritableRaster ) rgbRaster , true , null ) ; } return image ; }
target:  Creates a buffered image from a raster in the inverted YCCK color space, converting the colors to RGB using the provided CMYK ICC_Profile.