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?
stupidenator
0
Junior Poster
Recommended Answers
Jump to PostI 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 …
All 4 Replies
server_crash
64
Postaholic
freesoft_2000
9
Practically a Master Poster
stupidenator
0
Junior Poster
Urchin1111
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.