Function: drop_shadow

Function: drop_shadow

Usage

 drop_shadow(image, offset_x: offset, offset_y: offset)

Add a drop shadow to an image.

The shadow is based on the opacity of the image.

To make sure the shadow doesn't fall outside the image, it can be a good idea to enlarge the image first.

Parameters

Parameter Type Default Description
input image Image to add drop shadow to
offset_x real number 0 Relative position of the shadow, a positive number moves the shadow to the left.
Value is in the range 0 (no movement) to 1 (move by the width of the image)
offset_y real number 0 Relative position of the shadow, a positive number moves the shadow down.
Value is in the range 0 (no movement) to 1 (move by the height of the image)
blur_radius real number 0 Amount to blur the shadow.
alpha real number 0 Opacity of the shadow, in the range 0 (fully transparent) to 1 (fully opaque)
color color black Color of the shadow.

Examples

 drop_shadow("image4.png", offset_x: 0.08, offset_y: 0.08, alpha: 0.5)  ==  [[Image]]
 drop_shadow("image1.png", offset_x: 0.08, offset_y: 0.08, alpha: 0.5) == "image_drop_shadow_1.png"
 drop_shadow("image4.png", offset_x: -0.1, offset_y: 0.1, alpha: 1, color: rgb(0,0,255), blur_radius: 0.05)  ==  [[Image]]
 drop_shadow("image1.png", offset_x: -0.1, offset_y: 0.1, alpha: 1, color: rgb(0,0,255), blur_radius: 0.05) == "image_drop_shadow_1.png"