You are here


  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
Galaxy.jpg149.99 KB
JMS-Space_Galaxy.scm18.74 KB

This is an attempt to automate making a galaxy via GIMP. I'd seen a few excellent tutorials, but none that could be easily automated. One of the resulting pictures is attached to this page.

The galaxy can have any number of arms, and they can have varying degrees of curvature. Very high degrees of curvature will result in an elliptical galaxy rather than a spiral. Stars can be added, and the galaxy can be set to have any perspective or color.

This script uses the Outer Glow function from the layer effects script found elsewhere on this site. The Outer Glow script (and the sub procedures) have already been added to my galaxy script. Their names have been changed to make sure there are no conflicts with the original layer effects script, in case you also have that installed.

The script is under the "/Filters/SambrookJM/" menu in GIMP, although that can be changed by editing the last line of the script to put it wherever you want it to go.

As always, if you've got any suggestions, improvements, or comments (or if it's not working for you) go ahead and post them. One thing that can happen is that if the galaxy color is too bright, some of the other details can be washed out. Try to decrease the brightness of the top two layers to counteract this.

[edit] Yeah, I screwed up. There were a couple of scripts that I didn't copy over from the layer effects script. I thought refreshing the scripts on my GIMP would flush them out of the memory after I removed that script file. It didn't. My fault, 100%. This new script should fix things.

gerard82, I think figured out what your problem was. The problem was in the (rand 4000000000) statement. For some reason, Linux versions of GIMP don't like the random number being that high. I lowered the maximum possible random number to 1000000000, which allowed me to run this script (and the brick wall one) on a Ubuntu 10.10, 64-bit build. Try this and the Brick Wall script (soon to be updated) and see if that works.

Code License: 
GIMP Version: 
Scripting Engine: 


The "skew angle" is a measure of how far the perspective command in the script skews the galaxy. High numbers give it a very high aspect ratio. Originally, it was set from 0-90. It is now set (I believe) from -90 to 90, so it can be skewed either to the left or right. You don't need to edit the script at all, ursa_major. Just run it, experiment, and see what you get.

With a name like ursa_major, you should feel right at home using astronomical scripts!!

Thanks SamBrookjm the tilt works great now.
I know your busy and its a lot to ask but could you add a setting for nebula type fog areas?
Something like this old tutorial i started on nebulas (but never finished).

The gases on the outside of the swirls - maybe another pinch and whirl cycle after a white blur?

thanks again

best regards,

How did you get those blobs there in the first place? I've got something similar, but not quite like it, by:

Creating four layers of very detailed random noise
Running threshold on each of them (from 128-255)
Setting the mode of the top three layers to darken only.
Flatten the image.
Gaussian blur by 32 horizontal and 20 vertical (on a 640x400 image)

How did you get them? And how did you get the galaxy to look like that? Very nicely done...

Create a new document with 1920×1200 pixels (72 dpi) and fill canvas with color #000000
Make a new layer above the black one and fill it with pure white color (#ffffff).
We have now two layers: the black one and the white above it. For the layer with white color we change the Layer Blending Mode to Dissolve, layer opacity 1% (no more than this amount) and get something resembling space.

The next step is the critical one -
Create a new layer like this - this is where the script would ask the user to paint the strokes.

Then a whirl and pinch

Then the angle part would run (for the perspective angle)
Then a blur

Then whirl and pinch again

Set the perspective

Time for some color-
Create three new layers - name them nebula-colors 1,2, and 3, and change the layer Blending Mode to Color.
Grab the paint brush tool - Set the opacity of the brush to 10.0, and the scale to 10.0 - use the circle fuzzy 17 brush - select the color - 5a78cc
Select your new nebula-colors layer1 and paint over the galaxy like this
first layer -

change color to #ff0000 to add red color
second layer -

change color to #fff000 to add yellow color
third layer -

of course the colors could be optional in the script?
Now just add the center core or bright spot. :)
Add your blur and then maybe some stars around the nebula.

Something like that anyways :)
Mostly whirl and pinch and blur
flip and whirl and pinch - set perspective
add color - add center - add stars

Here is one i just did with those exact directions except i added a dup layer of nebula clouds and set that duplicate layer to dissolve for a more intense ring feel.
You can of course then set the layers opacity to your liking.


Subscribe to Comments for "Galaxy"