it works by first, demosaicing the image twice. On one the green channel is interpolated horizontally, the other vertically. Then the G-R and G-B is interpolated. This gives two very different moire patterns for each image. Then I choose which part of each image has the least chroma variation using a multiscale approach. This outputs an image with the least moire, and most accurate colours, which is used to guide a final demosaic from the original bayer data.
I’m interpolating the colour differences by using the green channel to guide interpolation direction.
I’ve added minimum chroma demosaicing to my testing folder and hopefully it will propagate through the system
@David_Tschumperle I think I’ve synced it with the repository, do I need to do a Pull request?
@Iain, your filter has been updated it should appear right now after pushing the refresh button.
I don’t have a periodic generation of the update file anymore (since I’ve changed my PC), but this is something I could set up again
The LMMSE was done using RawTherapee and the other one was done by extracting the raw data using DCRAW and then processed using GMIC GIMP plugin. I couldn’t make a comparison to any other known demosaicing algorithms in GMIC, so I didn’t bother to be to precise.
The basic principle can be applied to lots demosaic methods. Here is an example of the two I’ve used in the version I provided. One gives more details and finer grain noise at the expense of zipper artefacts at colour boundaries, and the other has fewer zipper artefacts but blotchier noise.
You’ll also notice some moire in the guy’s shirt still visible. That can be reduced by using FFT instead of a multiscale comparison, in the algorithm, but it is much slower.
I have done some tests and this algorithm is not good at chroma edges. This is because it looks for the least chroma variation between two choices so it picks the image with soft chroma edges.
So I don’t see any way of improving the algorithm without detecting chroma edges and using a different algorithm for that.
Here’s a version that follows the same principles, but uses FFT instead of a pyramidal decomposition.
It’s conceptually a bit simpler. It takes the two version of the demosaiced image (as mentioned above) , breaks them into tiles and then chooses the lowest level in the FFT for each tile pair. On the plus side, there are no zipper effects and the noise rendering is not too bad, on the downside, the fine vertical and horizontal detail is missing. EG the stripes on the shirt are gone and the image is a little soft.