Pixelated .svg Custom Icons

Hello,

So I’ve been using custom icons in my addon for a while, but recently I’ve been adding some more. This has always been going on, but now I’m starting to notice it more.

I export my icons from Adobe Illustrator as 256x256 or as 512x512 or as 1024x1024 to .svg and/or to .png with alpha and no matter what the size is and no matter what the extension is, they always look shtty compared to the built-in icons. Even exact copies of the built-in vector icons exported to .svg look shtty.

It seems like there’s some special, internal C function I’m supposed to pass these things to to get them to render nicely with UI. Either that or there’s some secret, super precise thing I’m supposed to do that you either just know or don’t know.

Anyone have experience with this?

Screenshot 2024-08-14 at 5.48.53 PM

In this image, you see that the 3 built-in ones on the left are blurry, but not choppy. But icons 4, 5, 6, and 7 are choppy, then the built-in one on the right in place #8 is back to smooth. It seems like there’s some kind of smoothing algorithm being applied to the built-in ones that isn’t being applied to the custom ones. They aren’t necessarily super sharp, they’re a tad blurry, but they definitely aren’t choppy. So I don’t think it’s drawing the .svg directly, because it does look smoothened.

Maybe I should smoothen mine in Ai?

When I had to deal with low-res images in my addon I integrated the 3D Ninjas Blender Image Preview library. It’s no longer being maintained, but I tested the addon I used it in in 4.2 and it seems to still be working.

My issue was that only tiny thumbnails were being stored inside of Blender for ready access, and if I wanted to use a higher res image then I would have to have the images process by 3dn-bip.

I’m guessing that a similar problem is happening here: no matter how high-res your source images, they appear low-res once they’re in Blender.

It was a simple conversion, and now the images display as 2048 x 2048, instead of 128 x 128, or whatever the default Blender preview size is.

Now that I’m thinking about it, thank you for posting this. I haven’t dug into it yet, because it sounds scary and complicated, but I will eventually dig into this and see if I can get it to work. Thanks for your help.