MATLAB Answers


Identifying an image type or format

Asked by Amit
on 3 Jan 2016
Latest activity Commented on by Walter Roberson
on 5 Jan 2016
Hello all:
I am at the end of my wits. I am trying to open an image file with no extension info. It has an octet-stream but no header. Not that I am an expert in the matter, but I have tried many usual approaches over last few hours.
Can somebody help me with hints on how to render this (attached) image.
Please note that my original file had no extension, I made it .txt to be able to upload it here.
Thanks much. Regards, Amit


Sign in to comment.


2 Answers

Answer by Image Analyst
on 3 Jan 2016

It looks like a different pattern starts after 6720 bytes but I don't know if the first 6720 bytes are the header or not. There are other patterns that seem to occur at multiples of 75 lines. I tried reading images with every size up to 512 wide and nothing starts to appear. It's almost total garbage. Maybe it's an indexed image
for k = 1 : 512
fid = fopen('screen.txt');
% fseek(fid, 16*420, 'bof');
theImage = fread(fid, [k, k], '*uint8'); % Also tried '*uint16'
imshow(theImage, []);
axis on
axis image
caption = sprintf('k = %d', k);
Surely you must know something about this file. Otherwise why would you even want to import it?


Dear Image Analyst:
Thanks in deed. I am working to get the maximum possible info about the file. I don't want to misguide by wrong info, but my my current understanding is:
that this 1600 X 1200 24-bit color image.
that I expect a lot of black (or dark shade of grey) pixels in the image.
that this image is one of the series of images that are 'captures' of a screen, every 10-15 second typically.
Let me look for and share more info shortly.
Thanks much and regards.
Any thoughts, Image Analyst, all?
Thanks, regards.
No, though Guillaume does - see his Answer. You had said "Let me look for and share more info shortly." so I was waiting for that info before I did anything more. I was expecting you to research who made this file, and whether you could get the format from them.

Sign in to comment.

Answer by Guillaume
on 4 Jan 2016

The more information you give, the easier it makes it to try to identify the image type. What is used to capture the image (what software/hardware?). Is the image supposed to be able to be read by something else? etc.
Just from your size statement, we can infer something:
A 1600 x 1200 x 3 bytes (24-bit) is 5 MB of data. As your file is only 150 kB, it is heavily compressed. Possibly something like jpg. Problem is it's not a standard jpg file.
Your file appears to have some sort of header, but I would expect the size of the image to appear early in that header but it's not there. What it starts with, though, is possibly a date: 5/10/2015 ? and maybe a time 17:02:24.
No idea what the rest is. In any case, your file is not a standard image format so without more information, it's going to be very difficult to decode.


on 4 Jan 2016
After further investigation, there's no jpeg compressed information at all within that file, or at least, it does not contain the required markers as specified by the jpg standard.
Similarly, there's no png data embedded anywhere.
The compression ratio is over 75 to 1.
It could be that there is a bunch of run length encoding, but I did not observe any repeated marker that would occur in run-length encoded data.
It could be that there are huffman tables and perhaps arithmetic encoding, but it is not a standard file that I can identify. It might be completely proprietary.

Sign in to comment.