Sky Over Baikonur Backdrop with Gimp

Sky Over Baikonur Backdrop with Gimp


Often, when modelling in 3D, it's necessary to create a "backdrop" panoramic image. Typically this shows sky and distant land which should appear behind the foreground action. One place we'll need this for the pilot to Lunatics is for the sky in Baikonur, Kazakhstan on launch day at the beginning of the story. I had some very particular ideas about how this should look, and I want to create just the right look. Here's how I constructed it.

Making Movies with Free Software

This article is part of an on-going series on the challenges I've faced in producing two free-licensed movies, Marya Morevna, through the Morevna Project and Lunatics, which we are working on as Anansi Spaceworks.

The main thing is that I had seen a photo of a launch which had a particularly beautiful palette of colors. I knew I wanted these colors. However, the image is not a terrific background plate -- it's way too narrow for a panorama and there are some foreground objects. More importantly, though, the image is not under a "safe" license, so I didn't want to use it directly. However, I did use it as a guide in choosing colors.

I had seen a photo of a launch which had a particularly beautiful palette of colors

Basic sky gradient

I started by creating a Gimp gradient based on the color of the sky itself. I did this by selecting places in the image where the background sky shows clearly (i.e. avoiding clouds) and then using those colors to create a Gimp gradient (Figure 1).

To do this, I have to get into Gimp's gradient editor, which may be a little confusing. Select File->Dialogs->Gradients to launch the gradient selector. Then, right-clicking in the selector window, I choose New Gradient to start a new gradient.

Figure 1: I created a basic sky gradient by selecting a few colors from an image of a sky with colors I particularly likedFigure 1: I created a basic sky gradient by selecting a few colors from an image of a sky with colors I particularly liked

Initially, this will have a left limit color and a right limit color, both indicated by black triangular arrows. In between is a white triangular arrow. This adjusts the curvature of the gradient from left to right. This gradient is more complex, though, so I right-click on the gradient and select Split Segment at Midpoint to create subdivisions as needed.

I started by creating a Gimp gradient based on the color of the sky itself

I started at the top and used to color picker (the "eye dropper") to set each color from my color reference image successively to the "Foreground" color. Then, I right-click on the appropriate segment of the gradient and set the right or left color to the foreground color as needed. To keep the gradient smooth, I then select the adjacent segment and match colors with either Load Left Color From->Left Neighbor's Right Endpoint or Load Right Color From->Right Neighbor's Left Endpoint as appropriate. The only exception is the horizon line, where I want a sharp boundary.

Repainting a new cloud image

I searched Flickr for an image of clouds that was more appropriate to my need and under a compatible license. To do this, I simply used the "Advanced Search" option which includes a Creative Commons license filter (Figure 2).

Figure 2: Searching Flickr for a free-licensed image of cloudsFigure 2: Searching Flickr for a free-licensed image of clouds

After a bit of browsing through this list, I settled on one wide-format high-resolution image which would do well as a backdrop for a 3D animation environment (This image is by "viZZZual.com@Flickr" under a Creative Commons Attribution license).

Using this new cloud image, I want to substitute coloring that matched my original image. To do this, I'm going to selectively paint a layer with color, then combine that with the value from the cloud image to complete a masked cloud layer. This will then be combined with the gradient sky image and the ground image to make the final backdrop.

I need to extract a masked version of the new cloud image, where all of the pure sky elements are transparent

First, of course, I need to extract a masked version of the new cloud image, where all of the pure sky elements are transparent. This is not so easy! The sky color changes over the image. I start by using the "magic select" tool to select swaths of similarly colored sky. The selector is a little too fine, but I daren't increase the tolerance too much since the clouds are similar in color. So instead, I create spatial groupings by selecting nearby regions with the "shift" key depressed (this adds the new regions to the selection rather than replacing it with them).

Figure 3: Creating the sky mask. I select using the Figure 3: Creating the sky mask. I select using the "magic select" tool; feather the selection; and then clear the selection

After I'm fairly satisfied, I then use Select->Grow followed by Select->Shrink. This is a trick to effectively smooth out the selection areas. The grow (of about 10 or 20 pixels in this case) eats up pixels that were overlooked because of aliasing effects. Then I shrink the area back to a better approximation of the area I want (about half as much as I grew the selection -- also being sure to unselect the "shrink from edges" option). After I'm done with this step, I use Select->Feather and select a feathering radius of about 75 pixels. This makes the mask edges soft, gradually transitioning from opaque to transparent. This is very useful, especially with fuzzy things like clouds, to eliminate obvious matte lines. I then use Edit->Clear to apply transparency to the selected sky areas (later on, these will be filled with my sky gradient).

Figure 3: Select by color on the key image, then paint the replacement color on the color layerFigure 3: Select by color on the key image, then paint the replacement color on the color layer

For now, though, I'm going to concentrate on re-coloring the clouds. The color balance is not what I want (this cloud picture was taken in another part of the world at another time of day and so the colors are rather different).

Now I have to be careful about this. I want to alter the color (the hue and saturation) of the clouds, but not their value. It is primarily the value of colors that is responsible for the appearance of a scene (this is why black-and-white images work -- even though they only contain color value information).

Figure 4: The new colored image is combined using the Figure 4: The new colored image is combined using the "Color" operator which means on the hue and saturation are changed. The value comes from the key image of clouds

Gimp calls the combination of hue and saturation "color." So we can say that we only want to change the color of the clouds, while keeping their value. Even with the color, though, we have to be a little careful to blend things smoothly, or the result will still have a blocky and unnatural appearance.

So, again, I select by color and create feathered selections. With each one, I set the color to a color from the color-key image. As I go, I build up colors on a separate image layer.

Note that I have to select the "Key Image" layer every time I do a "Select by color" -- because I want to select by the colors in that image, not in the one I'm working to create. But, I need to select the "Color Overlay" layer every time I fill the selection with the foreground color. To avoid mistakes, I've locked the "Key Image" layer so the fill operation wouldn't work even if I tried it.

Figure 5: The re-colored clouds are combined with a sky background based on the gradient I created earlierFigure 5: The re-colored clouds are combined with a sky background based on the gradient I created earlier

Of course, I go back to my "Color Key" image when I use the eye dropper to modify the foreground color.

I used a gaussian blur with radius 100 pixels to smooth out the color layer.

Then I set the layering rule to "Color" (rather than "Normal"). So now this layer simply controls the hue and saturation of the result, getting the value from the original key image of clouds.

A Quick Test

Just for fun, I tried compositing a flying Soyuz rocket from a NASA photo of a Soyuz launch into this image. This is something of a conceptual reconstruction of the image I started with, although I think this one is a little prettier.

Figure 6: As a quick test of the backdrop, I made a new wallpaper with a flying Soyuz composited onto itFigure 6: As a quick test of the backdrop, I made a new wallpaper with a flying Soyuz composited onto it

Later, of course, I'll be using this backdrop (and many others) for rendering scenes in Blender.

Licensing Notice

This work may be distributed under the terms of the Creative Commons Attribution-ShareAlike License, version 3.0, with attribution to "Terry Hancock, first published in Free Software Magazine". Illustrations and modifications to illustrations are under the same license and attribution, except as noted in their captions (all images in this article are CC By-SA 3.0 compatible).

Category: 

Author information

Terry Hancock's picture

Biography

Terry Hancock is co-owner and technical officer of Anansi Spaceworks. Currently he is working on a free-culture animated series project about space development, called Lunatics as well helping out with the Morevna Project.

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!