How do I mass-convert png images to GIMP brushes?

je flag

I've been trying to make some battlemaps for my DnD game in GIMP, I downloaded a whole bunch of assets and textures in png format. To be able to easily use them, I'd like to mass-convert the PNGs into gimp brushes and textures (.GBR, .PAT).

I tried to use ImageMagick commands for conversion, but gimp always spits out an error when trying to load a gbr file from imagemagick ("Fatal parse error in brush file: 13x1229472850 over max size") and I couldn't find a way to fix it. Gimp also has a set of commands, but it seems extremely complicated and I couldn't figure out how to use it at all.

Any ideas?

om flag

PNG files can be used directly as patterns. Just copy them to the patterns directory in your Gimp profile (or add the directory where they are to the list in Preferences > Folders > Patterns. You only lose the ability to pick a name different from the file.

For brushes its a bit more complicated...

You can copy the image to the clipboard and then set the active Brush to Clipboard image or Clipboard Mask, but this is OK only for an occasional use.

If you Gimp has Python support(*) you can do a mass conversion like this:

  1. install the ofn-export-layers script. Installation instructions at the bottom of the page. The ZIP contains an HTML doc.
  2. Load all the files you want to convert as layer of a single image. File > Open as layers will let you select multiple files, so this isn't as long as it looks.
  3. Possibly do some tinkering... Brushes are either RGB brushes (colored pixels on transparent background) that keep their color or grayscale (black on white background) that assume the foreground color, so depending on type you may want to remove the alpha channels and convert the image to grayscale.
  4. Use File > Export all layers and specify a name pattern such as {name.gbr}

(*) This is a bit complicated these days, because Gimp is still using Python 2.7 which is deprecated, so some distros such as Ubuntu (since 20.04) ave removed the support. It can reinstated, the easiest way being to use the flatpak version available on the Gimp site.

I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.