Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I have a folder of SVG files containing artwork generated automatically via a script. Objects within that file sit outside of the canvas size. An example is below. It's a screenshot from Inkscape and so the black line just shows the size of the canvas.
I want to use imagemagick to convert the SVG to a png and grow the canvas size from the centre so that it renders artwork that sits outside the boundaries of the canvas set in the SVG file. For example, if I render from IM or Inkscape using the canvas size I get this.
I want IM to render this:
I've tried using -extent together with -gravity but I get this.
I have around 500 of these SVGs and so going in to each file and setting the bounding box manually would be very time consuming, hence why I'm looking for an automated way to do this. I don't mind if I can't modify the actual SVG in IM but if I can at least render the file with a different bounding box size then that would work.
I do not see any canvas offsets in the verbose information that would let you expand the canvas. So I am not sure that you can do that in Imagemagick. But I am not an SVG expert. Perhaps one of the other users might be able to help further.
IM tells the renderer, which might be Inkscape, to render the page. If parts of a drawing are outside the page, they won't be rendered. But Inkscape can be told to render the drawing, see https://inkscape.org/en/doc/inkscape-man.html "--export-area-drawing".
I expect delegates.xml can be edited to include this.
Strangely, inserting "--export-area-drawing" in delegates.xml doesn't change the output. Unless you have a burning desire to use IM, I would do the job directly with Inkscape:
Thanks for that, although I don't necessarily want to render the whole drawing, just a specific area different from the area already set within the SVG file.