I need an extension to export layers seperately as png (also as svg if possible but png is enough). I tried some of the extensions but all of them are out dated as far as I can see. I use inkscape 1.0.1, is there such an extension for inkscape 1+?
Thanks for the answer, it save layers as svg. I need png files.I asked svg as a bonus actually, I need saving layers separately as svg time to time. But most of the time I need png.
I tried to fix the errors, since I don't know paython I couldn't manage to make it work. After fixing some of the bugs, saving as svg works in this extension but still png not working 😥
Hi mapacarta, You could try the Inkporter extension. Every layer needs to have an object ID, which is possible if you first convert each layer to a group through the objects menu. Then the objects have the 'layer' as an object ID. You can then export those as svg's or as png's.
After that you can convert the groups into layers again.
On linux this can be done fairly easily from the command line. However you cannot easily export the layer name ( Inkscape Label ) so the layers when saved as png or svg have the layer id as their name instead of the label.
Hi,
I need an extension to export layers seperately as png (also as svg if possible but png is enough). I tried some of the extensions but all of them are out dated as far as I can see. I use inkscape 1.0.1, is there such an extension for inkscape 1+?
Thanks
Try save as "Layers as separate SVGs (*tar)"
Thanks for the answer, it save layers as svg. I need png files.I asked svg as a bonus actually, I need saving layers separately as svg time to time. But most of the time I need png.
This extension seem pretty nice but it doesn't work with 1+: https://gitlab.com/su-v/inx-exportobjects/-/tree/master/
I tried to fix the errors, since I don't know paython I couldn't manage to make it work. After fixing some of the bugs, saving as svg works in this extension but still png not working 😥
About how many layers are you talking?
Usually around 20 layers, so far I export them separately one by one. It gets frustrating after awhile :D
I am trying a solution with javascript + node for my use case, that may do the trick for me if there isn't any extension.
Hi mapacarta,
You could try the Inkporter extension.
Every layer needs to have an object ID, which is possible if you first convert each layer to a group through the objects menu.
Then the objects have the 'layer' as an object ID. You can then export those as svg's or as png's.
After that you can convert the groups into layers again.
On linux this can be done fairly easily from the command line. However you cannot easily export the layer name ( Inkscape Label ) so the layers when saved as png or svg have the layer id as their name instead of the label.
This might work.
Save it as a bash script, chmod +x
Usage layer_export.sh svg_filename.svg
readarray array <<< cut -d ' ' -f 3 <<< $(inkscape --actions="select-all:layers;select-list;" $1)
echo $(cut -d ' ' -f 1 <<< ${array[1]})
for i in "${array[@]}"
do
echo $(cut -d ' ' -f 1 <<< $i)
object=$(cut -d ' ' -f 1 <<< $i)
$(inkscape --batch-process --actions="select-by-id:$object;select-invert:layers;object-set-attribute:display,none;export-id:$object;export-filename:$object.png;export-do" $1)
done
Thanks for the replies. I will probably go with the node js, after a few tries it works quite well for my use case.