Skip to content

Commit

Permalink
Improve on-screen rendering of fine detail
Browse files Browse the repository at this point in the history
For some reason the Windows scaler wants (size + 1) rather than (size)
to yield good results with NearestNeighbor mode.  The improvement
for MacPaint images with fine detail is dramatic.

The PrintShop BARNS graphic in the test set looks significantly
better, though it still has a couple of thickened rows/columns,
e.g. right down the middle.

This only affects the file viewer display.  Exported images have
always looked correct.
  • Loading branch information
fadden committed Dec 22, 2023
1 parent abd3f3d commit 99c2291
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cp2_wpf/FileViewer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,11 @@ private class ConverterComboItem {
return;
}

previewImage.Width = Math.Floor(bsrc.PixelWidth * mult);
previewImage.Height = Math.Floor(bsrc.PixelHeight * mult);
// I'm not sure why "+1" is needed here, but it significantly improves the
// appearance of B&W images with fine detail, e.g. MacPaint graphics. This
// just affects the Windows on-screen scaling, not the export.
previewImage.Width = Math.Floor(bsrc.PixelWidth * mult) + 1;
previewImage.Height = Math.Floor(bsrc.PixelHeight * mult) + 1;
//Debug.WriteLine("Gfx zoom " + mult + " --> " +
// previewImage.Width + "x" + previewImage.Height);
}
Expand Down

0 comments on commit 99c2291

Please sign in to comment.