Changing lsb value of image rgb value giving inconsistent value
问题 I am trying to change the lsb value of image pixels such that it matches with the string "abc" but adding 1 or 0 to a pixel with odd value is returning 0. here is the code: public static void main(String[] args) { BufferedImage img = null; try { img = ImageIO.read(new File("a.jpg")); } catch (IOException ex) { } int pixel[] = img.getRGB(0, 0, img.getWidth(), img.getHeight(), null, 0, img.getWidth()); String s = "abc"; byte[] b = s.getBytes(); String f = ""; for (int i = 0; i < b.length; i++)