# ImageAddBorder

Adds a border to an image. This BIF allows you to specify the thickness, color, and type of border to apply to an image in BoxLang.

## Syntax

```
ImageAddBorder(name, thickness [, color] [, borderType])
```

## Arguments

| Name       | Type    | Required | Default | Description                                                             |
| ---------- | ------- | -------- | ------- | ----------------------------------------------------------------------- |
| name       | any     | Yes      |         | The image or the name of a variable referencing an image to operate on. |
| thickness  | numeric | Yes      |         | Border thickness (in pixels).                                           |
| color      | string  | No       | "black" | Border color: hex value or constant color name.                         |
| borderType | string  | No       |         | Border type: one of `zero`, `constant`, `copy`, `reflect`, or `wrap`.   |

## Returns

* **BoxImage**: The modified BoxImage instance with the border applied.

## Description

`ImageAddBorder` adds a border around the specified image. You can control the thickness and color of the border, as well as the border type. The image can be passed directly or referenced by variable name. The border type determines how the border is generated:

* `zero`: Border pixels are set to zero.
* `constant`: Border pixels are set to the specified color.
* `copy`: Border pixels are copied from the edge of the image.
* `reflect`: Border pixels are a reflection of the image edge.
* `wrap`: Border pixels wrap around from the opposite edge.

## Example

```boxlang
// Add a 10px black border to an image
img = ImageAddBorder(myImage, 10);

// Add a 5px red constant border
img = ImageAddBorder(myImage, 5, "red", "constant");
```

## See Also

* ImageResize
* ImageCrop

## Notes

* The default border color is black if not specified.
* The default border type is implementation-dependent if not specified.
* The image can be passed as a BoxImage object or as a variable name referencing an image.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-framework/modularity/image-manipulation/reference/built-in-functions/imageaddborder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
