How To Replace A Sky In GIMP

One of the realities of Gimp is it doesn’t have all the tools Photoshop does. In her post How To Replace A Sky In Photoshop, Helen Brady used a feature called “Blend If” in the blending options panel. This feature is great at helping replace a blown out sky but it doesn’t exist in Gimp. So, with her permission, I’ve taken her basic instructions and tweaked them to gain the same results from Gimp.
Without further ado, here is one useful method for replacing a sky in Gimp.
1) Fire up Gimp and open an image needing sky replacement and then drag in a sky image to the Layers panel. Rename the dragged image “Sky”. Click on the eye icon to the left of Sky to hide it from view for now.
![]()
2) With the background layer highlighted, select the Fuzzy Selection Tool (for a list of tools and icons, check out Gimp – An Introduction) and click any location in the sky. This tool will select regions with similar color attributes, so the more uniform the sky, the better the results. If not all the sky is selected, hold down Shift and keep clicking sky elements until it is all selected.
3) Select the Sky layer then click on Layers then Mask then Add Layer Mask.
4) In the dialog box that appears, click the button for Selection and then click Add.

5) Click on the box next to “Sky” to make the layer visible. The sky from the Background layer will now be replaced by the sky from Sky. But you may notice there is a harsh edge left by the mask. I’ve included a zoomed crop here to show an example.

6) To get rid of that border we’ll start by clicking on the Sky layer then, on the top menu, click Layer and Duplicate Layer. Right click on the new layer and click Edit Layer Attributes. Rename this layer “Border”. Your layer section should now look like this.

7) With the Border layer selected, click Layer from the top menu, Mask and Delete Layer Mask.
8) Now select the Background layer and repeat step 2) above.
9) Select the Border layer and then, from the top menu, click Select and Border. In the selection screen that appears pick a pixel width of around 5 depending on your image. Also select Feather Border.

10) Repeat steps 3 and 4 above with the Border layer selected.
You’re just about done!!
While you will now have a passable photo, you might want to tweak the curves of the background or sky layers. Adjust as needed to match the general brightness and contrast of the foreground objects. Once you’re tweak is finished you can merge the visible layers (located under the Layer menu item) and save in any format you wish, or leave it un-merged. The choice is yours!
In the end, you should have an image that looks something like this:
NOTE: It would be more elegant to create two layers of the sky initially. I chose the method above to help show the effects of only using the one mask without a border enhancement. It also helps simplify things for those just starting to use Gimp. Repetition is a wonderful tutor. :)




19 Responses to “How To Replace A Sky In GIMP” - Add Yours
August 4th, 2009 at 8:08 am
Thank you for finally posting a GIMP tutorial!
August 4th, 2009 at 8:33 am
It should be noted that you will likely want to adjust the curves of the foreground layer as well. In this example, the foreground is extremely bright compared to the comped in sky, which gives it a very unnatural look.
August 4th, 2009 at 5:04 pm
Actually Aaaron,
I think that the foregroun has also been modified, but the curves were adjusted in a way that the building looks even brighter than on the previous photo…
August 4th, 2009 at 5:20 pm
I agree that it looks unnatural.
Perhaps its better to expose for the sky first ;)
#just_teasing #don’t_flame_me
August 4th, 2009 at 6:16 pm
Finally a Gimp tutorial!
You should definitively do more of those! :-)
August 4th, 2009 at 10:28 pm
Great tutorial,thank you. But how can I drag another image to he layer panel?
August 5th, 2009 at 2:54 am
Why not just highlight the sky using the Fuzzy Selection tool (holding down shift to get it all), then use Levels and Color Saturation?
August 5th, 2009 at 9:42 am
Thanks for the comments. On second look, on another machine, the building could use better adjustment, I agree. I made the edits while on the road on a travel laptop, meaning it’s not the calibrated machine I have at home. My apologies for the off color on the building.
Those adjustments are what I meant when I typed “you might want to tweak the curves of the background or sky layers. Adjust as needed to match the general brightness and contrast of the foreground objects. “.
I guess it’s time to calibrate my travel laptop!
Thanks for the feedback!
August 6th, 2009 at 10:45 pm
Thanks, can’t wait to try it.
August 7th, 2009 at 11:32 pm
Great to see some GIMP coverage. Thanks!
August 8th, 2009 at 2:08 am
Please put on more Gimp tutorials. Thanks for this one
August 8th, 2009 at 6:08 am
Another fan of GIMP! Thanks! Don’t see this too often. I just took a bunch of pics out at Garden of the Gods and the sky is blown out in quite a few of them. Looking forward to putting this to good use. Thanks again
August 8th, 2009 at 8:05 am
Nice tutorial. I know a couple way of achieving this same thing, but didn’t know this one. In fact, one of the very first shots on my photoblog showed this same effect.
I agree with previous posters: It’s important to go beyond just the sky replacement and address coloring and other elements to make the photo look more natural.
August 11th, 2009 at 1:05 am
Great tutorial,thank you
August 12th, 2009 at 11:49 am
The best way I’ve found to do an edit like this is to take a proper exposure of the subject, in this case the building.
Then I’ll look for an open shot of the sky by itself at close to the same angle.
Then I simply layer the building over the sky shot and erase the bad sky out.
If the edges are too sharp between the building and sky I’ll use stitching say around 2~5 pixels and set it to blend with the base image, giving a softer transition or delineation from one layer to the next.
I’ve found it looks more natural that way.
The angle of the sky shot isn’t absolutely critical but it helps make the final image more believable when their are clouds.
August 12th, 2009 at 11:52 am
P.S.
I’ve also taken bracketed shots and layered them together as well, that way you get the proper exposure of everything.
You can also achieve excellent results using HDR editing as well.
August 12th, 2009 at 11:56 am
I also should add that this process took the correct exposure of the building and made it look different, darker and more contrasty, adding to the over edited look of the second image.
August 20th, 2009 at 3:04 am
Thank you for having a GIMP version of a previous Photoshop tutorial. Please keep these up.
Not all of us are going to give Adobe $600 when GIMP is a highly polished, FREE, alternative.
August 20th, 2009 at 5:29 am
I like this site , its very interesting , i use ` Microsoft Digital Image Suite` , i find it very easy to use and you can do a lot of what you can do on Photoshop (ok not all but much easier to understand)and you get good results to.Well worth using if you find Photoshop hard to use .
Leave a Reply