5
$\begingroup$

Leaf Example

So, I want to make my own leaf textures for trees, but if I just make a PNG with transparent background it gets a weird white edge. So I found that usually they use this effect with an alpha mask to get rid of that issue. I remember watching a tutorial on how could I do it time ago, but i don't remember the technique, the name of it neither the tutorial name.

Any ideas?

(Actually, I found other ways to fix the issue, but I want to be able to use this)

Edit: First of all, thanks for your answers, very useful, but doing some more investigation I found the name of the technique and many ways to do it. Actually, the technique is called "Edge Padding" or even "Edge dilate".

$\endgroup$
0
9
$\begingroup$

There is a compositing node called Inpaint that does exactly that:

enter image description here

It can be found iin the compositing nodes add menu shift+a in the Filter section:

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Nice find, wasn't aware of this. +1 for making it in Blender $\endgroup$ – Duarte Farrajota Ramos Nov 1 '18 at 18:11
4
$\begingroup$

An alternative technique using Blender istelf

Import you leaf image as a plane using File > Import > Image as Plane (activate the addon in the User Preferences if necessary.

Enter Edit Mode in the imported plane and use the Knife Project tool (K).

Trace over the border of your image with as much detail as desired, making sure you always thread slightly inwards in relation to the alpha edge. (Illustrated below is a quick and dirty, you can follow the image detail more closely)

enter image description here

Once done, eliminate the surrounding leftover vertex so only the leaf remains.

Select all border edges and extrude them in place with E then immediately Right Click to cancel. Proceed by scaling them up as desired.

enter image description here

$\endgroup$
2
  • $\begingroup$ Is there a way in blender to quickly overlay the original back onto the result above? $\endgroup$ – batFINGER Nov 1 '18 at 16:00
  • $\begingroup$ You could probably do the above operation either in a separate object, or duplicate the original plane in edit mode, then overlay it afterwards my moving slightly in Z axis. You would have to somehow bake or screencapture the result though $\endgroup$ – Duarte Farrajota Ramos Nov 1 '18 at 18:17
2
$\begingroup$

Could not really find an elegant solution for this.

In the particular case of a single leaf, or images with simple island shapes you could achieve a vaguely equivalent effect using GIMP's Recursive Transform.

enter image description here

Open the desired image with an alpha channel in GIMP, increase the size of the layer with Layer > Boundary Size as desired, so there is actual usable image space around the leaf layer.

Open Filters > Map > Recursive Transform use the on-canvas gizmos to very slightly scale the image up. The smaller the factor the smoother the expansion, at the expense of having to repete the process to fill the available space.

Tick the option Paste Below so new iterations don't overlap the original leaf, and adjust the iterations as necessary. Repeat the filter with Ctrl + F if necessary to fill available space.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.