BaudAlign Logo  |  About Me   |  My Music   |  PC Stuff   |  Surfing   |  Bands   |  Contact Details  |
Header Image for Print
spacer Parent Page
- PC Stuff

Sub Pages
-> GIMPing a LightSabre
-> GIMPSabreFu
GIMPing a LightSabre

Rotoscoping LightSabre blades using my GIMP Script-Fu.

(NB:  "Lightsaber" was a spelling mistake that has since been perpetuated throughout the Star Wars series - the original and proper spelling was "lightsabre"; "sabre" being the correct spelling for such a sword-type weapon.  I'm following the new convention of correcting improper Americanisation of spelling!)

Lightsabres are cool.  But how do they "make" them?  Easy - it's just a technique known as "rotoscoping"; adding graphics onto the film.  The actors wield sabres with coloured rods in place of blades, and the lightsabre graphics are added later.  In the original Star Wars movies, these graphics were done by physically drawing the lightsabre blades onto the film; nowadays, it's all done digitally, in much the same process, but the drawing is done digitally on digital film.

After much messing around, I've come up with a GIMP Script-Fu (a process coding for the GIMP) which can rotoscope lightsabre blades similar to the ones seen in the films (NB: There are a lot of variations on how the lightsabre blades look in the films.  I've basically tried to make the results like the latest publicity shots, but this Script-Fu should be flexible enough to cover most looks).
All you need is The GIMP (see below), my Script-Fu (see below), and a digital image to work on (there are a few on the web, or make your own - a few are supplied below).

OK, with the blade-roto.scm script safely tucked away in your GIMP scripts directory (on my setup, this is located at C:\GIMP\share\gimp\1.2\scripts), fire up the GIMP and open up your intended image (we'll use the image below - " lukevader.jpg")

Initial image

Just as a curiosity, note that the rods they used in the original trilogy are both the same colour - this has changed in the new trilogy, mainly because it's hard to keep track of which blade is which in a fast'n'furious fight.

OK, here we see that Luke's blade is behind Vader's (another reason to have two different colours - makes it a bit easier to tell which blade is in front of which) - this means we do Luke's blade first (Vader's will be superimposed over the top).

