This GIMP plug-in exports various attributes from the specified image into an XML, JSON or YAML file. Attributes include (among many others) image name, width, height, a list of layers, layer effects, channels, paths and their attributes (width, height, offsets, visibility, color tags, ...).
GIMP 3.0.0 or later is required.
- In GIMP, locate the folder containing GIMP plug-ins - open GIMP and go to Edit → Preferences → Folders → Plug-Ins. If you cannot locate any of the folders on your system, you can add a custom folder.
- Copy the
image-attribute-exportfolder inside one of the folders identified in step 1. The folder hierarchy should look like this:plug-ins/ ...other plug-in folders... image-attribute-export/ image-attribute-export.py procedure.py
For Windows, make sure you have GIMP installed with support for Python plug-ins.
Simply export an image like you normally would (File → Export...) and replace the file extension at the top of the export dialog with xml, json, or yaml. Alternatively, you may select one of these file extensions at the bottom of the export dialog.
To export the attributes programmatically (e.g. from the Python-Fu Console), the file export procedures are file-xml-export, file-json-export and file-yaml-export.
Only a select few entries are shown for brevity.
{
"image": {
"name": "loading_screen_template.xcf",
"width": 1024,
"height": 512,
...
"layers": [
{
...
"name": "Frames",
"visible": True,
"width": 688,
"height": 386,
"opacity": 100.0,
"offsets": [
168,
30
],
...
"children": [
{
...
"name": "top-frame",
...
},
{
...
"name": "bottom-frame",
...
}
]
},
{
...
"name": "main-background",
...
}
],
"channels": [],
"paths": []
}
}
This plug-in is licensed under the BSD 3-Clause license.