Skip to the tutorial
lil cactus

How to replace the sky in a photo

Intermediate8 minutesUpdated

Quick answer

In Lil Cactus, open the landscape and choose Select then Sky…; for the sample, keep Sky confidence at 50%, set Edge recovery to 4 px, leave Soften edge on and click Apply. Choose Select then Inverse, then Layer then Raster Mask then Add Layer Mask (Reveal All) to keep the landscape visible and hide its sky. Choose Select then Deselect, use File then Place Image as Layer… to add a sky photo, and choose Layer then Arrange then Send Layer Backward. Position the sky, repair any missing foreground on the mask and save a Lil Cactus Project to keep both layers.

A lighthouse on a green coastal cliff before and after a flat gray sky is replaced with soft blue-gray clouds
The new clouds sit behind the lighthouse; the cliff, path and sea keep their original light. Drag the handle to compare.
Time
8 minutes
Level
Intermediate
You need
A landscape and a sky photo with compatible lighting
Works with
RGB photos, including JPEG, PNG and WebP
Open Lil Cactus

Sample files:Lighthouse photoDaylight sky

Free, no sign-up. Your photos stay on your computer.

Sky replacement combines two photos. A layer mask, a black-and-white picture attached to the landscape layer, hides its original sky: white shows the landscape, black lets the new sky underneath show through.

Choose a sky that belongs in the scene. This coastal photo has soft daylight and a gray-blue sea, so the sample replacement uses cool, softly lit clouds. A golden sunset would also need changes to the foreground’s lighting and color.

Replace a sky in seven steps

  1. Open the landscape and select its sky

    Download both sample files above, then choose File then Open… and open lighthouse-dull-sky.jpg. Keep sky-soft-daylight.jpg for step 4.

    Choose Select then Sky… Wait for the preview to finish. The first use may need to download the selection model; the image processing runs on your device.

    File menu with Open and Place Image as Layer ringed
    Open the landscape as a document. Place Image as Layer adds the second photo later.
    Select menu with Sky ringed
    Select Sky finds the sky in the visible picture.
  2. Check the selection preview

    For the sample, leave Sky confidence at 50%, set Edge recovery to 4 px and leave Soften edge checked. The smaller recovery radius suits the lighthouse’s hard outline. Click Apply.

    The preview shows the selected sky over a checkerboard. It is a starting point: pale buildings can be mistaken for sky. You will restore the missing corner of the lighthouse after adding the replacement.

    Select Sky controls with Sky confidence 50 percent, Edge recovery 4 pixels and Soften edge checked, each ringed
    Use these values for the sample; another skyline may need a different confidence or edge radius.
    The Select Sky preview with Apply ringed
    The sky is selected; the checkerboard marks the area left out.
  3. Make a mask that keeps the landscape

    Choose Select then Inverse, so the land, sea and lighthouse are selected instead of the sky. Then choose Layer then Raster Mask then Add Layer Mask (Reveal All).

    The original sky disappears into a checkerboard. A second thumbnail appears beside Background in the Layers panel: that is the mask. Choose Select then Deselect before adding the other photo.

    Select menu with Inverse and Deselect ringed
    Inverse swaps sky for foreground. Deselect clears the selection after the mask is made.
    Layer menu with Raster Mask open and Add Layer Mask Reveal All ringed
    Despite its name, Reveal All uses the active selection when you have one.
  4. Place the new sky below the landscape

    Choose File then Place Image as Layer… and select sky-soft-daylight.jpg. It appears as a new layer above Background and initially covers the picture.

    With sky-soft-daylight still selected, choose Layer then Arrange then Send Layer Backward. The masked Background is now above the new sky. The lighthouse and cliff reappear, with clouds showing through the hidden sky area.

    Layer menu with Arrange open and Send Layer Backward ringed
    Move the sky one layer down, behind the masked landscape.
    Layers panel with masked Background above the selected sky-soft-daylight layer
    The masked Background (its mask ringed) belongs on top; the sky belongs underneath.
  5. Position the clouds at the horizon

    Keep the sky layer selected and choose Edit then Free Transform. In the options bar, choose the center dot of the reference grid. For the sample, set Y to −68 and leave the other values unchanged: X 768, W and H 100%, Angle 0°. Click the check mark, Commit transform.

    This moves the sky upward by 580 px, placing its paler lower clouds at the sea horizon. For a different sky, drag inside the transform box until the cloud scale and horizon look plausible, keeping the entire hidden-sky area covered.

    Edit menu with Free Transform ringed
    Transform only the selected sky layer.
    Free Transform options with the center reference grid and Y minus 68 ringed
    Y is the vertical position of the chosen reference point, here the sky’s center.
    The end of the Free Transform options bar with the check mark ringed
    The check mark commits the new position.
  6. Restore the pale wall on the mask

    Choose View then Zoom In until the lighthouse base is easy to see, about 300%. If you need to pan, click the picture once first, then hold the space bar and drag. Click the Background mask thumbnail, the black-and-white thumbnail beside the landscape.

    Right-click the brush icon in the left toolbar and choose Brush. Press D, then X, to paint white. Set Size to 6 px and check that Hardness, Opacity and Flow are at 100%, their defaults.

    Paint short strokes inside the pale wall around the black door on the right of the lighthouse. Follow the roof lip above it and stop at the wall’s outer edge. Reduce Size to 2 px for the narrow right edge and roof tip. White on the mask brings these original building pixels back. Keep the strokes off the sky.

    Tip If a stroke brings back old sky, press Ctrl+Z or ⌘Z to undo it, then use a smaller brush.

    View menu with Zoom In ringed
    Enlarge the lighthouse base before repairing the mask.
    The Background mask thumbnail ringed in the Layers panel
    Select the mask so the brush changes visibility rather than painting white on the photo.
    The toolbar brush button and Brush in its flyout ringed
    Choose Brush from the toolbar group.
    Brush options with Size 6 pixels and Hardness 100 percent ringed
    Use a small hard brush inside the straight building edges.
    Enlarged lighthouse base before mask repair, with sky cutting into the right-hand white wall
    Before repair: part of the pale wall beside the black door is missing.
    The same lighthouse base after white brush strokes restore its right-hand wall and roof edge
    After repair: the wall and roof lip are visible again. Follow their outline, not a rectangle around the whole building.
  7. Save the layers and export a finished copy

    Choose File then Save As then Lil Cactus Project… to keep the landscape, its mask and the sky as separate editable parts. After that, File then Save saves the project. Choose File then Export then JPEG… and click Export for a new finished photo.

    If you stay with the opened JPEG, File then Save writes a flat picture in that format; its first Save opens Save Image.

    File menu with Save As open and Lil Cactus Project ringed
    Keep a project for later mask and sky changes.
    File menu with Export open and JPEG ringed
    JPEG exports a finished photo to a new file.
    JPEG export dialog with Export ringed
    Export a combined copy for sharing.

