# ImageSharpen

## Syntax

```
ImageSharpen( name [, gain] )
```

Or as a member:

```
someImage.sharpen( [gain] )
```

## Arguments

| Name | Type    | Required | Default | Description                                                     |
| ---- | ------- | -------- | ------- | --------------------------------------------------------------- |
| name | any     | Yes      |         | The image to sharpen. Can be a `BoxImage` object or image name. |
| gain | numeric | No       | 1       | The sharpening gain factor. Higher values increase sharpness.   |

## Returns

`BoxImage` — The sharpened image object.

## Description

Applies a sharpening filter to the specified image. The `gain` argument controls the intensity of the sharpening effect. Useful for enhancing image details and improving clarity.

## Example

```boxlang
// Sharpen image with default gain
result = ImageSharpen( myImage );

// Sharpen image with custom gain
result = ImageSharpen( myImage, 2.5 );

// As a member function
myImage.sharpen( 1.5 );
```

## Related BIFs

* ImageBlur
* ImageGrayScale
* ImageResize

## Notes

* The `name` argument can be a `BoxImage` object or the name of an image variable in the current context.
* The operation modifies the image in place when used as a member function.
* Returns the modified image object for chaining or further processing.
* The `gain` argument should be a positive number; higher values produce a stronger sharpening effect.


---

# 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/imagesharpen.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.
