我无法修改BufferedImage

时间:2016-04-15 10:14:04

标签: java steganography

我想修改颜色成分我不知道该怎么办,有人可以帮我吗?我试过这个:

posX = 20;
posY = 10;
int srcPixel = image.getRGB(posX, posY);
Color c = new Color(srcPixel);
// I want to change Red component, for example,
valR = c.getRed();   //valR = 220; (for example)
valG = c.getGreen();
valB = c.getBlue();
valMod = valR - 1;

Color c2 = new Color(ValMod,valG,valB);
//my BufferedImage is imagenL

imagenL.setRGB(posX,posY,c2.getRGB());

请帮帮我。

谢谢,伙计们!

0 个答案:

没有答案