Dual Demosaicing Slider --- Which Side is Which

Well the second follows from the first :-).

OK so 100 on DD means ā€œalmost no AMAZEā€ not ā€œno Amazeā€. I guess my next question then is about the CS slider where presumably 100 means ā€œalmost no sharpening but still a little bitā€ and 200 means ā€œeven less than almost no sharpening but still just the teensiest bitā€. (I am sorry this sounds facetious and I donā€™t mean it to be). The logic being that if you have selected 100 on DD there might be some of the AMAZE areas that you would wish to exclude from sharpening, which you could not do if the sliders had the same maximum.

Is there somewhere I could download the version with the DD mask? I would love to try it and if possible show to myself that I was wrong. (I am not being facetious here either, if I can remove a step from my workflow it would be nice.) If you also have an ideal test raw that would better show the differences in the demosaicing that would be helpful otherwise I can just use one of my own.

Indeed, it is hard to think of it operating any other way. DD needs an initial demosaic to work out where the contrasty areas are. It therefore has to start with (say) AMAZE. Unless you do some form of iterative generation whereby having done the first pass it selects a value for where to use VNG redoes its working to generate a new set of contrast levels, etc then you have to do that.

CS on the other hand needs to work on the actual demosaiced image.

When I generated my TIFFs for comparison I used Amaze only demosaicing and turned on capture sharpening to look at the mask to get the values to use for the DD slider. I then switched to AMAZE+VNG with my chosen value and turned off capture sharpening to make sure that that did not hide/exagerate any differences.

About the transition (the sigmoid):

I will work on this tomorrow as showing the DD mask would be really useful. Technically itā€™s easy. Just need to make the right gui for itā€¦

3 Likes

ā€œI will work on this tomorrow as showing the DD mask would be really usefulā€

Just remember who asked for this first :rofl: :rofl: :rofl: :rofl:

1 Like

He might have been waiting to see whether any one else wanted it too :slight_smile:
Now if someone can explain to my why Photoshop (and Affinity for that matter) want find any any differences when I use difference or subtraction blend modes on an image that I have demosiced once with AMAZE and once with VNG I would be happy. The difference is visible to the eye but not, it seems to the program.

Exactly :wink:

I have been trying to use that to understand the difference in practical terms between a slider that goes from 0ā€“100 and a slider that goes from 0ā€“200 and failed miserably.

However, another point occurs to me with the DD mask. I have been assuming that the slider decides which pixels use the result of the AMAZE algorithm and which pixels use the result of the VNG algorithm. Although each pixel in each algorithm uses the values of its neighbours, the final value that the program uses is either 100% result of the AMAZE algorithm or 100% the result of the VNG algorithm even if all its neighbours happen to use the other algorithm. This is partly as a result of your comment that the values are not % blend values, but I would probably have thought that anyway. That being the case I would expect the DD mask to be just black and white with no shades of grey.

Obviously the same does not apply to CS and the CS mask because one would wish to very the amount of the capture sharpening and not just have it on or off.

Itā€™s so easy. Being able to use 200 instead of 100 just means you are able to set a larger threshold.

Wrong assumption. The contrast threshold is just a value to calculate the mask to blend between a and b. a and b maybe Amaze and VNG4 or sharpened and unsharpened. This a not a binary mask, as you can see from the sigmoid reference I made. On top of this, the mask is gaussian blurred with a sigma of 2.0 before it is applied, to get smoother transitions. And all I mentioned is equal for DD and CS

The values the visualization of the mask shows (the shades of gray) are % blend values. The contrast threshold is not

The blended result may be subtle. Try enhancing the contrast of or normalizing the layer. Another reason might be that the differences are rounded off or clipped when saving. In that case, the images would be the same or less different.

Oh, I seeā€¦itā€™s like that is itā€¦matey :rofl: :rofl: :rofl: :rofl: :rofl:



Same shot - AMaZE and VNG4, difference blend mode - exaggerated with a huge levels adjustment so itā€™s easily visible (note no clip mask)ā€¦

AMaZE is a lot less kind to areas of noise, low contrast and low frequency detail.
VNG 4 tends to be much kinder to the above areas but produces way more zipper and maze demoz artifacts.

So the two variants are hugely different, and itā€™s why I tend to favour RCD+VNG4 for demosaicing virtually all my 12,16 and 20Mp D3, D4 and 1DXMk2 high speed action wildlife - because they are normally shot in manual with auto ISO - see videos on my YT channel.

I only tend to use AMaZE on its own when the shot is tack sharp and in focus corner to corner - ie 100% high frequency detail.

Also note that CS doesnā€™t always play well with AMaZE.

1 Like

I shall try that. I do check in with your you tube channel, I considered myself fairly knowledgeable before but have learnt a lot.

[Later] Lovely jubbly. Just what was called for. Now I can look t things a bit better.

2 Likes

No probs Richard, glad it helped :+1: :+1:

