I have a binary blob, and I know that it carries bitmap image data, 1-bit depth.
However, I don't know how the bitstream can be decoded; judging from the screenshot from here, which is of a program called LCD Assistant:
I'd need to be able to specify byte orientation, WxH size, endianness, pixels/byte, in order to fully decode unknown byte format. (And the above tool is not appropriate, because it is a "tool for converting monochromatic bitmaps to data arrays" in C)
I tried Gimp File/Open Image (click Select File Type (Automatically Detected), a list opens, choose "Raw image data" with extension (data), click Open), and I get this screen ("Load Image from Raw Data"):
So, I can choose B&W 1 bit, offset, width, height - but no byte orientation, endianness, or pixels/byte.
Is there a command line tool that can decode a binary blob as a 1-bit bitmap, and convert that to a "normal" PNG (say, a grayscale PNG)?
I guess ImageMagick convert
could probably do it - but I simply cannot find any example on how to do this, and I cannot find which of its many, many options might be appropriate, if any.
convert -depth 1 -size <width>x<height> gray:<input_file> <output_file>.png
gray:
would force 8-bit intepretation of the input file, and I know it is in 1-bit - but in say0b10101011
, the bits could represent pixel values row-wise, or column-wise; and without being able to specify this in the command line, it will be difficult to decode