Qml SVG Image producing aliased result
-
wrote on 24 Jan 2022, 21:52 last edited by
Good evening all,
I'm currently working on a personal project that includes buttons with images inside as shown in the clip out below. However, for some reason after moving to another pc to do work, the images started to have aliasing. The image format used is SVG so not sure why and I struggled to find any information regarding the matter. The application is written in QML.
First PC: Surface Book 2
Screen: 3000 x 2000 UI scaling at 200%Second PC: Custom Build
Screen: 3440 x 1440 UI scaling at 100%I'm using Qt6.2, does anyone have any ideas?
-
wrote on 24 Jan 2022, 22:39 last edited by
In Image set:
smooth: true antialiasing: true sourceSize: Qt.size(somex, somey) // set to large enough to get good sampling size, I don't know why this works, but its in my notes
-
wrote on 24 Jan 2022, 22:41 last edited by
@fcarney said in Qml SVG Image producing aliased result:
set to large enough to get good sampling size
I "think" this is the size it draws in memory. So the larger the size the more memory it would take. I just set this to the size of my Image.
-
wrote on 25 Jan 2022, 23:14 last edited by
@fcarney I appreciate the response but this didn't work for me. This however, led me to look further into the documentation. I was aware of smooth, anti-aliasing, and sourceSize which I all tried and didn't work.
Solution
The solution in the end was
mipmap: true
on the image, which results back to a smooth image. This is default to false, and I didn't realise that scaling the image down would produce a bad quality image but turns out, yes.
1/4