How do Lumix Cameras Process RAW Files for Dead Pixels?

Discussion in 'Panasonic Cameras' started by SC489, Oct 19, 2014.

  1. SC489

    SC489 Mu-43 Rookie

    19
    Aug 2, 2014
    I'm seeing about 25 dead pixels (always off) in the same position in RAW files from my GX7 when using certain RAW processors with noise reduction turned off (e.g. DXO Optics Pro and ACDSee Pro). I never see the dead pixels in JPG images showing the camera's dead pixel mapping and interpolation algorithms are correcting for dead pixels before exporting an image. All RAW processors remove the dead pixels when noise reduction is enabled and Lightroom seems to remove them by default.

    I'm trying to work out if the detection of dead pixels by these RAW processors is normal or whether I need to return the camera under warranty. Please advise how Lumix cameras handle dead pixels in RAW data - which of the following is correct?

    1. The GX7 camera maps the dead pixels and exports a clean RAW image containing no dead pixels in the image unknown to the camera. If any further dead pixels are present (unknown to the camera), then the RAW processor should remove them.

    2. The GX7 camera maps the dead pixels but these are not corrected in the RAW image. The RAW processor is therefore required to correct all dead pixels including those already known to the camera.

    3. The GX7 camera maps the dead pixels and exports a RAW file with no image corrections for dead pixels but includes a list of dead pixel locations known to the camera. The RAW processor may use the camera's dead pixel information or may process the RAW image from scratch ignoring the known dead pixel data from the camera.
     
  2. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    The short answer is no one knows. The RW2 format is proprietary. Companies like Adobe can get it from the manufacturer under NDA and then they implement it however they best see fit for their RAW converter. We have no way of knowing if they did it right or if they decided to ignore some metadata information and handle dead/stuck pixels themselves. Same goes for many other commercial RAW converters.

    After that you are left with converters that use LibRaw or dcraw to read RAW files. These are based on reverse engineering of the RW2 file and so again we have no idea if it was done correctly or is making full use of the information the camera provides.

    If you go read the dcraw source code it appears the camera may be flagging bad pixels (both stuck or dead) by setting a value of zero for the pixel. This is technically an invalid pixel level and would thus flag the RAW converter that it should interpolate the pixel. Of course the RAW editor could erroneously interpret that simply as black and then depend on its own dead/stuck pixel handler to detect and interpolate it. Really there is no difference between those two options in most cases.

    I haven't ever looked at the LibRaw code in detail but often it seems to lean on whatever Dave Coffin did for dcraw so I doubt there is any difference there.

    It sounds like everything is working as it should with your camera. Any issues you are seeing (and I find it hard to see there are any issues) are with how RAW converters hand pixel interpolation. I suspect if you return your camera you'll get one back that behaves exactly the same way.

    If you feel like code diving be aware that Coffin is pretty much a poster child for every single type of bad coding practice and produces utterly unreadable code. That said, he gets the important job done! You might find this post and some of the following useful for understanding how RW2 raw data is stored and how potentially it is flagging bad pixels:

    http://www.dpreview.com/forums/post/40154581
     
  3. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
  4. Wasabi Bob

    Wasabi Bob Mu-43 Top Veteran

    All cameras are going to have dead pixels when you look at the raw file before processing. As the length of the exposure increases, you may see more. Some may take long exposures with the lens cap on and discover this. RAW processing and in camera processing to JPG takes care of this. This is normal, I've tried this with a D800 and saw the same results. Nothing to worry about.
     
  5. SC489

    SC489 Mu-43 Rookie

    19
    Aug 2, 2014
    Many thanks for these posts. It's good to know what we don't know! I also didn't know the Panasonic RAW format is strictly lossy - but I asuume it is still much better than using JPGs?
     
  6. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    Yes, it is barely lossy at all and as far as I know no one has ever been able to illustrate any visual impact of the lossy compression no matter how severe a post processing you apply to the RAW file. You have to remember all pixels contain noise no matter how low an ISO. The way the RW2 compression works it is only ever "throwing away" data that is lower in magnitude than the noise already present in the pixel. In a very simplified way you can think of it as only "throwing away" data that was already hidden by noise. In a very high contrast scene it is certainly possible with extreme post processing you could detect a compression artifact but so far I've not been able to ever see one even in pretty contrived testing situations.

    JPEG on the other hand throws away lots and lots of data much of it very visible once you start post processing - even at the highest quality settings. The most obvious example of course being trying to recover highlights which is easy in RAW and impossible with JPEG. But also shadows which you can push quite a bit with RAW and noise reduction but with JPEG often produces ugly blocky splotches.

    Basically the RW2 compression algorithm while "lossy" really isn't lossy in any visible way. This is different from some other kinds of lossy RAW compression other cameras use. The Sony A7 cameras for instance do a more severe kind of compression which you can see artifacts from in certain high contrast scenes (star trails are the easiest example). So far I don't know of anyone getting a RW2 to visibly show its compression.
     
    • Like Like x 1
  7. Wasabi Bob

    Wasabi Bob Mu-43 Top Veteran

    Please explain Strictlt Lossy?


    Can you explain "strictly lossy"?
    RAW is the actual sensor data, so no compression is applied until you impose whatever processing you choose to the RAW data. For example, saving to JPG would introduce compression, which you decide how much to apply, so I can agree that "loss" is introduced. However, this would be the same for any digital camera.

    Regarding the pixel issue, I'm not aware of any camera / sensor which does not have irregular pixels. Many article have been published on this topic. It's the same situation with hard disc drives, whose bad sectors are mapped out. This just seems like a pixel peeper topic that is essentially invisible in the the end result.
     
  8. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    Panasonic RAW files do use a lossy compression algorithm. You can not get uncompressed RAW data from a Panasonic camera. See posts I linked to earlier for a description of the lossy compression algorithm Panasonic uses for its RAW files.

    This is not unusual, many camera manufacturers do this. All the Sony A7 cameras have lossy compressed RAWs. Many Nikon cameras do as well, some have the option for compressed or uncompressed - as well as 14 or 12 bit.

    In the case of the Panasonic RAW files the loss of data in the compression algorithm is extremely mild and unlikely to ever be visually detected.
     
  9. Wasabi Bob

    Wasabi Bob Mu-43 Top Veteran

    Unlikely to be a concern

    That was my reason for asking. Suggesting that it's "lossy" also suggests that some deterioration in the visible quality of the end result will be visible. In the majority of cases the end result is saved to JPG which by itself introduces so many artifacts that were not part of the original data.
     
  10. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    The Panasonic RAW file compression is strictly lossy in that information from the sensor array is lost irrevocably. This is different than Olympus RAW file compression in which is strictly lossless as no such loss of information occurs. It so happens that the information lost in the Panasonic compression process seems to never be visible in processed images, so in that sense it could be consider practically lossless. Which I think is what you are saying. But I'm fairly certain this is what the OP meant by "strictly" - Panasonic RAW files do not contain a 100% faithful recording of the RAW data from the camera even if in a practical sense the difference is irrelevant. Of course as already described the loss of information in JPEG compression is far, far more severe and is visible in many practical situations.
     
  11. Wasabi Bob

    Wasabi Bob Mu-43 Top Veteran

    Without having official documentation from each manufacturer, which is not likely to be released, much of what you are stating is based on speculation and independent reverse engineering. This is the kind of stuff pixel peepers feed on. In the end, while we can magnify, reverse engineer, and speculate until the cows come home, the end product does not offer any visible difference given the way we view images today. Just as MP3 has destroyed audio quality, cellphones, tablets and social media have replaced large prints that were able to show subtle differences. This also strengthens the mirrorless market, which is slowly showing that full frame sensors are not required to compete in today's constantly changing digital landscape.
     
  12. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    @Wasabi Bob - I'm not disagreeing with you at all, you asked what "strictly" meant and I was trying to explain what "strictly" means. Essentially that word refers exactly to your objection - a strict but not necessarily practical definition of something.

    And no, what I'm referring to is derived from the RAW files themselves and is irrefutable. It is not speculation it is demonstrated fact. Panasonic for a small number of pixels in an image throws away a few bits of information in their RAW files. And no one cares, it is a non-issue when it comes to final images - even heavily processed images.

    This is in contrast to Sony A7 RAW files which also throw away a few bits of information for some of the pixels in an image. In the case of the Sony files people have been easily able to show visible negative impacts to certain final images as a result. Not most images, but some special cases clearly show compression artifacts.

    And that gets back to the original point of "strictly". Both Panasonic and Sony RAW files are strictly lossy. However, Panasonic files are practically lossless why Sony files are not.
     
  13. SC489

    SC489 Mu-43 Rookie

    19
    Aug 2, 2014
    I did mean strictly lossy in the sense that a minor compression is applied the RAW sensor data. In my orignal post, I was trying to work out if my new GX7 camera is operating normally. It seems it probably is and thanks for the detailed discussion.
     
  14. D MATIC

    D MATIC Mu-43 Regular

    144
    Jul 18, 2012
    Not sure is this helps. But when I had a GX1 I shot RAW+JPG and there was a time I saw a stuck pixel in the RAW but not in the JPG. I don't use LR, I use PS when I edit. I ran the pixel refresh feature (which I'm assuming is pixel mapping) and the next time I took a shot and looked in PS there were no stuck pixels in either the JPG or RAW. I do not know if the info gets baked into the RAW or if the editor takes the info and does the adjustment itself.
     
  15. T N Args

    T N Args Agent Photocateur

    Dec 3, 2013
    Adelaide, Australia
    call me Arg
    Maybe try SilkyPix and see what happens before deciding if camera is at fault? At least you can say you tried the dedicated software....


    P.S. thanks for the interesting diversion on RW2 files. Is there a connection to the OP about dead pixels? (serious question)
     
  16. kwalsh

    kwalsh Mu-43 Top Veteran

    775
    Mar 3, 2012
    Baltimore, MD
    No, it only came up I think because in some threads referred to on DPR that described how dead pixels might be encoded in RW2 files there was also discussion of the compression used in RW2 files in the same DPR threads. And then that topic wandered back to this thread.
     
    • Like Like x 1
  17. SC489

    SC489 Mu-43 Rookie

    19
    Aug 2, 2014
    There are no dead pixels visible when using Silkypix. I find SP unusable on my 2560x1440 monitor due to the very small font - so I don't use it or know how to control noise reduction. I don't know if SP turns on noise reduction by default (similar to Lightroom). I assume it does the dead pixel removal by default so the user will be unaware of the presence of dead pixels when using SP.

    I'm mainly using DXO Optics Pro 9 - the latest reply from DOP support is Optics Pro marks these dead pixels independently from what the camera has mapped out. . So it seems DOP will mark dead pixels even if they are flagged in the RAW file (nobody seems to know if they are flagged).
     
  18. m4/3boy

    m4/3boy Mu-43 Veteran

    306
    Jul 21, 2013
    I'no expert with Raw Digger, http://www.rawdigger.com/, I've only tried it very lightly, but according to those that are experienced, RD clearly demonstrates the data loss or potential data loss of the A7 RAW files.

    This article discusses the topic in more detail:

    http://www.rawdigger.com/howtouse/sony-craw-arw2-posterization-detection