I have a binary file which contains several images in various uncompressed formats (24-bit per pixel RGB, 8-bit indexed pixels, etc.). Interspersed in this file are also strings and other data. I'd like to extract the images from the file and also determine their parameters (bit-depth, horizontal dimension, vertical dimension).
Is there a program that can intelligently do this? Here's an example:
Suppose this image is in the binary file:
To extract that image (in the absence of any header info), I need to know the bit-depth, the size, and at least one dimension. That image is 300x300 pixels. If I extract the data and guess the dimensions wrong (say, 250x360), I would end up with this image:
Is there a program that can make multiple guesses of these three variables and end up with the correct answer by looking at the resulting image? I'm guessing such a program would make use of TensorFlow or something similar.