Function Repository Resource:

ImageBump

Source Notebook

Add bump to an image

Contributed by: Mark Greenberg

ResourceFunction["ImageBump"][img]

filters the pixels in img to give the impression of 3D texture. Bright pixels appear raised, and dark pixels appear sunken.

ResourceFunction["ImageBump"][img,r]

filters with a radius of r, which can have values of 1, 2 or 3.

ResourceFunction["ImageBump"][img1,img2]

filters img2 to add texture to img1.

ResourceFunction["ImageBump"][img1,img2,r]

filters img2 using a radius of r to add texture to img1.

Details and Options

ResourceFunction["ImageBump"] can take the following options:
"LightPosition""NW"which corner the light appears to come from
"Intensity".75how intense the bump appears to be

Examples

Basic Examples (3) 

Add bump to an image:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/8a8c8254-939b-482a-a16e-4f82564f54e7"]
Out[2]=

Add bump with a radius of 3 to an image:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/9158c61c-5b6c-40d9-aba2-c74248ab0a43"]
Out[4]=

Add bump from one image to another:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/5186e645-1b85-44b9-ba86-86e383b766cb"]
Out[6]=

Scope (2) 

The images for ImageBump[img1,img2] may be different sizes. If either dimension of img2 is smaller than that of img1, it reflects and tiles:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/036a3c93-1fab-4db7-89e4-73873da30db8"]
Out[8]=

If a dimension of img2 is larger, it covers img1 starting in the top left corner:

In[9]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/065f93e6-8114-47b9-be7e-62aac535f31a"]
Out[10]=

Options (2) 

The option "LightPosition" has four possible settings: "NW" (default), "NE", "SE" and "SW":

In[11]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7709b3e0-6c4d-4323-87df-00012a6d2f57"]
Out[12]=

The option "Intensity" can take any real number i, although 0<i<1 gives the best results:

In[13]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/01a9dafd-7a37-47c6-b2f0-4e706c4a3fc0"]
Out[14]=

Applications (1) 

Give a photo a subtle pop:

In[15]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/fafd9302-6310-4b23-8d6d-23069ca8cfd7"]
Out[16]=

Publisher

Mark Greenberg

Version History

  • 1.0.0 – 15 April 2020

License Information