
SVG 2 PNG 4 KDE Script
Source (link to git-repo or to original if based on someone elses unmodified work):
I made a little script that can render .svg and .svgz files into png files in the sizes 16x16, 22x22, 32x32, 48x48, 64x64 and 128x128. These are the sizes kde uses for icons. The script uses sodopodi. If you have a lot of .svg and .svgz files, this script can render them automatically to PNGs (if sodipodi is able to open them). A read me is included.
The test suite will render the png icons, as the basic script. It will also
copy the 32 icons to 16x16-1, -2, -3 and 22-1, -2, -3 directories, sharpen
them at different levels, scale them, and sharpen them again at different
levels. For an overview take a look at the svg2png-view.html. The levels of sharpening can be set in the svf2png4kde-suite script. This way you can quickly check out whether your smallest icons can use sharpening.
More scripts at the website:
http://home.uwnet.nl/~vita/linux/index.html
version 1.1: now with viewerscript.
version 1.1.2:
made the preview script much more practical.
added a Test Suite.
version 1.3
- Make Crystal CVS. This script takes the crystal icons with the long filenames like crsc-mime-kate.svgz, removes the prefix and puts them in directories like a theme.
- Color Changer. This script changes the colors of svg files, working on the source text.
- Stroke Width Changer. Like the color changer, this script changes the width of the stroke.
- some bugs solved
- support for inkscape
version 1.4 run from any dir in path.
Ratings & Comments
10 Comments
Since various scripts are being discussed, I thought that I might mention that The GIMP 2.0 will import SVG icons and render them to pix maps.
I'd love to see the two scripts produce three or four icons from the same sources and have them posted somewhere so one can see the difference. Marco
I do not think that will be useful. Each icon set is different. The way Leinir made his script works probably best for his own work, mine works best for my work. Try it for yourself!
There is also another script for this. The svgtoicon script makes smoother icons, the icons the svg2png4kde script makes are sharper. It's a matter of taste. Or may be you like the big ones to be smooth, the smaller ones sharp. svgtoicons: http://www.kde-look.org/content/show.php?content=6913 svg2png4kde (this)
This really saved me allot of time on the Full PNG release of Wasp... Thanx!
I know programmers have a funny idea that we wish to re-invent the wheel, but still ;) That said, nicely done, there :) I would say, though, that the way you've done this script does not give you very nice quality icons. When you tell Sodipodi to render icons to a specific size, they come out at a rather low quality. If you in stead render the icon to a large size, say 960 by 960 (the largest size icon supported by Mac OS X, currently the largest icons on the market afaik), and then scale them down from there, the quality is much better. This is the technique I applied in my scripts, svg2icons.sh and makeiconfolder.sh (just posted the update, feel free to look'n'steal ;) ).
I didn't know your script existed. I will take a look at it.
"does not give you very nice quality icons" A bit to bold for my liking. The icons your script produces are more smooth, mine are sharper. It is a matter of taste.
Aah yes, this is true :) Sorry, I only tested the solution with a Crystal-like bunch of icons that I was working on before Reinhardt, and Reinhardt itself :) Thanks :) I'm currently working on a program that will do this (C++ with GUI), and I will be sure to include an option to choose between the two methods :)
...This is awesome. And really (really, really, really...) useful! Thanks!