Is there any way to export only the vector shape without empty space around it?
I tried to create new file with the same height and width as the shape and copy/paste it, but after export i have blank svg file. Its because vector shape is saving with the same positions parameters as it has in original file.
I don’t know of any way to do this because the .svg code specifies the position of the shape as part of the entire image.
There is a way around it and that is to edit the .svg code in an exported .svg file to remove any transform statements.
I hope this helps.
I was able to create it in a short amount of time because I had the basic scripts and information about Krita’s SVG processing that I had created and researched over the past few months.
This resets the matrix translate component and translate parameter of the transform attribute of the exported SVG data, and sets the viewport centered on shape.
Only Text shape could not get transform atrtibute with toSVG(), so I workaround got it from matrix.