This program embed a message into an image by modifying lsb bit from alpha (transparency) part of ARGB, the mechanism of accessing the bits location in this code is confusing in this line:
startX = start/maxY, startY = start - startX*maxY
private void embedByte(BufferedImage img, byte b, int start, int
storageBit) {
int maxX = img.getWidth(), maxY = img.getHeight(),
____________________________________________________________
startX = start/maxY, startY = start - startX*maxY, count=0;
____________________________________________________________
for(int i=startX; i<maxX && count<8; i++) {
for(int j=startY; j<maxY && count<8; j++) {
int rgb = img.getRGB(i, j), bit = getBitValue(b, count);
rgb = setBitValue(rgb, storageBit, bit);
img.setRGB(i, j, rgb);
count++;
}
}
}
what is the mean of startX & startY and the purpose of two for loops?
Source code:
http://developeriq.in/articles/2013/feb/28/embedding-messages-in-digital-images-using-java/