Ok I know that the topic is a bit vague, but bear with me. I was wondering how can I get access to the raw data that an image is stored in on the hard drive. I am guessing that it is stored as a long list of hex values, but am prob wrong. Does anyone know exactly how the images is stored, and what the best way to access the raw data?

If I write 1 byte of data to a file, it is stored as a 4kb file in Windows. I realize this is becasue of windows file structure, and am guessing that windows cannot have a file less than 4kb. Is this correct? can I store 1 byte into a file that takes up less than 4k on my windows machine?

You don't want to use "getRaster().getDataBuffer()).getData()" on images that are loaded from file. Atleast not if you are a newbie. The problem is that the image can be stored in so many different ways. Finding how it is stored and how to interprit it can be a hassle. It is mostly used on images that you create your self that you need speedy access too, like a software backbuffer. Since you create the image yourself, you know how the data is stored.

Use int[] BufferedImage.getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) instead. It creates a copy of the image, and it the data is always stored as argb (alphe, red, green, blue). Then you have to shift and mask to get what you want.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org