, WritableRaster, ColorModel, - , :
ColorModel colorModel = ColorModel.getRGBdefault(); // Or any other color model
WritableRaster raster = colorModel.createCompatibleWritableRaster(width, height);
, , , , DataBuffer . java.awt.image.BufferedImage createCompatibleWritableRaster ColorModel (, , :-). , .
:
Raster.createPackedRaster(db,width,height,1,null);
... , MultiPixelPackedSampleModel 1 ... , , RGB. , :
int[] masks = new int[]{0xff0000, 0xff00, 0xff};
Raster.createPackedRaster(db, width, height, width, masks, null);
PS: image.setRGB , data .