Combined AMaZE and VNG4 demosaic

(Ingo Weyrich) #1

In branch amaze_vng4 I added a new demosaic method, which blends the output from AMaZE and from VNG4.
AMaZE is used on areas of high detail, while VNG4 is used on flat areas.

To demonstrate the effect, I used RL sharpening with the settings you can see in the screenshots.
Left is AMaZE, right is AMaZE+VNG4, sharpening settings for both are the same.

Here’s a 200% view of the background

No graduate saturation (example pic included)

Good thinking. To me, it looks softer zoomed out but much better zoomed in. Would like to see it applied on mediocre images.

(Ingo Weyrich) #3

Here’s another example using the raw file from

Left is AMaZE, right is AMaZE+VNG4. For the AMaZE+VNG4 I also set the new Sharpening contrast threshold to 25

Edit: Another screenshot from the same file

(Ingo Weyrich) #4


Do you think it makes sense to allow using AMaZE+VNG4 for the motion part of PS images?

(Cranberry Carborundum) #5

Looks AMaZE-ing! Does this mean I won’t need to fiddle with noise reduction and detail recovery all the time?

(Ingo Weyrich) #6

It does mean:
1.) for shots at low ISO you have more room for sharpening.
2.) for shots at medium ISO you have more room to use AMaZE+VNG4 for sharp regions, while being able to get smoother backgrounds
3.) for shots at high ISO I didn’t try

(Gimbal Lock) #7

So If the motion part is highly detailed it will use AMaZE and if it’s soft it will use VNG4, yes definitely sounds like a good idea to me.

I tested the AMaZE+VNG4 function on a couple of normal non PS pictures and that combined with the USM adjuster produced very nice results. Sharp details and very soft out of focus areas.

Thumbs up!

(Ingo Weyrich) #8

@Gimbal Done!

(Gimbal Lock) #9

Will try it as soon as I get back home, which will take a couple of days though.

(Ingo Weyrich) #10

No need to hurry. I’m working on a speedup for vng4 meanwhile. It’s quite slow…

(Guillaume Castagnino) #11

You do not have the same for XTrans sensors ? :wink: This would be magical, as it’s currently the poor man of demosaicers algorithms.
(Yes I’m interested in it, I only have XTrans caremas now, X100S, X-E3, X20)

(Ingo Weyrich) #12

Not atm, but it would be possible to do use 3-pass xtrans for detailed and fast xtrans for flat regions.
I may try that later

(Ingo Weyrich) #13

@guilc @sguyader

Here are some screenshots from my first tests to combine 3-pass xtrans demsaic and fast xtrans demosaic.
All have the same sharpening settings applied.

First shows 3-pass at left and fast at right. 3-pass has good details and background full of ugly artifacts, while fast has horrible details but a much nicer background.

Again left 3-pass, right is the combination of 3-pass and fast

For reference left the combination of 3-pass and fast with sharpening, right without sharpening

Raw conversion fujifilm files in Darktable or another convertor
(Guillaume Castagnino) #14

Wow that’s nice ! you are too fast :wink:

It nicely reduces hatch patterns in the flat areas !
I will give a try with some high iso files too, as soon as you publish it in a branch !

(Ingo Weyrich) #15

Screenshots from an X-Pro1 ISO 6400 file

I applied Noise Redcuction and Impulse Noise Reduction with default settings, but no sharpening

Left 3-pass, right fast

Left 3-pass, right combination of 3-pass and fast

(Ingo Weyrich) #16

@guilc I added the new method (I called it 4-pass) with the corresponding contrast threshold adjuster to amaze_vng4 branch.


Wow, that really improves the X-Trans rendering.

(Sebastien Guyader) #18

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

(Sebastien Guyader) #19

@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!

(Ingo Weyrich) #20

@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.