Skip to content

Commit

Permalink
Enhance contrast for very low contrast images. This adjustment prevents
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Leo Shatz <[email protected]>
  • Loading branch information
Eyeke2 committed Jan 26, 2024
1 parent 4030ca7 commit 18d5e03
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions guider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,15 @@ bool Guider::PaintHelper(wxAutoBufferedPaintDCBase& dc, wxMemoryDC& memDC)
{
int blevel = m_pCurrentImage->FiltMin;
int wlevel = m_pCurrentImage->FiltMax;

// Enhance contrast for very low contrast images. This adjustment prevents the frames
// from being displayed as all-white, which is a visually unpleasant artifact commonly
// encountered in dark frames. 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.
if (wlevel < 4096 && (wlevel - blevel) < 16)
wlevel += 16;

m_pCurrentImage->CopyToImage(&m_displayedImage, blevel, wlevel, pFrame->Stretch_gamma);
}

Expand Down

0 comments on commit 18d5e03

Please sign in to comment.