Thursday, 10 January 2008

Photoshop: Using Defringe

Here’s a quick tip which is very useful for those occasions when you want to make a fairly complicated selection in Photoshop.


This came about when an estate agent client of mine found it necessary to replace all of his skies with a clear blue sky but was having trouble selecting branches and foliage. Here’s the original image:




1. First go to Select> Color Range… and click inside the sky to select it. Adjust the fuzziness slider to suit your needs.


2. Now open your replacement sky picture and past it into the document. I’ve used this image:


3. This will create a new layer. Unlock the background layer and move it on top of the pasted in layer. At the moment, the selection is not looking pretty. This is where Defringing the layer can help. This command can be found in Layer> Matting> Defringe... Make sure nothing is selected and then adjust the settings to suit your needs. You may have to undo a couple of times to get things right. Here's before defringing:



4.  And here’s the after:



It's still far from perfect but here's where a bit of jiggery-pokery comes in handy. Select the layer (command or control-click the layer thumbnail) and then use the eyedropper tool to sample a colour from the branches. Now get yourself a brush, set the opacity to about 50%, reduce the hardness and begin painting over the rough areas. Only the selected branches will be affected.

5. And here’s the end result. If you didn't know that the sky had been changed you would be hard-pressed to spot it.