From 62f75eb159f93e75cb247487fdc0d9132264f88b Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 22 May 2017 12:58:40 +0100 Subject: [PATCH] (Hi-DPI) No longer upscale ImageCache I found a couple of problems working with upscaled image caches. Firstly in GIMP a 'size 4 square pencil' is not 4x4, which makes editing an upscaled image very fiddly. Secondly the wxIMAGE_QUALITY_NEAREST algorithm is not as dumb as I need it to be, and it is doing some blending when rescaling. This leads to loss of image quality in some cases. So when we do switch to Hi-DPI support, we need to be 'all in' and only be downscaling in Audacity, not upscaling too. --- src/Theme.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Theme.cpp b/src/Theme.cpp index 760e24db7..749840eaa 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -757,12 +757,14 @@ void ThemeBase::CreateImageCache( bool bBinarySave ) return; } #endif +#if 0 // Deliberate policy to use the fast/cheap blocky pixel-multiplication // algorithm, as this introduces no artifacts on repeated scale up/down. ImageCache.Rescale( - ImageCache.GetWidth() * 4, - ImageCache.GetHeight() *4, + ImageCache.GetWidth()*4, + ImageCache.GetHeight()*4, wxIMAGE_QUALITY_NEAREST ); +#endif if( !ImageCache.SaveFile( FileName, wxBITMAP_TYPE_PNG )) { wxMessageBox(