Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.76k stars 313 forks source link

X-Trans demosaicing artefacts #3176

Open stefan-i opened 8 years ago

stefan-i commented 8 years ago

Hi, I noticed some ugly artefacts when opening Fuji X100T Raw files in RT that I've never seen with Bayer images. Sample files (Raw, OOC JPG and RT JPG) can be found here: http://filebin.net/3bb1f1emdl

The fence below and to the right of the yellow castle looks really weird, also the trees to the right of the yellow castle look like they have sharpening artefacts (?) and false color. As I applied no sharpening in RT I can only guess that these problems are already introduced with demosaicing (I used the recommended X-Trans 3-pass demosaic). The "false color suppression" option in the demosaicing settings somewhat helps with the false color, but not with the oversharpened look.

The problems are not present at all in the OOC JPG, which looks a bit softer and smoother overall compared to RT.

Do you think there's a chance to fine-tune the X-trans demosaicing to avoid these issues or maybe provide a smoother alternative algorithm that can be used with problematic images?

Thanks!

Beep6581 commented 8 years ago

The weird pattern is a maze artifact: http://www.cambridgeincolour.com/tutorials/camera-sensors.htm http://www.picturecode.com/showcase/demosaicing.php

I'm not saying there is no room for improvement here, but the camera does seem to desaturate fine color detail in order to avoid it.

I uploaded a PP3 to your filebin, I also included a DCP from Adobe - be sure to point RT to it as the custom input profile after you load the PP3! All the DCP checkboxes should be enabled. http://i.imgur.com/SSs10lU.jpg

If you set the first level of Contrast by Detail Levels to 0 and the second to about +1.8, the appearance of sharpness if the image from RT will be quite similar to that of the camera JPEG.

stefan-i commented 8 years ago

Thanks for your helpful suggestions, it looks a lot better now. The combination of "false color suppression" and your CBDL settings reduces the artefacts nicely, but I didn't notice any improvment from the Adobe DCP compared to the DCamProf DCP I used. This is my first X-Trans camera, so maybe I'm a bit spoiled by the great quality of the Amaze algorithm for Beyer sensors, which usually does a better job than in-camera demosaicing, so it was a bit of a letdown to see the camera beat RT in this case :) Anyway, the quality with your settings is OK, although it would still be a nice feature to have X-trans demosaicing that is on par with Amaze, but maybe that is technically impossible?

iliasg commented 8 years ago

I believe there is room for RT's x-trans demosaic improvement .. and I have a crazy idea for this :) It would be interesting to see the result of Iridient developer (the best x-trans demosaicer rumors say ..) on this file. I can detect the false patterns (a bit dumped) in the jpeg. As I see it .. the problem starts as aliasing and then propagates as maze artifacts because the aliasing drives the demosaicer to wrong direction of interpolation. BTW .. this looks to be related with the strange differense in x-trans files where some models give more aliasing than others https://discuss.pixls.us/t/fujifilm-x-t10-vs-x-e2/857/10 http://www.dpreview.com/reviews/image-comparison/fullscreen?attr18=daylight&attr13_0=fujifilm_xt1&attr13_1=fujifilm_xpro1&attr13_2=fujifilm_xe2&attr13_3=fujifilm_x100t&attr15_0=raw&attr15_1=raw&attr15_2=raw&attr15_3=raw&attr16_0=200&attr16_1=200&attr16_2=200&attr16_3=200&attr171_2=off&normalization=full&widget=1&x=0.6075867270202486&y=0.6073379353354605

While (as Ingo says at the discussion) the difference could be from the different lenses used, it looks strange to me that this big difference can come from the lenses only. I am suspecting a systematic error of the sensor readout .. maybe the phase detect pixels have different layout and/or the intepolation/normalizing of these pixels is different/better with X-Tx models. It would be usefull if we could detect the pattern of PDAF pixels .. but the only way to do this is to take many (say > 100) flat fields and study per pixels statistics. i.e. because PDAF pixels are half shaded they recieve half the light so if they are just normalized by 2X multiplication of their raw value the stdev of the samples will be 1.4X larger. If fuji interpolates the value from the neighbourhood then the interpolated pixel will have smaller stdev .. in any way a pattern could get detectable and then a counteract can be designed.

sguyader commented 8 years ago

@iliasg you know I own an X-T1, and I'd be delighted to get a better demosaicing algorithm for X-trans. I you need many flat fields, I can make them, no problem. What settings would you recommend for taking the best flat fields?

iliasg commented 8 years ago

@sguyader Seb, I will try to first comunicate with Bill Claff and Jim kasson who have experience and ready to use tools for this kind of studies to come up with a correct type and number of samples .. maybe Bill has already studied x-trans with PDAF flat fields :)

Although now I see that Χ-pro1 has no PDAF pixels but still gives this aliased result .. so probably I was wrong suspecting these PDAF pixels :( We should instead search for an improvement in the code regarding gradient detection and interpolation direction ..

schuay commented 4 years ago

I ran into a bad case of this yesterday. Demosaicing using a neutral profile. The image source is a X-T20.

3-pass Markesteijn has very strong false color artifacts. They are reduced but still very present with 5 false color suppression steps. On the OOC JPG I don't see any false color artifacts at all.

100% zooms are OOC, 3-pass Markesteijn, 3-pass Markesteijn with 5 false color suppression steps.

3-pass+fast did not help.

Edit: Note also the ongoing discussion in https://discuss.pixls.us/t/x-trans-demosaic-markesteijn-3-artifacts/14427.

out-of-camera markesteijn-3-pass markesteijn-3-pass-5-false-color-suppression-steps