Hi, I am trying to convert a folder full of SVGs to PNG of 256x256 canvas. A folder like this
As you can see, the SVG has many sizes in a single file. I only intend to use the bigger one. Attaching a sample SVG.
It would be great if I can skip exporting them one by one.
In Inkscape each icon size is framed by a rectangle object. These rectangles appear to be frames sizes 24x24 48x48 .. 256x256.
inkscape --actions="select-by-selector:[width='256'];select-list;" ebook-reader-app.svg
Then you can use the id returned with FitCanvasToSelection and export-filename export-area-page and export-do
FitCanvasToSelection
export-filename
export-area-page
export-do
https://www.w3schools.com/css/css_attribute_selectors.asp
or maybe just try to find a repository like this one :) https://github.com/snwh/suru-icon-theme/tree/master/Suru/256x256
Thanks @inklinea
We will have to do it for each icon, right? I am ok with simply exporting the page ( keeping it 256x256 ) with icon in it. Maybe I read the post wrong. Wondering how to " batch " convert this one.
Thanks for the repo link. :)
inkscape --batch-process --export-type=png --actions="select-by-selector:[width='256'];FitCanvasToSelection;export-do;" *
Thanks :)
You were right about the repo as well. :+1
Hi, I am trying to convert a folder full of SVGs to PNG of 256x256 canvas. A folder like this
As you can see, the SVG has many sizes in a single file. I only intend to use the bigger one. Attaching a sample SVG.
It would be great if I can skip exporting them one by one.
In Inkscape each icon size is framed by a rectangle object. These rectangles appear to be frames sizes 24x24 48x48 .. 256x256.
inkscape --actions="select-by-selector:[width='256'];select-list;" ebook-reader-app.svg
Then you can use the id returned with
FitCanvasToSelection
andexport-filename
export-area-page
andexport-do
https://www.w3schools.com/css/css_attribute_selectors.asp
or maybe just try to find a repository like this one :) https://github.com/snwh/suru-icon-theme/tree/master/Suru/256x256
Thanks @inklinea
inkscape --actions="select-by-selector:[width='256'];select-list;" ebook-reader-app.svg
We will have to do it for each icon, right? I am ok with simply exporting the page ( keeping it 256x256 ) with icon in it. Maybe I read the post wrong. Wondering how to " batch " convert this one.
Thanks for the repo link. :)
inkscape --batch-process --export-type=png --actions="select-by-selector:[width='256'];FitCanvasToSelection;export-do;" *
Thanks :)
You were right about the repo as well. :+1