Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamilburda/gimp-align-layers
GIMP script to align a layer against another layer
https://github.com/kamilburda/gimp-align-layers
gimp gimp-plugin gimp-plugins gimp-script python
Last synced: 12 days ago
JSON representation
GIMP script to align a layer against another layer
- Host: GitHub
- URL: https://github.com/kamilburda/gimp-align-layers
- Owner: kamilburda
- License: bsd-3-clause
- Created: 2023-08-06T15:08:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-07T19:42:11.000Z (about 2 months ago)
- Last Synced: 2024-12-07T20:24:59.982Z (about 2 months ago)
- Topics: gimp, gimp-plugin, gimp-plugins, gimp-script, python
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Align Layers
============This is a [GIMP](https://www.gimp.org/) script that aligns the specified layer(s) against the specified image or another layer.
Alignment is performed horizontally (none, left, center, right) and/or vertically (none, top, center, bottom).
X- and Y-offsets can be specified as pixels, as percentages of image width/height or as percentages of the second layer width/height.
This script introduces a procedure named `python-fu-align-layers`.
While aligning layers is already possible in GIMP, this script is intended to be used for automation purposes. Hence, there is no GUI associated with this procedure.Usage
-----Example of centering the first layer against the image, both horizontally and vertically:
```
image = Gimp.get_images()[0]
layer_to_align = image.get_layers()[0]procedure = Gimp.get_pdb().lookup_procedure('python-fu-align-layers')
config = procedure.create_config()
config.set_property('image', image)
config.set_core_object_array('drawables', [layer_to_align])
config.set_property('horizontal-align', 'center')
config.set_property('vertical-align', 'center')
procedure.run(config)
```The parameters are explained in the GIMP procedure browser. The procedure name is `python-fu-align-layers`.
Installation
------------GIMP 3.0.0-RC1 or later is required.
For Linux, make sure you have at least Python 3.7 installed.
1. In GIMP, locate the folder containing GIMP plug-ins - open GIMP and go to Edit → Preferences → Folders → Plug-Ins.
2. Copy the `align_layers` folder inside one of the folders identified in step 1.