Free plan

Composite Layers

Stack pictures, text and colours in layers on a base picture
POST
/v1/images/composite

About this tool

Builds one picture from layers, like in a design program. The first picture you upload is the base. On top of it you can place other pictures, text or blocks of colour, each with its own position, size and see-through level. You can have up to 10 layers. The layers are written as a list, so it suits people who are comfortable with details.
For example, you put a logo and a short caption on top of a photo at exact places.

How to use it

  1. Choose this tool.
  2. Add your base picture first, then any other pictures you want to use as layers.
  3. Describe each layer in the layers box: what it is and where it goes.
  4. Press Generate.
  5. Download the finished picture.

What you get back

You get one new picture with all your layers combined, ready to download.
TEST IT LIVE

Try Composite Layers in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/composite
Tool ID
images.composite
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/composite" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'layers=[{"type":"image"}]' \
  -F 'output_format=jpeg' \
  -F 'quality=1'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.composite({
    "images": 'photo.jpg',
    "layers": [
      {
        "type": "image"
      }
    ],
    "output_format": "jpeg",
    "quality": 1
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->composite([
    'images' => 'photo.jpg',
    'layers' => [[
            'type' => 'image',
        ]],
    'output_format' => 'jpeg',
    'quality' => 1,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Stack pictures, text and colours in layers on a base picture.

Composite Layers accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Composite Layers is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/composite with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.