1 Like

Yes but looking at
ā€œLetā€™s assume the contrast threshold adjuster is set to 20. This value will be divided by 100 => 0.2
result = blendfactor * sharpened + (1 - blendfactor) * unsharpenedā€
where blendfactor is derived from the sigmoid curve, I can see that if the slider is set at 20 on a 100 point scale then the blendfactor is 0Ā·50. However I cannot see why that means having the slider set at 20 on a 200 point scale the blendfactor is also 0Ā·50 surely instead of being 20Ć·100 we would have 20Ć·200 or 0Ā·10 which gives a blendfactor of 0Ā·0003. To me that implies a greater granularity (or sensitivity or finer control) when using a 200 point slider, not a wider range. If not, and we just divide by 100, what happens when the CS slider is set to 125 and we get 125Ć·100 or 1Ā·25. That either just truncates to 1Ā·0 or else is off the curve and gives no result at all. See below for my comments on your suggestion of extending the DD slider to 200.

[This paragraph might go better in the previous section, I am not sure] I then have a problem with the further calculation of generating the mask. I can see how the slider might just set a blend value for the entire picture, but not for how it is used to generate a greyscale mask.

As I understand things for any set slider value, pixels with a big difference from their neighbours will tend towards white (in the mask) while pixels with a small difference from their neighbours will tend towards black (in the mask), with the slider controlling how dark or light the pixel is. I donā€™t know what units the difference is measured in but letā€™s say that a difference of 1 is a very small difference (will always be black) and 100 is a very large difference (will be always be white). With the slider set at 10 a difference of 15 will be a dark grey and a difference of 85 will be a light grey. If I take the slider up to 70 a difference of 15 will become a mid grey and a difference of 85 will be a very very light grey. I guess what I am asking is whether the slider controls the shape of the sigmoid curve (possibly by moving the bottom of it up) or whether it is some modification of the blendvalue some other way.

I can see how the blending works for CS, but I am struggling a bit to see how it applies to DD. You have previously said that although 0 means all AMAZE and no VNG, 100 does not mean no AMAZE and all VNG. You said there will always be some AMAZE even though it might just be a small amount. In that context I could understand the CS slider going for a wider range since one might want to exclude from sharpening some parts of whatever areas are still demosaiced using AMAZE. In that context it would make sense for the CS slider to go from 0 to a higher figure than the DD slider does, but only if the increase figure gives a greater range. If all the higher figure does is give finer control then we are back to the question of scaling down.

I am sorry if I am not expressing myself well, I suppose if I understood better I could express myself better, but then If I understood better I wouldnā€™t have the question in the first place.

A sigmoid function converges to zero for small values and to 1 for large values, but will never really reach zero or 1. Let me make a different example: Will 1 / x ever reach zero? No, but it converges to it for increasing x.

Edit: for a contrast threshold value of zero there is a special case which just uses the left demosaicer (Amaze, RCD, DCB) for DD or just uses CS for the whole image to reduce processing time.

Thanks to @Andy_Astbury1ā€™s suggestion I have been able to look at actual results and come to some conclusions using AMAZE and VNG4.

(a) As @heckflosse says, 100 on the DD slider does not mean no AMAZE and all VNG. There is quite a bit of AMAZE. The amount matches the CS mask when the CS mask is set to 100. On the other hand, 0 on the DD slider does mean all AMAZE and no VNG. At these demosaicing settings the CS contrast mask is the same whatever demosaicing algorithm is chosen.

(b) Using values of 34 and 17 on the DD slider proved difficult to extract information from. Looking at the differences between the DD tiffs and the 100% AMAZE tiffs at 17 there was some similarity between the difference picture and the CS17 mask and no similarity with the CS34 mask. Using the DD34 tiff and the 100% AMAZE tiff the difference picture was too scattered to see. However comparing it with the all VNG tiff gave a mask picture similar to the CS34 mask and looking at the CS mask with the Demosaicing set to both of the algorithms it looked closer to the one generated by the VNG demosaicing method.

So after all this I am happy to agree that @heckflosseis correct that the two sliders do generate the sameish masks at the same values (apologies for doubting you). My difficulty is in knowing which demosaicing algorithm to set to match imaged CS mask with the internally generated mask used for the DD algorithm. I suspect the answer is AMAZE even though I got the better match with VNG. My reasoning is that as I used the VNG tiff for my comparison the better match is not surprising. However the program probably uses the first algorithm as its basis to avoid having to do iterative mask generation.

Well yes, but that does not explain how the slider values map to where we are on the sigmoid curve. How does 20 on a scale of 0ā€“100 compare with 20 on a scale of 0ā€“200? Does one just divide by 100 in both cases or does one divide by 100 in the first and 200 in the second?

Both divide by 100

Always the left deomsaicer (for bayer itā€™s Amaze, DCB or RCD; for Xtrans its Markesteijn)