Hints, tips and tutorials for 3D modelling & content creation
|
KatsBits
Creating 3D models, meshes &
game content
3D modelling & meshing, level editing and textures makingHints, tips and tutorials for 3D modelling & content creation [back]Quick way to mask tree leavesContentsThe photo source ^Trying to create a tree leaf sprite from a photo is often quite tricky and time consuming but use the following info below and it's possible to get good results relatively quickly. The following (3 step) technique works best when a trees leaf mass is clearly defined so no other trees or objects get in the way of the main source needed for a sprite. In other words, when taking photographs try and compose the shot so the main mass of leaves/tree is backed by something 'flat', preferably the sky.
![]() Source photograph taken against a flat 'overcast' sky. Desaturate the image ^Once the photograph is open in your photo editing application it's needs to be desaturated to a grey scale (black and white) image; removing colour from the photograph makes it easier to work with because you're then just dealing with a single set of tonal values rather than values associated with using a full RGB colour image.
You could at this point try and use this as a mask but it won't give you the clean silhouette that's needed for the actual mask, so the image needs another step. ![]() Desaturating the image to convert it into a tonal grey scale (black and white) image. Contrast enhancement ^Editing this next step needs will depend on the photo editing application you use; the image is manipulated so the results are similar to a 'stencil' - a 'black/white' image. How this is done will vary but generally speaking altering the contrast and brightness of the image should be enough to at least create flat areas and hard shapes. The result is the actual image that will be used as a mask over the photograph.
Adding the mask over the photograph ^Once you've got something approximate to the above 'mask' it then needs to be added as an mask layer to the original photograph. Again how this is done will vary dependant on the photo editing software being used but generally speaking you have two options; open the original photograph and then do one of the following;
This then means you have a clean mask in a few simple steps that will allow you to extract (copy/paste into a new document) and edit the leaf mass to create a much better tree sprite. ![]() Mask image added to the original photo |