SVGs awful big?

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2021-10-05 16:01:09

I've got a 916px square file which has two simple vector shapes - a circle with a tick mark inside it. When I export it as SVG the file is 22k. That seems an awful large file for such a simple vector graphic? Am I missing something?

Also, is there a way on export to choose a different size in dimensions - eg. 50px square on export? If so, I can;'t see it.
User avatar

2021-10-05 16:29:31

Can´t recreate that size - mine is 722byte (=4KB as the smallest byte chunk on HD):
User avatar

2021-10-05 19:56:14

I think I found the reason for the discrepancy in the file size: it´s the Background Layer which will be added as a rasterized bitmap into the SVG container. When you exchange it with an vector rectangle of the same size+color it shrinks the file size dramatically.
Hope this helps.
User avatar

2021-10-06 08:24:55

Nice troubleshooting, EllenM! Just wanted to chime in on this question:
by colindun Also, is there a way on export to choose a different size in dimensions - eg. 50px square on export? If so, I can;'t see it.
Right now, you can only scale images by factors of 0,5x, 1x, 2x, and 3x for export. To scale an image to a specific size, you'd need to first resize it using the Image Size menu. We do have custom export sizes in mind for future improvements, though.
User avatar

2021-10-06 13:58:07

Ah. Thanks EllenM, I shall try that.

Thanks too, Aurelija ;0)
User avatar

2021-10-06 14:16:32

Hmmm. Interesting.

When I remove the background layer entirely the file size is still 5k on export, which still seems a bit large.

When I convert the tick from a stroke to pixels then back to curves (so I can have a shape rather than stroke), then change the document size to 30px the SVG output file size is down to 2.6k. Better, but still a bit large for such a simple piece of vector art. Just out of interest I tried it in Affinity Photo too, and the SVG output was 1k.

Image
User avatar

2021-10-07 09:14:28

You used the "Stroke: Inside" feature with isn´t part of the SVG specs. it will be rendered in different ways either with 144 nodes for the circle or a color filled shape. Totally different story when stroke is aligned to center:
Image
Simply import the SVG you exported from Pixelmator Pro back into to check. True for Affinity-Designer/Photo BTW - they convert into shapes.
And file size shouldn´t change with px size output (except it´s rasterized of course) - that doesn´t make sense for Scalable Vector Graphics and is part of its beauty.
User avatar

2021-10-07 11:25:42

Stroke inside - Ok, ta. That's handy to know ;)