Hi,
This might sound stupid, but "please" cope with me.
I got an image in jpg format which I want to read in an array or something (not sure)
I only want the bytes of the image, not the headers, size, thumb etc.
Basically what I'm trying to do is:
Read the image, change a few colors by changing the "bytes", & then save it.
On wickypedia it says that jpeg format begins with a 0xFF byte, but I'm not able to find this in the images I read. All I get is numbers, symbols etc...
Here's my code so far (totally idiotic)
try{
InputStream in = new FileInputStream("test_file.jpg");
Reader reader = new InputStreamReader(in);
int r; byte b; char c;
while ((r = reader.read()) != -1){
b= (byte) r; c= (char) r;
System.out.println(" "+ b + " , " + r + " , " + c );
}
}catch (Exception e){ }
Am I missing something here, or is it totally in opposite direction?
Do I need to decompress/unzip the image data before reading it, or something else?
Please help me.
Thank you