Place a cut-out image (transparent background) onto a fixed-size canvas. The subject is scaled to fill up to a chosen % of the canvas (keeping proportions), centred by default — align it to any edge and nudge it with offsets. Use it to normalise cut-outs to a consistent size and position, e.g. before a generative/edit step or for a uniform catalog look.
One POST request. Get the result back directly — as an image, video, or JSON depending on the tool.
curl -X POST https://apiai.me/api/workflow/place-image-on-canvas \
-H "X-API-Key: YOUR_API_KEY" \
-F "image=@input.jpg" \
-F "background=#e8e8e8" \
-F "canvas_height=960" \
-F "canvas_width=1280" \
-F "h_align=center" \
-F "max_height=90" \
-F "max_width=90" \
-F "min_opacity=8" \
-F "v_align=center" \
-F "x_offset=0" \
-F "y_offset=0"
--output result.png
Test this tool visually before writing any code. Upload an image, set parameters, and see the result live. When it looks right, copy the auto-generated curl command and paste it into your app.
Process hundreds of images at once without writing a loop. Upload a CSV with one row per item, set your parameters, and download the results as a ZIP when they're done.
| Name | Required | Description | Default / Options |
|---|---|---|---|
background |
optional | Fill behind the subject. Options: a hex colour like #e8e8e8, white, or transparent. | #e8e8e8
|
canvas_height |
optional | Output canvas height in pixels. | 960
|
canvas_width |
optional | Output canvas width in pixels. | 1280
|
h_align |
optional | Horizontal placement. Options: left, center, right. | leftcenterright
|
max_height |
optional | Subject is scaled to fill up to this % of the canvas height, keeping proportions (never stretched). The tighter of max_width/max_height sets the size. | 90
|
max_width |
optional | Subject is scaled to fill up to this % of the canvas width, keeping proportions (never stretched). The tighter of max_width/max_height sets the size. | 90
|
min_opacity |
optional | How solid a pixel must be (0-100%) to count as part of the subject; fainter see-through edge pixels are treated as background. | 8
|
v_align |
optional | Vertical placement. Options: top, center, bottom. | topcenterbottom
|
x_offset |
optional | Nudge left/right from that placement, as % of the canvas width. Positive = right, negative = left. | 0
|
y_offset |
optional | Nudge up/down from that placement, as % of the canvas height. Positive = down, negative = up. | 0
|
Get an API key, test Place Image on Canvas in the dashboard, and copy the curl command.