SUMMARY Reference images imported to the canvas are rendered at lower than native resolution on high resolution displays. (In this case, 4k) STEPS TO REPRODUCE 1. Import a reference image 2. Compare its rendered resolution to native OBSERVED RESULT The reference image seems to be rendered at around half native resolution. EXPECTED RESULT The reference image renders at native resolution. Krita Version: 4.3.0-prealpha (git 5533582) Qt Version (compiled): 5.12.4 Version (loaded): 5.12.4 OS Information Build ABI: x86_64-little_endian-llp64 Build CPU: x86_64 CPU: x86_64 Kernel Type: winnt Kernel Version: 10.0.16299 Pretty Productname: Windows 10 (10.0) Product Type: windows Product Version: 10 ADDITIONAL INFORMATION This may be expected behavior to raise performance, I'm not sure.
Hi Aaron, I'm not sure I can actually see this, but it's probably caused by the way the canvas handles hidpi internally. I'm not sure what we can do about it.
Created attachment 132446 [details] File showing the difference I can see it clearly with a 100x100 file attached.
Created attachment 132447 [details] Screenshot showing the difference on 4k display (ref image on the right)
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/545
Git commit 5c6a7229bc61aa075416540b4d0da1a4e51dc293 by Agata Cacko. Committed on 26/10/2020 at 18:13. Pushed by tymond into branch 'master'. Fix seexpr icon to be high res on high dpi displays Before this commit, the icon of the seexpr script would be drawn in a low resolution (a result of UI scaling). After this commit the icon is drawn in a highest possible resolution. M +4 -1 plugins/generators/seexpr/kis_wdg_seexpr.cpp https://invent.kde.org/graphics/krita/commit/5c6a7229bc61aa075416540b4d0da1a4e51dc293
Git commit fb247f6a6d87a3faf90f75a00a91d4be1335978c by Boudewijn Rempt, on behalf of Agata Cacko. Committed on 28/10/2020 at 09:24. Pushed by rempt into branch 'master'. Remove the workaround border from the ref images Before this commit, Reference Images would use the same workaround as the brush tips since they all use KisQImagePyramid. However it is not needed for Reference Images and creates an empty margin around the images. This commit adds a new method to KisQImagePyramid to get the image without the workaround border. (The workaround is just 1 pixel of transparency around the whole edge that KisQImagePyramid is returning as the closest mipmap image). M +9 -0 libs/brush/kis_qimage_pyramid.cpp M +2 -0 libs/brush/kis_qimage_pyramid.h M +1 -1 libs/ui/KisReferenceImage.cpp https://invent.kde.org/graphics/krita/commit/fb247f6a6d87a3faf90f75a00a91d4be1335978c
Git commit 1d8b94e3c545b5d2ac98242dd14c6c0becb17071 by Boudewijn Rempt, on behalf of Agata Cacko. Committed on 28/10/2020 at 09:24. Pushed by rempt into branch 'master'. Draw reference images in high res on 4k display Before this commit, reference images would be stored in a buffer which size was not determined by the actual size of the area in pixels which was available for the QPainter, but that size scaled down by devicePixelRatioF(). Hence on high resolution displays all reference images would look blurry and low-res. This commit fixes this behaviour by introducing high-res buffer and making sure that it takes the reference image from the mipmap which size is the closest to the actual new size instead of the one that is scaled down because of the UI scaling (devicePixelRatioF()). I also changed the way the pixel art images (or any images that are being enlarged) are drawn: now they use FastTransformation instead of SmoothTransformation. M +6 -2 libs/brush/kis_qimage_pyramid.cpp M +1 -1 libs/brush/kis_qimage_pyramid.h M +14 -3 libs/ui/KisReferenceImage.cpp M +9 -3 libs/ui/KisReferenceImagesDecoration.cpp https://invent.kde.org/graphics/krita/commit/1d8b94e3c545b5d2ac98242dd14c6c0becb17071
Git commit d61854206d985ecfa6530537fdb1f010e0b22bb0 by Boudewijn Rempt, on behalf of Agata Cacko. Committed on 04/11/2020 at 08:23. Pushed by rempt into branch 'krita/4.3'. Draw reference images in high res on 4k display Before this commit, reference images would be stored in a buffer which size was not determined by the actual size of the area in pixels which was available for the QPainter, but that size scaled down by devicePixelRatioF(). Hence on high resolution displays all reference images would look blurry and low-res. This commit fixes this behaviour by introducing high-res buffer and making sure that it takes the reference image from the mipmap which size is the closest to the actual new size instead of the one that is scaled down because of the UI scaling (devicePixelRatioF()). I also changed the way the pixel art images (or any images that are being enlarged) are drawn: now they use FastTransformation instead of SmoothTransformation. (cherry picked from commit 1d8b94e3c545b5d2ac98242dd14c6c0becb17071) M +6 -2 libs/brush/kis_qimage_pyramid.cpp M +1 -1 libs/brush/kis_qimage_pyramid.h M +14 -3 libs/ui/KisReferenceImage.cpp M +9 -3 libs/ui/KisReferenceImagesDecoration.cpp https://invent.kde.org/graphics/krita/commit/d61854206d985ecfa6530537fdb1f010e0b22bb0
Git commit d4556045bed9c340a73a9a7d8b8c254e353a3584 by Boudewijn Rempt, on behalf of Agata Cacko. Committed on 04/11/2020 at 08:23. Pushed by rempt into branch 'krita/4.3'. Remove the workaround border from the ref images Before this commit, Reference Images would use the same workaround as the brush tips since they all use KisQImagePyramid. However it is not needed for Reference Images and creates an empty margin around the images. This commit adds a new method to KisQImagePyramid to get the image without the workaround border. (The workaround is just 1 pixel of transparency around the whole edge that KisQImagePyramid is returning as the closest mipmap image). (cherry picked from commit fb247f6a6d87a3faf90f75a00a91d4be1335978c) M +9 -0 libs/brush/kis_qimage_pyramid.cpp M +2 -0 libs/brush/kis_qimage_pyramid.h M +1 -1 libs/ui/KisReferenceImage.cpp https://invent.kde.org/graphics/krita/commit/d4556045bed9c340a73a9a7d8b8c254e353a3584