Results 1 to 8 of 8

Thread: Sky replacement with Alpha channels

  1. #1

    Join Date
    Feb 2016
    Location
    Cambridge, UK
    Posts
    928
    Real Name
    David

    Sky replacement with Alpha channels

    I may have chosen to practise on a particularly difficult example, but I am not achieving the desired outcome with this technique.

    I watched the video referenced in an earlier thread (https://www.youtube.com/watch?v=H6I9Q-b2pQc). It provides a very good explanation of the technique and I took copious notes of the steps. The video demonstrates the steps by replacing a fairly plain but quite blue sky in an image that also had a green middle and foreground. The colour in the sky therefore has significant contrast to the other elements of the image.

    The sky in my original is more overcast and has less colour “pop” in the rest of the image. Therefore, the blue channel does not show the same black/white contrast as a starting point from which to paint with balck or white using the overlay blend mode. Nor, for that matter, do the red or green channels. The blend mode lightens lights and darken darks, but there are a lot of mid greys in my image’s blue channel so I imagine these are not affected by this blend mode, with the result that my mask is not the pure back/white it needs to be for the mask to work as intended.

    Of course, my analysis of the problem may well be wrong, and there may be other factors at play.

    Here is the example I have chosen to work with. Please ignore the water which now looks as though it is frozen.

    Original image:
    Sky replacement with Alpha channels

    Edited version:
    Sky replacement with Alpha channels

  2. #2
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,147
    Real Name
    Manfred Mueller

    Re: Sky replacement with Alpha channels

    You've "fried" the edges of the twigs and branches by adding a background that is too dark for the extracted image. Lighten up the replaced layer and you will get a better looking result.

    Try lightening the background to eliminate those areas:

    Sky replacement with Alpha channels


    This is your tree and foreground. All I did was use a different background and matched it to a brightness that works. I did an alpha channel extraction using your original image.

  3. #3

    Join Date
    Feb 2016
    Location
    Cambridge, UK
    Posts
    928
    Real Name
    David

    Re: Sky replacement with Alpha channels

    Quote Originally Posted by Manfred M View Post
    You've "fried" the edges of the twigs and branches by adding a background that is too dark for the extracted image. Lighten up the replaced layer and you will get a better looking result.

    Try lightening the background to eliminate those areas:

    Sky replacement with Alpha channels


    This is your tree and foreground. All I did was use a different background and matched it to a brightness that works. I did an alpha channel extraction using your original image.
    Thank you so much Manfred. That is absolutely brilliant and proves how effective the technique can be.

    I had wondered what he meant by "frying the edges".

    Incidentally, I noticed that I had some smoothing on when I painted and it was more effective when I set that to zero. Flow and opacity were already 100%.

  4. #4
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,147
    Real Name
    Manfred Mueller

    Re: Sky replacement with Alpha channels

    Quote Originally Posted by Rufus View Post
    Thank you so much Manfred. That is absolutely brilliant and proves how effective the technique can be.

    I had wondered what he meant by "frying the edges".

    Incidentally, I noticed that I had some smoothing on when I painted and it was more effective when I set that to zero. Flow and opacity were already 100%.

    No problem!

    Some information on the three settings associated with the Brush tool:

    1. Opacity - Puts down the percentage of the foreground colour you have selected when you brush over an area. If you want more colour on that area, it won't deposit any more until you have released the mouse button and pass over the area again.

    I never use this functionality and always leave it set at 100%.

    2. Flow - Puts down the percentage of colour every time you pass over the area without having to release the mouse. This is what I always used and vary the amount from 1% to 100%, depending on what I am doing. As I use a Wacom tablet, I have even more control as pen pressure adds another variable as to the amount of colour put down.

    In my view, you should always have either flow or opacity set to 100% and vary the other setting. Varying both makes no sense to me, even though I see people doing this all the time. When I ask why they do this, they don't really have a logical explanation.

    3. Smoothing - cuts down the jitter when you use the brush tool. Again, more important for someone using a tablet than a mouse because it allows one to draw a smoother pattern. I rarely change this as I find 10% is a good trade off between my hand motion and how the tool reacts. I have set the smoothing higher for some very delicate work from time to time.

  5. #5
    pnodrog's Avatar
    Join Date
    Sep 2012
    Location
    Nomadic but not homeless, ex N.Z. now Aust.
    Posts
    4,149
    Real Name
    Paul

    Re: Sky replacement with Alpha channels

    In general as Manfred has shown the sky needs to be lighter than the tree detail.

    When doing photography for real estate blank skies were often replaced. A relatively quick method to help tidy up the edges is to do the selection of the original sky then expand the selection slightly (5 -15 or so px depending on image size). Use the selection as the mask for the new sky, use darken as the blend mode and back off layer opacity or adjust the brightness until you achieve a believable result.
    Last edited by pnodrog; 4th June 2019 at 03:51 AM.

  6. #6

    Join Date
    Feb 2016
    Location
    Cambridge, UK
    Posts
    928
    Real Name
    David

    Re: Sky replacement with Alpha channels

    Quote Originally Posted by Manfred M View Post

    ...Smoothing - cuts down the jitter when you use the brush tool. Again, more important for someone using a tablet than a mouse because it allows one to draw a smoother pattern. I rarely change this as I find 10% is a good trade off between my hand motion and how the tool reacts. I have set the smoothing higher for some very delicate work from time to time.
    I didn't know what effect the smoothing setting would have and don't recall changing it from whatever the default would have been. I had assumed it was somehow related to feathering. I also hadn't noticed the Tools icon next to the Smoothing setting.

    I have now looked for more information about this on line and found a video which explains the settings well. Although the tutorial is aimed more at digital artists than its practical application to photographers, it is pertinent to both.

    If anyone is interested the video is here: https://retouchingacademy.com/brush-...oshop-cc-2018/

  7. #7
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,147
    Real Name
    Manfred Mueller

    Re: Sky replacement with Alpha channels

    Quote Originally Posted by Rufus View Post
    I have now looked for more information about this on line and found a video which explains the settings well. Although the tutorial is aimed more at digital artists than its practical application to photographers, it is pertinent to both.

    If anyone is interested the video is here: https://retouchingacademy.com/brush-...oshop-cc-2018/
    Actually quite pertinent to intermediate level to advanced retouchers, not just digital artists. I use these types of techniques all the time in my own work.

  8. #8
    Moderator Manfred M's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    22,147
    Real Name
    Manfred Mueller

    Re: Sky replacement with Alpha channels

    Quote Originally Posted by pnodrog View Post
    In general as Manfred has shown the sky needs to be lighter than the tree detail.

    When doing photography for real estate blank skies were often replaced. A relatively quick method to help tidy up the edges is to do the selection of the original sky then expand the selection slightly (5 -15 or so px depending on image size). Use the selection as the mask for the new sky, use darken as the blend mode and back off layer opacity or adjust the brightness until you achieve a believable result.
    Agreed Paul - I tend to use this technique more in background replacements for portraits than for landscapes (or real estate). Playing with the mask the way you suggest is part of my approach as well. I will sometimes expand the mask, sometimes expand and partially feather it back and sometimes add a small Gaussian blur to it to clean up edge contamination. As you put it so clearly, the image size is definitely a driver as is the background being replaced.

    I find hair replacement even more of an issue than with leaves (especially blond hair) as it can can be a bit translucent. Losing a bit of detail during the masking process gives a more realistic blend with the new background. Each situation is a bit different and needs a slightly different approach in fine tuning the mask.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •