Created
May 21, 2011 15:07
-
-
Save ixth/984589 to your computer and use it in GitHub Desktop.
GIMP plugin: Add guides according to 960px 12 column grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from gimpfu import * | |
GRID_COLUMNS = 12 | |
GRID_COLUMN_WIDTH = 80 | |
GRID_WIDTH = GRID_COLUMNS * GRID_COLUMN_WIDTH | |
def python_grid(image, draw, guide_1, guide_2): | |
image.undo_group_start(); | |
offset_left = (image.width - GRID_WIDTH) / 2 | |
for i in range (GRID_COLUMNS): | |
base = offset_left + i * GRID_COLUMN_WIDTH | |
image.add_vguide(base) | |
image.add_vguide(base + guide_1) | |
image.add_vguide(base + guide_2) | |
image.add_vguide(base + GRID_COLUMN_WIDTH); | |
image.undo_group_end(); | |
pass | |
register( | |
"python_fu_grid", | |
"Add 960 grid", | |
"Add guides according to 960px 12 column grid", | |
"Mihail Menshikov", "Mihail Menshikov", "2011", | |
"<Image>/Image/Guides/Add 960 grid...", | |
None, | |
[ | |
(PF_SLIDER, "guide_1", "Guide 1", 10, (0, GRID_COLUMN_WIDTH, 1)), | |
(PF_SLIDER, "guide_2", "Guide 2", 70, (0, GRID_COLUMN_WIDTH, 1)) | |
], | |
[], | |
python_grid) | |
main() |
artkolev
commented
Jul 31, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment