Automatic Perspective Lines In GIMP


Update 21 September  2013:

New version (3.1) released available here: http://registry.gimp.org/node/28413

For a demo see http://youtu.be/ZmQGImMFoF4 (perspective component) and http://youtu.be/aiJnLR5VnxY (paint tools)

Additional functionality from version 3:
- adds “act on” drop down to allow you to initiate actions on images from button presses on the control panel
- set perspective 1/2/3 point – 1 point has vertical and horizontal lines for other two directions, etc
- adds “operate on” drop down. When one file is open, defaults to open file – work around to api not exposing active image
- adds “isolate layer” button – isolates selected layer within layer group (visible with others invisible)
- adds ability to draw an isometric grid in perspective (Alberti Grid in 1 point perspective),
grid is customisable by size, anchor points and dimensions of the grid
- adds button actions for cycle eraser/dynamics
- added select drawn part as separate function (in addition to cycle drawn/all)
- added some help text in tooltips

Additional functionality from version 2:
- control interface with some parameters
New Control Panel
- set number of perspective lines drawn
- cleaner ui (create perspective lines on first run)
- optional horizon line
- option to lock vp2 to height of vp1
- editable brush size presets and ability to choose which series of sizes to cycle through
- visual indicators of erase/dynamics states
- saves settings
- allows choice of brush for perspective lines
- adds drop down for brush size choice

[End update]

NOTE: These screen shots are from version 1.  The youtube videos linked above are more recent.

I have recently uploaded a small plug (called BGII) which, among other things draws perspective guide lines on a canvas.   When first run, the plug in creates  a path with three control nodes (open the paths dialog to see it).   On second (and subsequent runs) it draws the perspective lines based on the location of these control nodes.  If you get in to any problems, delete the path and start again.

BGII_1

In this picture a default perspective set up (middle of everything) is created.  The location of the vanishing points are control points in the path (see path in path dialog on right hand side)

BGII_2

Use the path/bezier tool to move these vanishing points to where you want them (in particular they can be outside the canvas – zoom out if you need to).  Then –

BGII_3

Run the script again to get these perspective lines (takes a few seconds on my machine). Each of these sets of guides is created in a separate layer.

BGII_4

The layers can be switched off independently.  Similarly you can set opacity separately for each set of guides.

Get it here.

Installation (Linux)

1. Download a copy of the plug in from http://registry.gimp.org/node/28413 At the moment (September 2013) the most recent version is at http://registry.gimp.org/files/bgii.py_1.txt, but check in the future if that’s still the most current version.

2. Save the plug in to ~/.gimp-2.8/plug-ins

3. change the name to bgii.py (you’ll have to ask the registry people why they add .txt to the file name)

4. set the “executable” flag for bgii.py

command line: chmod +x ~/.gimp-2.8/plug-ins/bgii.py

dolphin: Right click the file, select Properties, select Permissions tab, tick “Is executable”

5. restart GIMP

Installation (Windows, Mac)

1.  Sorry, can’t really help with this (if you know, please add a comment).  Try generic instructions here (first site I found using Google).

Running:

1. open a file, or create a new document

2. choose tools->BGII->Perspective Lines -> Update – this creates the path with the vanishing points

3. open the paths dialog (windows->dockable dialogs-> paths (among other ways)) and make sure the path named BGII Perspective is visible (it should be)

4. choose Paths Tool (keyboard shortcut B) (if you click polygonal in the tool options it is a little easier to move nodes)

5. click somewhere on the red path (should be two lines one across the middle from left to right, then from there to the mid point on the top of the canvas).  This should show the vanishing points (white circles) and make them available to move.

6. click and drag to move the vanishing points to where you want them.  Zoom out if you need more space.

7. choose tools->BGII->Perspective Lines -> Update  This draws the perspective lines.  If it doesn’t work first time, just click it again.  On my machine it takes maybe 4 or 5 seconds.

8. Open the Layers dialog (Ctrl-L or windows->dockable dialogs-> layers).   At the top, there will be a layer group called BGII Perspective.  It has three layers in it called BGII Vanishing Point 1 , 2 and 3 respectively.  Use opacity slider and visibility toggle to suit.

9.  For a different set of perspective lines – repeat 4-7.  This deletes the existing perspective layers and redraws them.

About these ads

10 Responses to “Automatic Perspective Lines In GIMP”


  1. 1 adam 19 August 2013 at 5:35 pm

    Can you explain how install and use step by step?
    Thx.

      • 3 adam 19 August 2013 at 6:38 pm

        Thx for very fast response!
        I made it succesfully on Windows 7:
        1. After download change extension to .py (sometimes have to uncheck Open folder>Organize>Folder options>View>Uncheck “hide extensions…”
        2.Put the file into: Program Files>Gimp 2>lib>gimp>2.0>plug-ins
        3.Start Gimp and follow steps above in article.
        Have fun :)

  2. 4 João Vitor T. M. 20 August 2013 at 2:54 am

    Thanks for that :D

    Here in ubuntu 12.04 (gimp 2.8.6) worked, but the first attempts an error message appeared, saying that the brush “1. Pixel” was not found, so I had myself to create it.

  3. 7 Anonymous 24 August 2013 at 7:10 am

    Works great here on Windows 8. Seems to only create the layers on the second run, then on the third draws the lines on those layers, at least that’s how it’s working for me. No gripes here though! Thanks very much for this!

  4. 9 Alex 9 January 2014 at 11:31 pm

    Brendan, this is a great plug-in. I am using a Mac. It is very easy to deploy the plug-in on Mac.
    1- Download and copy the plug in to /Applications/GIMP.app/Contents/Resources/lib/gimp/2.0/plug-ins
    2-Rename the file to bgii.py
    3-Chanhe permissions: chmod +x bgii.py
    4- Execute GIMP and you are redy to go


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Blog Stats

  • 136,600 hits

OSWALD Newsletter

If you would like to receive OSWALD, a weekly open source news digest please send an email to oswald (with the subject "subscribe") at opensourcelaw.biz

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: