> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-framework/modularity/image-manipulation/reference/built-in-functions/imagepaste.md).

# ImagePaste

## Syntax

```
ImagePaste( image1, image2 [, x] [, y] )
ImageDrawImage( image1, image2 [, x] [, y] )
```

Or as a member:

```
someImage.paste( imageToDraw [, x] [, y] )
someImage.drawImage( imageToDraw [, x] [, y] )
```

## Arguments

| Name   | Type    | Required | Default | Description                                                             |
| ------ | ------- | -------- | ------- | ----------------------------------------------------------------------- |
| image1 | any     | Yes      |         | The base image to paste onto. Can be a `BoxImage` object or image name. |
| image2 | any     | Yes      |         | The image to paste. Can be a `BoxImage` object or image name.           |
| x      | numeric | No       | 0       | The x-coordinate where the image will be pasted.                        |
| y      | numeric | No       | 0       | The y-coordinate where the image will be pasted.                        |

## Returns

`BoxImage` — The base image with the pasted image applied.

## Description

Pastes one image (`image2`) onto another (`image1`) at the specified coordinates. Useful for combining images, adding watermarks, or overlaying graphics at precise locations.

## Example

```boxlang
// Paste image2 onto image1 at (100, 50)
result = ImagePaste( image1, image2, 100, 50 );

// Using the alias
result = ImageDrawImage( image1, image2, 200, 75 );

// As a member function
image1.paste( image2, 10, 10 );
image1.drawImage( image2, 0, 0 );
```

## Related BIFs

* ImageOverlay
* ImageCopy
* ImageNew

## Notes

* Both `image1` and `image2` can be `BoxImage` objects or the names of images in the current context.
* The default coordinates are (0, 0) if not specified.
* The operation modifies the base image in place when used as a member function.
* Returns the modified image object for chaining or further processing.
* This BIF is also available as `ImageDrawImage` and as member functions `paste` and `drawImage`.
* Current implementation note: the BIF currently applies the `x` value to both axes, so `y` is effectively ignored.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
