# ImageRead

## Syntax

```
ImageRead( path )
```

## Arguments

| Name | Type   | Required | Description                                |
| ---- | ------ | -------- | ------------------------------------------ |
| path | String | Yes      | The file path or URL to the image to read. |

## Returns

`BoxImage` — The image object loaded from the specified path.

## Description

Loads an image from a file path or URL and returns it as a `BoxImage` object. This BIF is used to import images into BoxLang for further processing or manipulation.

## Example

```boxlang
// Load an image from a file
img = ImageRead( "images/photo.png" );

// Load an image from a URL
img = ImageRead( "https://example.com/image.jpg" );
```

## Related BIFs

* ImageNew
* ImageCopy
* ImageGetWidth
* ImageGetHeight

## Notes

* The `path` argument must be a non-empty string representing a valid file path or URL.
* If the image cannot be loaded, an error is thrown.
* Returns a `BoxImage` object for use in other image BIFs.
* **File handles are properly closed** - no file locking issues on Windows after reading.
* Files can be deleted immediately after `ImageRead()` completes.
* Images are fully loaded into memory - no lazy loading issues.
* Safe to use immediately without needing to call `info()` first.


---

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