Implementing "Nikon Ring" correction on import

Nikon cameras implement a biased lossy compression algorithm that in some cases (e.g., on the D5300) cannot be turned off.

The issue is described in detail at Mark Shelley’s page here:
http://www.markshelley.co.uk/Astronomy/NikonConcentricRings/nikon_lossy_compression.html

Mark has created translation tables that correct the bias in the image, and implemented this as a windows program to convert adobe DNG files. He’s sent me his tables and I was able to write a linux program using libraw to output corrected tiffs.

This is still not an ideal processing solution as, e.g., a lot of extra data is created (tiffs are big) and, for example, the bayer header information is not usually part of the Tiff.

It seems like an idea solution would be to intregrate the ring-correction processing step in Siril. I would be happy to help with this; I guess the first question is what would the preferred method be? Where would the developers want the code for this to go? As an import routine, and a separate processing method, etc?

1 Like

Hello.

Sorry for the delay but I’m currently on vacation, far from my computer. So this is from a phone I write this message and I don’t like it. It will be short :).

First of all, thx for your message, it is really appreciated. We are really open to your suggestion and we encourage you to do it.

We wrote a small documentation to help people to contribute to Siril. Maybe it could help you?

https://siril-contrib-doc.readthedocs.io/en/latest/

Please let me know if you have other questions.

Cheers.

Thanks!

The most straightforward thing seems to be to include the code for the correction in the image_formats_libaries.c file, where raw files are imported, since the correction should be done on the integer values in the raw data at the time of import. So my basic plan would be to include code there which would include the correction IF the camera model matches one for which a correction table is needed, AND if a box is checked or a preference is set in the settings. How the choice is specified is a UI decision so I’m not sure what would be preferred.