Menu

#422 DNG files has swapped red and blue channels

1.0
closed
nobody
DNG (4)
2021-04-10
2018-04-02
Anonymous
No

For the Huawei P10 Lite at least, DNG files have swapped red and blue channels. Attaching an example image (cropped for size).

1 Attachments

Discussion

  • Mark

    Mark - 2018-04-02

    The DNG files are created by the camera driver, so this may be a problem with the device's implementation. Can you try RAW in other third party camera applications that support Camera2 and RAW?

    Snap Camera HDR (Trial): enable Settings/Other/"Use Camera2 API".
    A Better Camera: enable Settings/General settings/More/"Use Camera2 interface".

     
    • Anonymous

      Anonymous - 2018-05-03

      I'm the one who opened https://sourceforge.net/p/opencamera/tickets/431/

      Found this thread, tried with snap camera hdr trial and the resulting dng has red-blue swapped too.

      I guess there is nothing to do?

      I can anyway develop them (even if the phone is not mine) using rawtherapee, using channel mixer with red 0R 0G 100B (instead of 100R 0G 0B) and blue 100R 0G 0B (instead of 0R 0G 100B), even if wb and adjustments are a bit more tricky.

      Thank you!

       
      • Mark

        Mark - 2018-05-05

        Thanks for the info. I guess it's either a Huawei bug, or both Open Camera and Snap Camera HDR are doing the same incorrect thing! Not sure if Huawei have any contact/forums to report bugs... Meanwhile I'll update my info at http://opencamera.org.uk/devices.html .

         
        • Anonymous

          Anonymous - 2018-06-06

          exiftool -IFD0:CFAPattern2='0 1 1 2' filename "solves" the problem.

          Thanks to Morgan_Hardwood for providing a solution!

          https://discuss.pixls.us/t/rb-channel-switch-while-maintaining-raw-data/7824/6

           
  • Ulrich Windl

    Ulrich Windl - 2018-04-03

    The same picture caputured as JPEG.

     
  • Ulrich Windl

    Ulrich Windl - 2018-06-26

    Actually the "solution" using exiftool is a work-around at most, not a solution!
    I wonder whether OpenCamera considers SENSOR_INFO_COLOR_FILTER_ARRANGEMENT correctly. I'm no developer, but I was looking for that type of info that might be relevant for the problem...

     
    • Mark

      Mark - 2018-07-03

      Note that the DNG files are created by the camera driver - so Open Camera doesn't consider those flags at all. This may be the cause of the bug for Huawei's driver though.

       
  • Ulrich Windl

    Ulrich Windl - 2018-07-04

    OK, is there a chance to compare the filter arrangement reported with the filter arrangement in the DNG file, and preferrable try to fix things (i.e. postprocessing the DNG to make it correct). Also a warning could pop up that the DNG file produced by the camera seems incorrect. And may be publish a list of incorrect camera drivers in the App info (to make manufacturers and customers more aware of the problem)? Or maybe a separate DNGfix utility that can run on the phone?

     
    • Mark

      Mark - 2018-07-08

      I try to keep notes of device specific issues at http://opencamera.org.uk/devices.html , which I've updated to contain info about this issue. Having warnings in Open Camera itself has the risk that issues can sometimes vary between even different variants of a device, or come and go with things like OS updates. So I've stuck with just the generic warning for Camera2 API.

      A utility to fix it up sounds good, but I don't have any Huawei devices to properly test it with (or time to write it! :)

       
  • Mark

    Mark - 2018-07-08
    • status: open --> closed
     
  • Ulrich Windl

    Ulrich Windl - 2019-02-03

    Just an update: The Huawei P10 Lite got an update to Android 8.0, and with the January 2019 update (HUAWEI/WAS-LX1A/HWWAS-H:8.0.0/HUAWEIWAS-LX1A/386(C432):user/release-keys) the problem (CFA Pattern 2: 2 1 1 0) is still present. After fixing as described above, the CFA Pattern 2 is: 0 1 1 2

     
  • Ulrich Windl

    Ulrich Windl - 2019-02-03

    Thinking about it (CFA Pattern 2 is different in the DNG file before and after fixing it), it seems OpenCamera could actually fix this (instead of the user) also.

     
  • Ulrich Windl

    Ulrich Windl - 2021-04-10

    Assuming OpenCamera could fix bad channels before saving (maybe just change the CFA Pattern), I had this idea:
    If a user suspects that the channels are not correct, OpenCamera could auto-detect the channel by taking a shot of a gray target (using AWB): OpenCamera could identify the channels by their contribution to gray (red 30%, green 59%, and blue 11%).
    What do you think?

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.