# overlayimages: Overlay an Image on another Image

> overlayimages (Overlay an Image on another Image) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/overlayimages, 3 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Overlays two images to create a new image with the second image placed as an overlay. Uses the png file format for transparency. Canvas size is preserved.

- Group: Images
- Endpoint: `POST https://api.1001fx.com/images/overlayimages`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: multipart/form-data
- Credits: 3 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/overlayimages

## Parameters

- `x` (number, required, default `0`) – X coordinate: The x position from top left corner. Defaults to 0.
- `y` (number, required, default `0`) – Y coordinate: The y position from top left corner. Defaults to 0.
- `file1` (file, required) – Background image: Image in the background. Use png to preserve transparency.
- `file2` (file, required) – Overlay image: This image is placed on top of the background image. Transparency is allowed (png only).

## Use cases

- Put your logo on product photos
- Place a badge or a frame over profile pictures
- Combine a background image and a transparent PNG into a social media image

## Example: Combine to images and place the second on top of the first

```bash
curl -X POST 'https://api.1001fx.com/images/overlayimages' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file1=@1600x900.png' \
  -F 'file2=@256x256.png' \
  -F 'x=100' \
  -F 'y=100'
```

## FAQ

**How do I position the overlay?**

With x and y in pixels from the top left corner of the background image. Both default to 0.

**Is transparency kept?**

Yes, if you use PNG files. The result is a PNG and keeps the canvas size of the background image.
