Fikei meio confuso com o posicionamento em 2 pixels…
Tá certo os >> dos bits??
[code]
Color m = new Color(imagem.getRGB(line, colum));
int a = m.getRed();
a = a>>2;
a = a<<2;
int b = m.getGreen();
b = b>>1;
b = b<<1;
int c = m.getBlue();
c = c>>1;
c = c<<1;
Color m2 = new Color(imagem.getRGB(line+1, colum));
int a2 = m.getRed();
a2 = a2>>2;
a2 = a2<<2;
int b2 = m.getGreen();
b2 = b2>>1;
b2 = b2<<1;
int c2 = m.getBlue();
c2 = c2>>1;
c2 = c2<<1;
/////
int bits = letras[x];
bits = bits & 3;
int novoC = c | bits;
bits = letras[x];
bits = bits >>2;
bits = bits & 3;
int novoB = b | bits;
bits = letras[x];
bits = bits >>3;
bits = bits & 3;
int novoA = a | bits;
/////////////////////
bits = letras[x];
bits = bits >>5;
bits = bits & 3;
int novoC2 = c2|bits;
bits = letras[x];
bits = bits >>6;
bits = bits & 3;
int novoB2 = b2|bits;
bits = letras[x];
bits = bits >>7;
bits = bits & 3;
int novoA2 = a2 |bits;
Color newColorr = new Color(novoA,novoB,novoC,m.getAlpha());
Color newColorr2 = new Color(novoA2,novoB2,novoC2,m2.getAlpha());
imagem.setRGB(line, colum, newColorr.getRGB());
imagem.setRGB(line+1, colum, newColorr2.getRGB());[/code]
Se tiver… Para voltar não seria assim?
[code] Color m = new Color(img1gp.getRGB(0,0)); //x,c
int R = m.getRed();
int G = m.getGreen();
int B = m.getBlue();
Color m2 = new Color(img1gp.getRGB(1,0)); //x,c
int R2 = m2.getRed();
int G2 = m2.getGreen();
int B2 = m2.getBlue();
int byteValue = ((R & 3) << 3) | ((G & 3) << 2) | ((B & 3) | ((B2 & 3) << 5) | ((G2 & 3) << 6) | ((R2 & 3) << 7)); [/code]