OpenPHDGuiding / phd2

PHD2 Guiding
https://openphdguiding.org
BSD 3-Clause "New" or "Revised" License
244 stars 111 forks source link

Enhance contrast for very low contrast images. #1162

Open Eyeke2 opened 5 months ago

Eyeke2 commented 5 months ago

This adjustment prevents the frames from being displayed as all-white, which is a visually unpleasant artifact commonly encountered in very dark frames without visible stars. By slightly increasing the maximum value when the difference between min and max values is minimal, we improve the visibility of image details while avoiding the all-white display issue.

agalasso commented 5 months ago

This seems promising, thanks for the PR. Could you suggest some way to demonstrate the effect of the change so we can see the effect? For example, you could attach a camera image (file > save image), then reviewers could build the branch and test with the camera image to see the improvement.

Eyeke2 commented 5 months ago

This seems promising, thanks for the PR. Could you suggest some way to demonstrate the effect of the change so we can see the effect? For example, you could attach a camera image (file > save image), then reviewers could build the branch and test with the camera image to see the improvement.

Unfortunately, my QHYIII290 camera which I used in testing, where this "white screen" happened is now broken. I will try to create a simulated camera image which will show the effect and attach the file (it will require ASCOM camera simulator which is able to load an image file).

Eyeke2 commented 5 months ago

Actually, I'm not sure if this is sufficient for fixing the white-screen issue for good. It's still possible to generate a dark image with very small difference between min and max pixel values to cause PHD2 to show all-white screen (or nearly all-white), even when screen gamma is set to the rightmost position. If you have other idea how to fix it, I'd like to know. I have addressed it for my specific camera, and haven't thought about more general solution.