The biggest problem isn’t masking. The composite might not be convincing because of differences in lighting between the two photos. They look so different because the sky in the lava picture has no warmth at all, it has a lot of cold cyan as if photographed in the early morning or after sunset. Something has to be done to explain to the human eye why those two lighting conditions can exist in the same picture. I don’t think the lava picture can continue to be so cyan if you want its content to be color-consistent with a picture of a very warm sunset. If composited as is, the brain won’t accept the way one picture’s color balance clashes with the other.
If you study how the Edit > Sky Replacement feature works in Photoshop, you’ll find that their automatic sky mask is intentionally not a solid edge. Their mask lets part of the sky color bleed into the foreground. This helps unify the color between the two layers.
My quick attempt below uses a Solid Color Fill layer to warm up the masked blue lava image. My Color Fill mask tries to control where the warmth would show up more and less. It should be more warm when the foreground cloud is exposed to the sunset light, including around the edge. I’m still questioning whether any part of the lava image should be as blue as the original when composited with the sunset. The lighting strategies and color theory needed aren’t new, they’re taught in classes teaching classical representational painting (traditional, not digital). Those skills are very useful for photo compositing.
No, I don’t think mine is perfect. Maybe the mask edges need to be blended better.

In the future, this kind of thing might take fewer steps. The public beta of Photoshop now includes a new AI-powered feature under testing called Harmonize, shown in the picture below. After removing the background from the lava layer, compositing the images took just one click on the Harmonize icon in the Contextual Task Bar. You can see how Harmonize is trying to unify the colors across the images, because it knows that so much of making a convincing composite is matching up the lighting, both tonal distribution and color palette.

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
