Post Reply 

Blue Tree.

Aug 11, 2012, 10:38
Post: #1
Blue Tree.
I've been working with a picture of a tree, it'll form part of a larger image, and I noticed that after removing the sky there is a blue tinge left around the tree and the foliage to the right of it.
I'm guessing that this was caused by the way the camera was set up when I took the picture...hmmm, more practice needed. I've managed to remove the tinge by shrinking the selection and deleting but that leaves the leaves looking rather un-leave like - lots of leaves thereRolleyes
Anyway, I was wondering if here's anyway to remove the blue tinge without having to shrink and delete.
There's a couple of pictures added to show what I mean. Cheers.

   

   

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 11, 2012, 10:49 (This post was last modified: Aug 11, 2012 20:19 by ofnuts.)
Post: #2
RE: Blue Tree.
This is a color aberration known as "purple fringing" that happens with digital cameras in high contrast areas... There are specific fixes for that. Google it up.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 11, 2012, 17:00
Post: #3
RE: Blue Tree.
Thanks for the info, I'm going to check out purple fringing now.

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 12, 2012, 10:54
Post: #4
RE: Blue Tree.
Had a very mixed bag of results with the different fixes I found on-line. I tried desaturating blue and magenta by using the hue/saturation filter and I also installed the Darla-Purple fringe script, but both times I'm still left with a faint blue line around the tree. So then it was on to selecting the fringe with the colour select tool and trying to alter the look of it that way, little success with that idea.

The only thing that seems to solve the problem is to shrink the selection around the tree by five pixels and then hit delete, but of course as I said before that trashes the leaves.

It almost looks to me that the fringe effect is cause by a bleed over of light from the sky, if that's the right way to say it. But then again the sky's grey and the fringe is blue. Strange stuff.

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 12, 2012, 13:06
Post: #5
RE: Blue Tree.
OK, let's try some sorcery...
  • "Colors/Components/Decompose" produces an image with 3 layers, one for each of the RGB channels
  • Making the R or G layers invisible and the other one in "Difference" mode over the blue layer makes the fringing very obvious:
    [attachment=1384]
  • However,it also shows that the fringing is mostly visible on the trunk. The blue halo on the leaves is likely due to an incomplete selection of the border pixels, due to their intermediate colors.
  • The fringing is mostly due to too much blue (and some green) on the tree, and not to not enough R/G in the sky.
  • So, to fix this, we should take the blue channel on the fringe to some more reasonable level... The best level is the nearby pixels, slightly more inside the trunk.
  • Let's have a selection on the trunk: hide the R an G layers, wand-select the sky, then using the Freehand selection in "add" mode (shift-click), or the quickmask, make sure you have a clean selection border against the trunk
  • Invert the selection (we want the trunk).
  • Start the clone tool
  • Ctrl-click slightly inside the border (outside of the fringe), then clone on the fringe. You may want to put the brush in "darken-only" mode. The selection prevents the cloning to bleed over the sky.
  • Make one of the R or G layers visible again (in difference mode) to check
  • Repeat the clone process on the green layer
  • When done, use Colors/Components/Recompose to rebuild an image without the fringing:
    [attachment=1386]
(this is quick job... you can get better results with more care)


For a proper extraction of your leaves:
  • use Colors/Color to alpha on the whole image (use pure white),
  • add a layer mask, transfer the alpha channel the layer mask,
  • use the Levels tool to:
    • make all all the black completely black (black handle around 50)
    • make the clear stuff completely white (white handle around 150)
    • adjust the selection on the leaves using the gray handle (3.0 looks about right).
  • make the layer mask visible, and paint white the gray spots on the trunk
  • Apply layer mask
[attachment=1387]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 12, 2012, 16:09
Post: #6
RE: Blue Tree.
Thanks for all of this, it's real decent of you.
I did try selecting the fringe again with colour select and then filling the selection with black, but it's painfully slow to do and and all I got for several hours work was a black fringe instead of a blue one. And the leaves, the less said about them the better.

I'll give your system a go and see what happens, it certainly looks like it's going to solve the fringing problem. Smile
The picture I've been working on is mostly finished, all I need to do is sort out the background, which the tree is part of, then I'll post the finished piece at Deviant Art. I've got some problems with the light sources on it but that's for another day.

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 12, 2012, 19:34
Post: #7
RE: Blue Tree.
   

Well, I think I managed to screw it right up. I've got transparency over the tree and no way that I know of to get ride of it.That's a tad annoying.

I wasn't sure what was meant by
Quote: add a layer mask, transfer the alpha channel the layer mask,
so I guessed. Not the best course of action but it's the kinda thing I do, and now I have no idea what I did...Doh.

The cloning process would only work on the left side of the tree. On the right side it left many different colours but that's my fault for not posting the entire image to start with...Doh the sequel.
I did use the selection process though, and then cloned around the edge without decomposing , which sort of worked.

Anyway, I'm going to guess that there's not much can be done to save the image, but it's always worth asking.

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 12, 2012, 19:54
Post: #8
RE: Blue Tree.
That's the purpose of the step with the Levels tool on the layer mask. Color-to-alpha makes a lot of things a bit transparent. On the layer mask this translates to light gray. With Levels you push the light gray to white, to stuff that was a bit transparent becomes fully opaque again. You do the same thing at the other end of the range so stuff that was a bit opaque (typically some areas in the sky, with mask of almost black, is pushed to fully black and becomes completely transparent. You may even get gray mask areas in the trunk, that you can paint in white to make them fully opaque.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 13, 2012, 17:48
Post: #9
RE: Blue Tree.
I just had another go and this time found "Transfer Layer's Alpha Channel." Don't know why I couldn't see it yesterday, just one of those things I guess. So now I'm not stuck with the checker board affect over the tree after applying the layer mask but what I do get is a much darker version of the tree minus the sky. I can get round this problem by using a duplicate of the tree layer to make the changes to, then colour selecting the transparent area and transfer it to the original tree layer before deleting. I am wondering though if there is a way to keep the tree's original brightness level without having to use a duplicate layer to get around the darkening problem?

Anyway, the point is this is a great way of selecting a complex background for removal. I can recommend it to anyone as it works a charm. Cool

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Aug 13, 2012, 19:52
Post: #10
RE: Blue Tree.
The tree looks darker because it lost its "white" during the Color-to-alpha step (in the image part I had the tree was very dark, so hadn't much white to loose). To prevent this, instead of doing the C2A to the whole image, make a rough selection of the tree trunk (quick mask) especially over its lighter parts, and invert the selection before applying the C2A. This will protect these light areas from the removal of the white.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 14, 2012, 17:26
Post: #11
RE: Blue Tree.
Thanks for the info, I'll try the quick mask next time.

Quote:The cloning process would only work on the left side of the tree. On the right side it left many different colours but that's my fault for not posting the entire image to start with...Doh the sequel.

Whilst redoing the clone process last night I suddenly realised why so many different colours showed up on the right side of the tree. Basically it boils down to the fact that I was running the clone tool so close to the trunk edge that it was cloning the purple fringe instead of a clean part of the trunk. I didn't notice this first time around as the selection I was working on was, if I remember right, grey in colour and I didn't make either the R or G layer visible again to check.
And that's where corner cutting gets you...right back at the start.

[Image: DjIVv.png?1]

My DeviantArt gallery
http://caz747.deviantart.com/
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Would like to convert this graphic from blue to red orielonline 5 1,207 Jan 4, 2013 23:55
Last Post: ofnuts
  Change cloudy sky to blue GaryHunt1948 1 1,166 Jan 24, 2012 08:02
Last Post: ofnuts

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS