Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ((m_pCurrentImage->BitsPerPixel > 8) && (wlevel < 4096 && (wlevel - blevel) < 16))
wlevel += 16;

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

Expand Down