This Plugin works in combination with the GIMP Grid Generator Plugin
Version: 1.0.0
Website: Check our website
This plugin helps you detect and export cells from an existing grid layer in a GIMP project. It scans your image for grid lines, identifies the cells formed, and exports the contents of each non-empty cell. Unlike simply slicing an image, this plugin intelligently looks for the top contributing layer of each cell and names the output files accordingly. It’s perfect for extracting assets from a templated grid, sprite sheets, or other structured images.
- Automatically detect horizontal and vertical grid lines from a specified grid layer.
- Identify non-empty cells and export them as individual PNG files.
- Determine the topmost contributing layer for each cell and name the file after that layer.
- Works with grayscale and RGBA images.
- Allows selective ignoring of background and grid layers during export.
-
Find your Plug-in folder by checking
Preferences > Folders > Plug-ins
:- On macOS:
~/Library/Application Support/GIMP/2.10/plug-ins
- On Linux:
~/.config/GIMP/2.10/plug-ins
- On Windows:
%AppData%\GIMP\2.10\plug-ins
- On macOS:
-
Save the plugin script
grid_export.py
into your GIMP plug-ins directory -
Make the script executable by running:
cd <Your Plug-in directory> chmod +x grid_export.py
-
Restart GIMP.
-
The plugin will appear under:
Toolbox > Filters > Custom > Grid Exporter
.
-
Prepare an image with a detected grid layer (e.g., a layer named "Grid") and optionally a background layer (e.g., named "Background").
-
Navigate to
Toolbox > Filters > Custom > Grid Exporter
. -
Configure the plugin parameters:
- Save Directory: Specify the folder where exported cells will be saved.
- Grid Layer Name: Enter the name of the layer containing the grid lines (default "Grid").
- Background Layer Name: Enter the name of the background layer if present (default "Background").
-
Click "OK" to run the plugin.
The plugin will:- Detect grid cells.
- Identify non-empty cells.
- Determine the top layer contributing pixels to that cell.
- Export each non-empty cell as a PNG file, named after the top contributing layer.
Note:
If multiple cells come from the same top contributing layer, files will be uniquely suffixed to avoid overwriting.
-
Basic Export:
- Save Directory:
/path/to/export
- Grid Layer Name:
Grid
- Background Layer Name:
Background
This setup will scan your grid, ignore the background and grid layers, and export all non-empty cells.
- Save Directory:
-
Plugin Doesn’t Appear in the Menu:
- Ensure the script is in your GIMP plug-ins directory.
- Verify that the file has execution permissions.
- Restart GIMP after installation.
-
Grid Detection Failed:
- Make sure the grid layer is correctly named and consists of visible, solid grid lines.
- Check that the grid lines are not too faint (adjust intensity_threshold within the code if needed).
-
No Suitable Cells Found:
- Confirm that your grid layer forms clear, distinct cells.
- Ensure that layers above the grid have visible pixels in their cells.
Feel free to contribute by suggesting new features, reporting issues, or submitting pull requests on GitHub.
This project is licensed under the MIT License. See the LICENSE file for more details.
You can include additional examples, tips, or frequently asked questions in this README as the project evolves.