Lucee Function Reference
imageaddborder()
Adds a rectangular border around the outside edge of an image. The border can be a solid color or generated using various edge extension methods. The original image remains centered while the border increases the image dimensions.
Example
imageaddborder(any image,[number thickness,[string color,[string borderType]]]):void
Category
image,border,effect
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
| Name | Type | Required | Default Value | Description |
|---|---|---|---|---|
| image | any | Yes | The source image to which the border will be added. | |
| thickness | number | No | 1 | Thickness of the border in pixels. The border is added to the outside edge of the image, increasing the image dimensions by 2 * thickness in both width and height. |
| color | string | No | black | The color of the border when borderType is "constant". Has no effect with other border types. Can be any valid color name or hex value. |
| borderType | string | No | constant |
Determines how the border area is filled: * `constant`: Creates a solid color border using the specified color * `zero`: Creates a black border (equivalent to constant with color="black") * `copy`: Extends edge pixels outward. Each border pixel copies the value of the nearest edge pixel. Corner areas are filled with the color of the nearest corner pixel * `reflect`: Creates a mirror effect by reflecting the image at its edges. Edge pixels are mirrored outward, and corners are created by mirroring the already reflected edges horizontally * `wrap`: Creates a tiled effect by wrapping the image content around to the opposite side, as if the image were repeated in all directions |