Export to 256x256 png images

Post questions on how to use or achieve an effect in Inkscape.
Rtyuio
Posts: 6
Joined: Tue Oct 13, 2015 10:44 pm

Export to 256x256 png images

Postby Rtyuio » Tue Oct 13, 2015 10:51 pm

I would like to export an Inkscape svg file to 256x256 pixels png images. I know this is possible via File->Export Bitmap but if you have a very large svg file it would take very long time to export to one png at a time. So I wonder is it possible to do this automatically?

User avatar
bartovan
Posts: 191
Joined: Sun Feb 09, 2014 4:14 am
Location: Belgium
Contact:

Re: Export to 256x256 png images

Postby bartovan » Wed Oct 14, 2015 12:17 am

Maybe Extension > Export > Guillotine is of use? From the (minimalist) explanation on inkscape-guillotine's webpage: "This extension is a copy of the GIMP function of the same name. It lets you drag horizontal and vertical guides onto the drawing, then the resulting rectangles are exported as PNGs."

Theoretically you could use Extension > Render > Guides Creator to make your guides grid. It doesn't allow for input of the distance between guides, only the number of rows and columns. But you could set the page width and height to multiples of 256. Eg. 2560x2560, then create guides in 10x10 rows/columns.
However, there's a small bug in the Guillotine extension, so it doesn't take into account guides created by the Guides Creator. Should be solved in one of the next updates, or by downloading the patch from the bugtracker.
Portfolio bartovan.com
Tumblr / Instagram / Pinterest / Facebook / Twitter / OpenClipArt
Shop at Society6 / RedBubble
Using latest stable Inkscape on Ubuntu (current stable release) and Win 7.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Export to 256x256 png images

Postby Moini » Wed Oct 14, 2015 1:02 am

There's also another extension that creates guides (with numeric input): https://github.com/sambody/inkscape-guide-tools (very, very useful!!!)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Export to 256x256 png images

Postby brynn » Thu Oct 15, 2015 5:22 am

Or use the Batch export option, in Export PNG Image dialog.

User avatar
bartovan
Posts: 191
Joined: Sun Feb 09, 2014 4:14 am
Location: Belgium
Contact:

Re: Export to 256x256 png images

Postby bartovan » Thu Oct 15, 2015 5:06 pm

brynn wrote:Or use the Batch export option, in Export PNG Image dialog.

Oh, that's a very interesting option I never really looked into! Great!

Just tested it. This works:
- make a new layer (eg. named "grid") on top of the drawing
- put a rectangle on it, dimensions 256 x 256
- Edit > Clone > Create tiled clones. P1 translation of eg. 5 x 5. This makes a grid of 25 clones.
- select a clone, press Shift+D to look up the original rectangle, and delete it or move it (otherwise you'll have the original and the first clone on top of each other)
- select all rectangles (by selecting the "grid" layer and pressing Ctrl+A) and set fill and stroke to none (you can always select the rectangles with Ctrl+A, even without seeing them, as long as they're on their own layer). Alternatively, select all clones, leave the stroke at eg. 1 px black, then make the layer invisible (with clones still selected). The idea of this step is to avoid exporting the grid itself.
- with all rectangles still selected, do File > Export PNG image. Tick "Batch export 25 selected objects" and click on "Export"
- and voila. The exports are saved in the folder which contains the SVG file.

With thanks to brynn of course :) Learned something new :) And please correct me where necessary.
Portfolio bartovan.com
Tumblr / Instagram / Pinterest / Facebook / Twitter / OpenClipArt
Shop at Society6 / RedBubble
Using latest stable Inkscape on Ubuntu (current stable release) and Win 7.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Export to 256x256 png images

Postby brynn » Fri Oct 16, 2015 7:29 am

Well, I don't think your answer was necessarily wrong. Often in Inkscape we find a few different ways to do something. And the op can figure out which one works best for his or her case :D


Return to “Help with using Inkscape”