I am trying to set either red, green, or blue value of a BufferedImage. After that, i will retrieve that red/green/blue value, and then I will process that value.
But my problem is when I doing this
Color cipherColor = new Color(cipherDecimal[offColor], cipherDecimal[offColor], cipherDecimal[offColor]);
int cipherColorInt = cipherColor.getRGB();
stegoImage.setRGB(x, y, cipherColorInt);
then, I'm curious about the value...so I add some codes to see the RGB value before and after i set the RGB
Color cipherColor = new Color(cipherDecimal[offColor], cipherDecimal[offColor], cipherDecimal[offColor]);
int cipherColorInt = cipherColor.getRGB();
stegoImage.setRGB(x, y, cipherColorInt);
int tesColor = stegoImage.getRGB(x, y);
System.out.println(cipherColorInt + "\t" + tesColor);
Info about stegoImage
BufferedImage stegoImage = new BufferedImage(img.getWidth(null), img.getHeight(null)+h, BufferedImage.TYPE_BYTE_GRAY);
img is just a normal image
It'll set RGB value almost right. ALMOST, because some of value changed. Here it is :
-------- RGB after and before----------
before after
-6052957 -6052957
-7303024 -7303024
-10855846 -10855846
-11053225 -11119018 --> changed
-3158065 -3158065
-2500135 -2500135
-13027015 -13092808 --> changed
-5658199 -5658199
-131587 -131587
-12500671 -12566464 --> changed
-5658199 -5658199
-16448251 -16777216 --> changed
-5526613 -5526613
-8553091 -8553091
-1579033 -1579033
-3421237 -3421237
Please help me :) For now, if you know other way to set Red/Green/Value without setRGB or even BufferedImage please tell me. Or perhaps, if you know what makes the value changed or how to fix it, then please tell me.
Thank you