Select the "Bezier Select Tool"
Bezier Select Tool
then zoom in on your image till you can accurately do some selecting (about 300% is usually good - use your keyboard's "+" and "-" to quickly zoom in and out).
Basically, select the blade by clicking on each of it's extremities
(Selection points highlighted in yellow)

Go right around the blade, finally clicking back on your original point (I usually start at the hilt), then clicking once inside your selection to activate the selection (the lines will go from solid to flashing dotted lines)
NB for GIMP2 users: The bezier tool changed in version 2 of the GIMP - it now creates paths, not selections.  Simply open up the Paths dialogue after clicking around the blade, choose the path you just made, right-click it, and choose "path to selection".

(Active selection flashes)

This method applies to your blade whether it's stationary or a "motion-blur" - if it's a motion-blur, just select the outer perimeter of the blur.

NB: If the blade is partially hidden behind a person or object, select the blade as if that object wasn't there!  I'll go into more depth about this later.
blur1   blur2
Also, being bezier curves, you can curve your lines into arcs if need be (but I won't go into that - look up "bezier curves" for further info).

Right, back to Luke.  We now have the blade selected, ready to process with the Blade-Roto Script-Fu.  Just before we do, find the coordinates for your emitter flare - the slightly brighter flare seen just above the handle.  This is optional, and takes a little longer to render, but it looks a bit better.  Just place your cursor slightly up the blade from the handle, and remember the coordinates shown in the bottom left-hand corner of the image window.
Now, fire up the Script-Fu by right-clicking the image and selecting Script-Fu/Lightsabre/Blade-Rotoscope - this will pop up the dialogue box, with options for your lightsabre.

Grow Size and FX Size work together to give the overall effect of the lightsabre.  The defaults are about right for mid-sized images such as the one we are working on, but as with most things, experiment until you get the look that you think is right for that particular image!  I've been experimenting with a whole heap of different pictures, and I still can't find a "standard" as such - some shots look better with a tight corona, others wider... it's basically a matter of personal taste, the background the sabre is against, and a whole host of other factors.  Just experiment with the numbers!
Essentially, Grow Size determines how "wide" the corona colour will be, whilst FX Size determines how "fuzzy" it will be - but they both interact and affect each other, so it's a matter of trial and error.
For this image, leave the settings to their defaults for the moment.

Next is Corona Colour, the colour of the corona surrounding the blade (<rant> another point - lightsabre blades are not coloured.  All lightsabre blades are white; it's the corona that is coloured </rant>).
You can either select a preset colour or choose you own - just use the drop-down menu, or click "Use Custom Colour" and click the colour tab to select a custom one.


redRed:  Sith or Dark Jedi (or just people who like red!)
cyanIce Blue:  Or "Cyan" - supposedly Luke's first sabre, but there are lots of variations
mid blueMid Blue:  A "mid" blue, between cyan and pure blue, which seems to be about the right colour for the ones in eps 1,2,4(Obi-Wan)&5
blueBlue:  A darker, "pure blue"
greenGreen:  Luke ROTJ, Qui-Gon, etc... This green may be a little wrong, seems a bit too light in desert scenes
violetViolet:  Mace Windu etc., but this also changes a bit
rogue blueRogue Blue:  My own personal colour, this one is a blue slightly on the purple end of the spectrum - an interesting effect is that this seems to be the only colour range that gives a two-tone effect; the corona transitions from blue to purple as if fades out... kinda a Rogue Jedi colour, ie. for those who have a maverick streak...
purplePurple:  Um... purple
yellowYellow:  Um... yellow
orangeOrange:  Um... orange
silverSilver:  Corran Horn/Keiran Halcyon, Neeja Halcyon - an "uncoloured" corona

OK, we have a colour selected.  Next is the option of emitter flare - see above for a description of this.  Personally, I like having this (subtle) effect turned on.   Unfortunately, you need to remember the coordinates you want (but you can switch to the image window and check them at any time)

The option of lighten corona should probably be left alone - turning this off usually results in a lighsabre that looks too fake, but it may come in handy for very light backgrounds, such as deserts.

Flatten image automatically flattens the image into one layer after the script has run - this saves a bit of time if you have a sabre that is not obscured by anything, but if your sabre is partially obstructed you will need the layers for further editing (explained later).

OK, you're all set.  Hit OK.  If you left emitter flare selected, the Flare FX dialogue box will pop up - just type in the coordinates for your flare (in this case, about X:189 Y:197)
(The picture is mostly just an indication - don't worry, it won't exactly turn out that pronounced).   Hit OK to continue
Flare FX

If flatten image was not selected, you may have to toggle the visibility of the background layer - it's a bug, not sure what causes it, I'm working on it...

For the hell of it, I've done Luke's lightsabre in red - we'll do a role-reversal, with Luke as the Sith and Vader as the Jedi...

Now do exactly the same thing for Vader.  NB:You'll need to flatten the image first.   Each sabre must be started from a flat image, otherwise the layers get all mixed up and you lose some of the colouring effects.
For this one, we'll do Vader's blade in "Rogue Blue".  Flare FX co-ords should be about X:322 Y:161.   Leave "flatten image" turned off.


Now, if we were to get really pedantic, it could be said that some of the glow from the sabre should really be hidden behind his helmet.  It's being a bit too picky here, but for obvious instances where a blade / corona is hidden behind an object (see the "blurry blade" pictures above), this is where having the layers kept separate comes into play.  Select the blade and run the script like normal - then you go back and edit out the sections of the blade that should be hidden.  The best way to do this is to turn off the visibility of all of the lightsabre layers (click on the "eye" next to each layer), then carefully select the parts of the image that you want the lightsabre to hide behind:
blade rendered   selection
This is easy with a good resolution blue-screen image, but for others you may have to hand-select stuff and do a lot of trial-and-error selection.
If you selected the object itself, go ahead and apply a little bit of feathering to take the "sharpness" off the selection - select/feather, about 3 to 5 pixels is usually good.  If you selected outside the object (eg., you selected the bluescreen), you need to invert the selection (select/invert) before feathering the selection.
Then make each layer of the lightsabre visible in turn, selecting each layer and clearing (CTRL-K) the selection on each layer.  Select/None, then Flatten Image, and you'll have a lightsabre "hidden behind" the object
hidden blade

Nearly done.  But as Luke and Vader's lighsabres are touching, it might be an idea to add some sort of "clash effect" - I've found that standard GIMP Lighting Effects works well enough for most stuff.   Flatten your image, find where the sabres intersect, then run Lighting Effects (Filters/Light Effects/Lighting Effects...) on those coordinates, and experiment with the values (I used an intensity of 0.75 here).   All done!

Darth Lukius vs Master Skywalker

Tor Lillqvist's Win32 port of the GIMP can be found here
The official GIMP home is here

Download Blade-Roto Script-fu Version1.3 (new corona colour added 1/6/03)

Want to know what it does?  Check out my rundown on How it Works / How to do it Manually (translatable to most layer-based graphics programs).

Liam, Ray and Ewan do a bit of practicing
Close-up Qui-Gon shot
Mr Hammil and Mr Prowse



spacer Document last modified:
12 September 2005
About Me   |  My Music   |  PC Stuff   |  Surfing   |  Bands   |  Contact Details  | Site by BaudAlign