Fit a different sky

A sky photo with no land or water is easier to position. Start with enough pixels to cover the whole opening. In Free Transform, keep width and height linked when resizing so clouds keep their proportions. Use the sky’s distant, paler region at a sea horizon rather than cutting through a large nearby cloud.

Inspect the lantern, roof and cliff edge as well as the whole picture. A mask can hide a building corner or leave a pale fringe. White on the landscape mask restores foreground; black hides remaining original sky. Use a small brush near hard edges. Trees, wires and translucent branches need more careful masking than this sample.

Fix common problems

The new sky covers the lighthouse

The sky layer is above the landscape. Select it in Layers and choose Layer then Arrange then Send Layer Backward until it sits below the masked Background.

The landscape disappears instead of the sky

The mask was made from the sky selection. Select the Background mask thumbnail and choose Image then Adjustments then Invert to swap its light and dark areas. Invert applies immediately.

A checkerboard strip appears near the horizon

The sky has been moved too far up or is too small to fill the opening. Select the sky layer in Layers and use Edit then Free Transform to cover the whole masked area.

The clouds look pasted in

Check cloud scale, direction of light and brightness at the horizon. A sharp sunlit sky above a shadowless foreground needs more work than changing its position. Choose a closer lighting match before trying to correct the colors.

What to do next

Coming from another editor

Photoshop
Edit › Sky Replacement…

Sky replacement: questions and answers

Does Select Sky replace the sky automatically?

No. Lil Cactus’s Select Sky makes an editable selection. You use it to make a mask, then place and position a separate sky photo behind the landscape.

Can I replace a completely white sky?

Yes. In Lil Cactus you can hide a white sky with a layer mask and show a different photo underneath. This adds new cloud detail; it does not recover detail from the white pixels.

Can I move the new sky without moving the landscape?

Yes. In Lil Cactus, select the sky photo layer before choosing Edit › Free Transform. The landscape stays in place on its own layer above it.

Can I change a replacement sky after saving?

Yes, if you save a Lil Cactus Project. Its layers and mask remain editable; a JPEG export contains their combined appearance.

Does sky replacement also change reflections in water?

No. This Lil Cactus method replaces only the area hidden by the landscape mask. A visible reflection of distinctive clouds needs a separate edit to agree with the new sky.

Is my photo uploaded during sky replacement?

No. Lil Cactus processes Select Sky and the layered composition on your device. The first use may download the selection model.