What format is the Panasonic RW2 image data stored in?

Started by Videogamer555, February 07, 2015, 01:37:37 AM

Previous topic - Next topic

Videogamer555

I got a good start writing my own decoder for this format using these proprietary Panasonic TIFF tags http://www.exiftool.org/TagNames/PanasonicRaw.html but there's a problem when it comes to the actual pixel data format. I have heard that it is supposed to be 16bits per pixel, bayer-masked image data. But there's a problem. The image sensor size is 4816x3472 which makes a total of 16721152 pixels. And since it is 2-bytes per pixel that makes 33442304 bytes. But there's a problem with that. This would make 33MB of raw image data, but the whole image file is only 18MB. So naturally I would think it was compressed, but upon examining the image data using the raw image loader function of Gimp, I notice a repeating pattern emerging (not visually randomized "white noise" data as it would be for even LOSSLESS compressed image data such as PNG). So I don't believe it is compressed. But for some reason it contains only about half the image data I was expecting. The pattern I previously mentioned repeats every 16 bytes. Can somebody here (who's successfully reverse engineered this format) please relay to me the information you have discovered? I want to write my own raw image reader that can read the image data as saved by my Panasonic digital camera.

Phil Harvey

I think you could answer your question by tracing through David Coffin's dcraw code to see how he does it.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).