Page 1 of 1

"SMBX tileset compiler/separator" plugin for GIMP - Works on PNGs

Posted: Sat Mar 17, 2018 5:27 pm
by Sambo
I don't know if anyone here (besides me) uses GIMP. It seems like most people here use Paint.NET.

But, If anyone does use GIMP, a problem has just been solved for you. The "Tileset compiler/separator" that FrozenQuills made doesn't handle PNGs correctly, and he clearly has no intention of doing anything about it, so I wrote a plugin for GIMP that does the same thing.

Installation
There are two plugins included. The first is Combine Images, and the second is Split Images. It's pretty easy to guess what these do.
To install the plugins (if you have GIMP), unzip this folder and drop the two files into your plugins folder (This should be located under C:\Users\<your-user-name>\.gimp-2.8\plug-ins).

These plugins are written in Python. If you're not using at least version 2.8, I don't know if they'll be supported. If I remember right, 2.6 didn't have Python.
Image
If this option isn't here, the plugins won't work.

If you have GIMP open, you must restart it for these plugins to appear.

If you've installed the plugins correctly, they should appear here:
Image

Combine Images
Using this plugin is simple. Upon selecting it, you'll get a window that looks like this:
Image
From the dropdown menu, select "Other...", then select the folder that contains the PNG graphics you want to combine. Hit the "OK" button, and after a few moments, an image containing all of the graphics in the folder will appear. It stores data about the original images and where they are in the combined image. Go ahead and make any color adjustments you wish to the combine image, then run the Split Images plugin when you're done.

Notes:
This will create a file named "layer_data.json" in your graphics folder. DO NOT delete this file, or you will be unable to split the image up again. Delete it only after you've run Split Image.
DO NOT MOVE any of the graphics in the combined image, for reasons that should be obvious.
The combined image is not saved automatically. If you want to save it, you must do so manually.

Split Images
Run this after you're done recoloring your graphics. Upon selecting it, you'll get a window that looks like this:
Image
Follow the same steps for selecting a folder as you did for Split Images. Input directory is the folder where "layer_data.json," created by Split Images, is. Output directory is where the images created by the splitting process will go. Leave it blank to output in the same folder as the input directory. After you've selected the desired folder, hit "OK." After a few moments, the window will close, and you should be able to see the individual images in the output directory. If you're satisfied with the result, feel free to delete "layer_data.json."

FAQ
Q: Does this work with GIFs?
A: No. Use this if you like GIFs with masks for some reason.

Q: Can you make this for Paint.NET?
A: Probably, but did I? No. Sorry.

Q: What about MS Paint?
A: Please don't use MS Paint. It's awful.

Q: Why can't I get this to show up?
A: You probably didn't install it correctly. Please double check your installation, and make sure that your version of GIMP supports Python plugins.

Q: The plugins are crashing. What do I do?
A: Let me know what you did to cause a crash, as well as providing a screenshot of any error messages. I'll try to sort it out.