Hey everyvody... I have this crazy idea for a program... I want to be able to load an image (most likely a .jpg) into a java program and then I want the program to print out the binary code that makes up the image and save it to a .txt file. I know how to do the i/o stuff... but I can't think of how to extract the binary code from the image.... Anybody know how to do this?
I think you would have to create a PixelGrabber which returns an array of ints made from the image. Once you have that, I think you could use this method to convert the ints to binary:
Integer.toBinaryString(int);
Here is an example of a Pixel Grabber that creates a screen shot and throws it into an array of ints.
Alright, the pixelgrabber worked perfectly! Thank you... But now is there a way i can compile the binary back to an image after i modify it a little bit? I'm trying to make something of a stegonagraphy program but I can't think of how to save it back to an image again...
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.