StarNet.py native outputs do not match StarNet CLI outputs

Since recombining images after StarNet.py processing sometimes caused a green cast or reduced star brightness, their consistency with the original files was verified.

Specifically, I compared the output of StarNet.py with that of the StarNet CLI executed within Siril.

According to the script description, StarNet.py should be able to generate either:

  • StarNet native outputs (-m, -n)
  • Siril-style outputs (descreen, subtract)

However, my measurements indicate that the “native” outputs do not match the StarNet CLI outputs.

Environment:

  • Siril 1.4.4
  • StarNet 2.5.3-0208
  • Comparison tool: ImageMagick
  1. Comparison with StarNet CLI

Starless:

PSNR(RGB) 76.4528
PSNR(Lab) 81.3424
SSIM 0.999992

Stars (StarNet star mask (-m) vs CLI -m):

PSNR(RGB) 29.8334
PSNR(Lab) 36.4971
SSIM 0.135762

The starless images are nearly identical, whereas the star images are substantially different.

  1. Comparison inside StarNet.py

StarNet star mask (-m) vs Siril subtraction

PSNR(RGB) 83.3707
PSNR(Lab) 88.4006
SSIM 0.999998

StarNet unscreen (-n) vs Siril descreen

PSNR(RGB) 50.0741
PSNR(Lab) 54.3419
SSIM 0.999857

The results with SSIM > 0.99999 are essentially ULP-level errors - likely the result of different float rounding from a different order of operations between the two code paths. The unscreen 0.9998… is a bigger difference and obviously the 0.135 result is qualitatively much worse.

However I have no idea how Starnet does its internal subtraction or descreening, it’s not open source. Also I can’t change how Starnet does its subtraction or descreening as I’m not the author.

You can view the script source to see how Siril’s StarNet.py script does its descreening and subtraction, which I believe to be correct.

If you agree that the script does it correctly then you would need to file a bug against Starnet to get the behaviour altered.