Mask Related Question

Moderator: jsachs

Post Reply
Marpel
Posts: 693
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Mask Related Question

Post by Marpel »

I am working on a project where I have generated a mask of a tree (started out in fog). I have removed extraneous stuff and the result is a single white tree against a black background. The tree has no leaves but a lot (a real lot) of branches. The trunk of the tree is a couple - three hundred pixels wide (at least) and the smallest branches are perhaps 5 pixels thick, or so. So far, so good, however, I have been trying to reduce the number of small branches, while retaining the larger branches and trunk to make the image "less busy". Initially, I lost some of the smallest branches by upping the contrast (by moving the grey levels and colour slider to extreme ends of the scale, past the full range, to the point that it is only pure black and pure white now). However, this did not lose many of the smaller branches that I am looking to do. I have tried applying a negative feather, then using the grey levels and colour slider with only the black side pushed beyond the full range. This tended to reduce some of the smaller branches, but had the negative side effect of adding "prickly" like nubs along the branches and trunk, and making the image look less realistic. This problem increases the more times this process is applied.

Can anyone suggest a method to accomplish what I am trying to do, while retaining the semblance of a tree?? I could do a whole lot of pen tool and write over the smallest branches with black, however, there are a whole lot of these branches and it would take me weeks to do (at over 1:1 resolution). Hopefully someone can suggest a quicker, easier way.

Thanks,

Marv
Marpel
Posts: 693
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Mask Related Question

Post by Marpel »

At the suggestion of another member, I am attaching two images to show others the mask I am working on to, perhaps, give everyone a better idea of my initial post. One is the full image (lightly cropped to eliminate as much black as possible), while the other is a 600 pixel square full res image which gives a clear view of the branches. As initially stated, I am trying to find an easy method to eliminate the thinnest branches while retaining the larger, so the mask is not so "messy". As I use tree masks like this quite a lot in my images, I am looking for a quick method that can be used repeatedly.

Hope this image attachment thing works.....

Marv
Attachments
tree-mask-crop.jpg
tree-mask-crop.jpg (104.67 KiB) Viewed 6918 times
tree-mask-crop-600-px.jpg
tree-mask-crop-600-px.jpg (203.3 KiB) Viewed 6911 times
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Mask Related Question

Post by couman »

Marv,
I'm not sure of how much you want to remove, but have you tried the speck removal transformation that's included in Advanced Sharpen? Set it for remove light and try a couple of different speck sizes.
Bob Coutant
ksinkel
Posts: 594
Joined: April 2nd, 2009, 11:58 am
Contact:

Re: Mask Related Question

Post by ksinkel »

Marv,

If what you want is a less literal rendering of tree, I would suggest you try the Watercolor Transformation (It's under Special Effects). Watercolor has a number of settings that you can play with to get the result you want.

You will probably want to apply it to the image itself, not the mask. However just to show what it does, here is a fairly aggressive application of watercolor to the mask.

If you decide to try it, please post your before and after results.

Kiril

tree-mask-crop.jpg
tree-mask-crop.jpg (582.98 KiB) Viewed 6869 times
Kiril Sinkel
Digital Light & Color
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Mask Related Question

Post by couman »

You might also try the high contrast transformation to remove some of the weaker branches -- adjust the cutoff to taste
Bob Coutant
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Mask Related Question

Post by den »

Yet another suggestion...

...and perhaps this will work with the full sized mask image... ...where:

Img0 = "tree-mask-crop-600-px.jpg" Converted to 8-bit BW (a mask image can only be 8-bit BW)

1) click on Img0 and Gaussian Blur: Amount =100%; Threshold = 100%; and Radius = 6 or preference; and OK, creating Img1... ...if needed, adjust Img1 to Full Range with the Levels and Colors transform as higher radius blurs will potentially lower contrast range to less than 0 to 100% gray tones...

2) Special Effects\Posterize Img1: Amount = 100%; Number of colors = 2 [black, 0%; white, 100%]; check Remap Colors; check Antialis; and OK, creating Img2...

3) click Img0 and open the Composite-Blend transform where Input Image = Img0; Input Amount Mask = Img2, white = 0% and black = 100%; Overlay = solid Black and Overlay Amount = 100%; and OK, creating Img 3... ...a modified mask version of Img0 with some small branches removed:
tree-mask-crop-600-px-1_remvd_sm_branches.jpg
tree-mask-crop-600-px-1_remvd_sm_branches.jpg (104.08 KiB) Viewed 6834 times
...den...

P.S... ...yet another alternate: hire a tree surgeon and re-take the shot! ;-)
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Mask Related Question

Post by couman »

And yet another --
The small branches can be deemphasized by running the mask through the edge transformation in darken mode.
Try all three edge algorithms -- one of them might give the result you're seeking.
[And let us know how you make out.:)]
Bob Coutant
Marpel
Posts: 693
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Mask Related Question

Post by Marpel »

Thanks everyone for the replies and suggestions. I will have to work through and try each (after the Super Bowl, however). Will report my results.

Marv
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Mask Related Question

Post by den »

Supplement to my previous post above...

During the Super Bowl half-time show, it occured to me that an 'active' Mask Tool - Brightness Curve with a Stair Step could act as a threshold adjustment when monitoring an updating Preview during the step 3) Composite - Blend... ...this 'active' Mask is used in place of the Posterize transform in step 2) and applied to Img1... ... it provides preference adjustment for branch removal for a given step 1) Guassian Blur...
40-50-60percent-StepCrv_600px.jpg
40-50-60percent-StepCrv_600px.jpg (76.08 KiB) Viewed 6771 times
The details with further illustrations are described here if of interest:
http://www.ncplus.net/~birchbay/misc/re ... method.pdf

...den...
davidh
Posts: 836
Joined: June 9th, 2009, 2:16 am

Re: Mask Related Question

Post by davidh »

One more idea if it is not too late.
Quite straightforward metod might be to use the mask flood fill tool with the right Threshold which allows only branches up to the minimum acceptable thickness to be included into mask.

The attached example (intentionaly aggresive settings):
First use the mask tool Flood Fill, here with the Threshold = 100, click on the trunk, Blur radius = 1 Apply, then OK or Apply Mask
This is the most important step. The mask blur of just a radius = 1 is used just to remove the excesive crispness of the remaining branches.

After that you might want to use the Unsharp Mask, here the Radius = 2 - right part of the attached example
or perhaps already suggested High Contrast, here the Threshold about 40 - left part of the example

You can even tune the branches a little bit more down by filtering the image with itself using Filter transformation after converting it to 24-bit color.

David
Attachments
tree.jpg
tree.jpg (57.51 KiB) Viewed 6728 times
Post Reply