0

I am trying to reverse engineer an image file generated by my microscope. It is supposed to be an HDR image. The file has very distinct pattern in HEX editor but I am unable to recognise it: enter image description here

First 16 bytes are some sort of a header and then every 4th byte is 0x3C, and sometimes it is 0x3D instead. The file continues with the same pattern until the end and ends with 0x3C as well. Is this something very proprietary or do any of you guys recognise it?

Edit: The entire file is available here.

6
  • 2
    Do you have any software that is able to open this file?
    – morsisko
    Jul 30, 2020 at 11:50
  • 1
    Those are 4-byte floating point numbers -- small ones, I guess. Is that something you could expect? Post a link to a complete file, so we can take a look.
    – Jongware
    Jul 30, 2020 at 13:12
  • Is the image resolution 2048x1536 by any chance ?
    – Ian Cook
    Jul 30, 2020 at 16:03
  • 1
    is there a viewer for the images?
    – Igor Skochinsky
    Jul 31, 2020 at 20:31
  • 1
    I'd try to interpret is as a raw image by pixels and assume that there is no compression or image transformation here. The header should include width and height. What is then size of the whole file ? Can you upload an example ?
    – w s
    Aug 1, 2020 at 15:00

1 Answer 1

6

Without more information, as suggesting by the various comments, it's hard to be completely sure but, based on the information available, the format seems to be a very simple uncompressed vendor-specific 'raw' format with no specific identification or 'magic' numbers or tagged structure.

What follows is my best guess as to the format. Having a full file and a picture of the image it is thought to contain would confirm specific details either way.

The header appears to have the following format -

00000000: 00000800    // width of image (W) = 2048 pixels
00000004: 00000600    // height of image (H) = 1536 pixels
00000008: 0000000C    // number of bytes per pixel (B) = 12 bytes
0000000C: 00006000    // number of bytes per row (T) = W * B, probably rounded up to multiple of 8 or 16 

The suggested size of 2048x1536 does appear consistent with specifications from several digitail/usb microscopes that are available online.

The pixel data then follows for each row, with each pixel appearing to be stored as 3x 32-bit IEEE floating-point value (i.e. B = 12 bytes.) These three values being, presumably, R, G & B components in some order.

// 1st row
00000010: 3C8B50D4 3C8F6AF0 3C8974E5    // 1st pixel = 0.017006, 0.017507, 0.016779
0000001C: ....

Subsequent rows will appear T bytes beyond the previous row.

// 2nd row (at 0x00000010 + 0x00006000)
00006010: ....

// 3rd row (at 0x00000010 + 0x00006000 x 2)
0000C010: ....

// 4th row (at 0x00000010 + 0x00006000 x 3)
00012010: ....

etc...

If correct, this would suggest your original file is relatively large at around 36MB.

2
  • Absolutely on point! The resolution is exactly correct, and also tie file size. I do have a viewer application to confirm that, but the application is not freely available unfortunately. I will try to write some code now to convert the file to some regular image format in order to figure out the order of R, G and B components. I will edit my question now and include the link to the whole file, in case someone else wants to play with it as well.
    – hlex
    Nov 5, 2020 at 13:53
  • The raw data is is 96 bits per pixel, so unless you use a format that supports this (e.g. Floating-point TIFF) you are going to have to decide how to convert the pixel values to something more widely supported like 24 bits per-pixel.
    – Ian Cook
    Nov 6, 2020 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.