piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

svgexport produces huge file size while converting from SVG to PNG #60

Closed markvital closed 4 years ago

markvital commented 6 years ago

I'm converting this icon from SVG to PNG in 128x128 resolution

I am using this command for conversion:

svgexport woman-test.svg woman-test.png :128

Here is what I've got: woman-test

The result file is much bigger then the one Illustrator produces (via 'save for web') 66 KB vs 983 bytes in Illustrator.

Here is the version saved in Illustrator woman in-ai

mingrammer commented 4 years ago

I got the same problem.

markvital commented 4 years ago

@mingrammer it looks like the repo is dead :(

mingrammer commented 4 years ago

Yes it does.. we should find an another one or make own tool ourselves.

MichaelRoosz commented 4 years ago

Maybe the new (puppeteer) version works better in this case.

shakiba commented 4 years ago

This is fixed in +0.4 thanks to great work by @MichaelHeerklotz!

markvital commented 4 years ago

@shakiba @MichaelHeerklotz Great, thank you!

I did some testing and now the file size is much closer to the Illustrator.

Here are the results with the same icon I posted before: Screen Shot 2020-04-09 at 5 21 49 PM

From left to right: SVG, Adobe Illustrator Export (via Save for Web), svgexport, svgexport optimized with ImageOptim

I think the results could be even better, if there is an option to set up 8-bit color profile for PNG export, (PNG-8).

shakiba commented 4 years ago

Awesome, thanks for sharing comparison, kudos to @MichaelHeerklotz for making the change!