# maskimage: Mask an Image with Another Image

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

Masks a source image to this image using the average pixel color. A completely black pixel on the mask will make a pixel in the image completely transparent.

- Group: Images
- Endpoint: `POST https://api.1001fx.com/images/maskimage`
- 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/maskimage

## Parameters

- `x` (number, optional, default `0`) – X coordinate: The horizontal position from the top left corner. Defaults to 0.
- `y` (number, optional, default `0`) – Y coordinate: The vertical position from the top left corner. Defaults to 0.
- `file1` (file, required) – Source image: Image to be masked.
- `file2` (file, required) – Mask image: Image to be used as mask.

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

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