Hey guys,

I wasn't really certain which category this question fell under, so I chose CS with it being the broadest.

I was recently given a text file and told that it could be converted into an image. The text file looks like this...

0000000 d8ff e0ff 1000 464a 4649 0100 0001 0100
0000010 0100 0000 e2ff a80c 4349 5f43 5250 464f
0000020 4c49 0045 0101 0000 980c 7061 6c70 1002
...
000d320 8b4c 1b28 3bd4 0016 91e0 799e 34c1 4457
000d330 7113 ee4d cd73 4945 63db d9ff          
000d33c

From googling, I'm pretty sure that this is a .hex file (though many of the hex files I have seen online had different formats, so I am not certain).

Is anyone certain on what type of file this is and how I can convert it back to a viewable image?

Thanks for your time,
oldezwe

This is a binary file. An image consists of pixels. Usually, they are encoded into 8, 16, 24, or 32 bit values depending upon the "depth" of the image (number of colors). This looks like a 16 bit image at first glance (no guarantees - it may be 32-bit). You need to know the size of image in pixels across and down. The first field in each line represents something, but I'm not sure what. Since it seems to increase in 16 decimal digit values for each line, that means something, but what... :-) My guess? Is that it is a standard file format such as gif, jpeg, png, or such. Research standard image encoding standards and figure out which. I haven't don't image processing stuff for over 20 years, so I don't know what more to tell you.

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.