Combined AMaZE and VNG4 demosaic

Wow, that really improves the X-Trans rendering.

1 Like

@heckflosse Ingow it looks very promising. I’ll give it a try ASAP.

1 Like

@heckflosse Ingo, I tried your new branch on several of my X-T2 files. I find the 4-pass algorithm for X-Trans very useful for high-ISO images. It doesn’t seem to make much difference on clean images, but on noisy images, it renders the noise of smooth areas much more “film-like”, by getting rid of most of the crosshatch pattern that the 3-pass algorithm introduces.

Screenshot of a 100% crop, with USM sharpening (left 3-pass, right 4-pass):

Screenshot of 300% crop, with USM sharpening (lest 3-pass, right 4-pass):

Very nice addition, many X-Trans camera users will find that useful!

3 Likes

@sguyader Sébastien, thanks for testing. For clean low-ISO images the difference is visible when sharpening heavily. Also for high-ISO images: Did you try to raise the contrast threshold slider to e.g 50 ? In my tests for high-ISO xtrans files, 20 was not enough.

Ingo, I don’t like to sharpen too much, maybe because my eye sight is not perfect and blurs my world, I don’t like to see my images too sharp!

Ragarding the contrast threshold, indeed I tried to raise it, but depending on the scene, sometimes before 50 I start to see the bad behavior of the fast-pass on sharp edges.

Look at the antenna stems below (300% crop):

On side note: I tried to see what False color suppression does, but it doesn’t play well at all with the 4-pass algorithm. Maybe it should be disabled when 4-pass is selected.

@sguyader I agree about fast being not perfect. I will take a look whether I can steal the xtrans vng code from darktable. That may be better than simple ‘fast’ code in RT :wink:

@heckflosse I tried pushing USM sharpening on a clean 200 ISO file, and indeed the 4-pass algorithm allows for pushing it further (I tried 0.50 radius, 1000 amount). However, the advantage is there only when you don’t downsize the images too much (or if you crop significantly inside the image). If I resize to HD resolution, I don’t see much difference between 3-pass and 4-pass.

I just merged Amaze+VNG4 and xtrans 4-pass into dev

6 Likes

@heckflosse I’m getting this error trying to build on mac/clang-mp 3.9.

/Users/tune/repo-rt/rtengine/pixelshift.cc:326:129: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                              ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:328:136: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                     ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:338:133: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                    if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                                  ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:340:140: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                    } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                         ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:365:129: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                              ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:367:136: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                     ~~~~~~~~~~~~~~~~~~^

@HIRAM Fix pushed. Thanks for reporting.

@heckflosse Thanks for fixing! Just a bit further into the build comes a similar error:

/Users/tune/repo-rt/rtengine/procparams.cc:4714:144: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'rtengine::procparams::RAWParams::BayerSensor'
                        raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(raw.bayersensor.PSDemosaicMethod::LMMSE);
                                                                                                                             ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/procparams.cc:4716:144: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZE' is not a member of class
      'rtengine::procparams::RAWParams::BayerSensor'
                        raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(raw.bayersensor.PSDemosaicMethod::AMAZE);
                                                                                                                             ~~~~~~~~~~~~~~~~~~^

Fixed.

Compiles fine on Manjaro Linux.

1 Like

Sébastien, the new xtrans 4-pass needs documentation on rawpedia. As an xtrans user, could you provide some (or at least one) raw file(s) which show(s) the difference between 3-pass and 4-pass from a users perspective? That would be awesome!

Edit: I also have some xtrans raw files which (technically) could be used for rawpedia, but I don’t remember where I got them from, so I don’t like to use them.

Ingo, here are a few images. I release them under Creative Commons BY-NC-SA license.
DSCF1766.RAF (23.6 MB)
DSCF1399.RAF (22.0 MB)
DSCF1342.RAF (27.9 MB)

The effect is easier to see at higher than base ISO, because it is when noise starts to be visible that this algorithm shines. But I added a 200 ISO shot with plenty fine details, to see how far you can push sharpening.

1 Like

https://filebin.net/nesj62icf25f236r/RawTherapee_OSX_10.9_64_5.4-373-g039f68e54.zip?t=hqywo66q
ˆ-- :ok: on mac!

1 Like

@heckflosse In layman’s terms, how does the algorithm determine when to use AMaZE and VNG4?

@Carmelo_DrRaw Suitable for PhotoFlow? :wink:

Definitely, but first I need to finish the HDR stuff. VNG4 is not yet implemented in PhF, so this will take a little bit of time…

I have added the amaze_vng4 branch to the AppImages list, so that it will be updated daily whenever something new is pushed…

It’s already merged into dev. No need to build amaze_vng4 appimage