4

I am using Inkscape and Gimp to create assets for a word game and am looking for an advice from more experienced users of these great tools.

In Inkscape I have created a stripe with 26 letters and their values:

Inkscape stripe

The stripe is comfortable to edit - I have enabled grid snapping there and also I can always revisit the SVG file and change font sizes or letter values.

Then I have exported the SVG file as a whole page to PNG files in different resolutions:

Inkscape bitmap

Unfortunately, loading a 6240 x 240 pixels PNG file does not work with Android (because of OpenGL width limitation for textures - 2048 pixels on many devices).

So I have to split the SVG file or the resulting PNG files in square images of 240 x 240 pixels for each letter (Android could process them without problems).

My question is if anyone knows a good way to perform such a split in Inkscape (that would be best) or in Gimp?

In Export Bitmap dialog of Inkscape I see a batch-related checkbox... Could it be used for my purposes?

7
  • opengl prefers square layouts so you can make a 2048 by 2048 picture you have no problem fitting it there and it should be easy and quick to do manually
    – joojaa
    Commented Nov 11, 2014 at 20:38
  • Unfortunately that does not work on my Android devices. Commented Nov 11, 2014 at 21:40
  • sure it does, the system is even saying so. Theres no reason for all that data be in one row.
    – joojaa
    Commented Nov 12, 2014 at 3:54
  • 2
    How is this problem different from this one and if so, what is your problem with the solution there (that you accepted)?
    – Wrzlprmft
    Commented Nov 12, 2014 at 7:45
  • First question was about creating a stripe of similar elements in Inkscape (I was hoping for a way to change positions and font sizes at once). The second question is about batch-exporting quadratic areas of Inkscape or Gimp document. Commented Nov 12, 2014 at 8:17

2 Answers 2

4

Yes, you can do it in Gimp, but in my opinion is simpler with ImageMagick (see also here).

You need to put a lot of guidelines where you need to cut:

guidelines

And then simply apply the Guillotine transform:

guillotine

After this, you have the original image split in a lot of imagettes:

a lot of images

And you have to save - pardon, export - each of them with a proper name.

Ok, maybe you can use a script for the guidelines and apply the slice plugin (which saves the pictures in a folder) to make it faster...

In Inkscape you can choose the area to export, and you can simply calculate the proper coordinates and save each image:

save area in Inkscape

See also here for Inkscape.

Trust me, I love Gimp and Inkscape, but a more proper tool for this kind of operation is Imagemagick ;-).

2
  • 2
    +1 thanks for the great answer. However I've tried exporting bitmap in Inkscape as a 240 x 240 area - it is nearly impossible (always resets and exports wrong area), at least on Mac. I will try Windows soon. Commented Nov 15, 2014 at 11:26
  • Ok, let us known if you did it! Commented Nov 15, 2014 at 12:56
2

I would use another tool, like "image magick", to "compile" your exported png into slices.

For example : http://www.imagemagick.org/Usage/crop/

1
  • 2
    Answer is correct, but imho you can improve it with an example of the usage of convert, e.g. convert.exe big_english.png -crop 240x240 letter_%d.png (which should work), and showing one of the obtained images. Commented Nov 12, 2014 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.