- Components
- Image
- Contain
Contain Image
Show the whole image letterboxed inside its box with object-fit contain and a neutral backdrop, swapping the URL on every API call. Try imejis free.
Updated

What this style sets
A style is the image component with a few properties set. Send these, or start from the style in the editor.
{
"photo.imageSize": "contain",
"photo.backgroundColor": "#F3F4F6",
"photo.borderRadius": 0
}Good for
- Product shots that must never be cropped
- Logos with unpredictable aspect ratios
- Screenshot embeds in social cards
Try your own data
Change the contain image here with the same controls the editor shows. The preview updates as you type, and you get the API request for your changes.
Examples
Each example is the same contain image with different values. The JSON is what you send.
Uncropped product shot
A catalog photo letterboxed on white with a hairline border.
{
"photo.imageSize": "contain",
"photo.backgroundColor": "#FFFFFF",
"photo.borderRadius": 8,
"photo.padding": "20px",
"photo.borderWidth": 1,
"photo.borderColor": "#E5E7EB",
"photo.borderStyle": "solid"
}Screenshot embed in a social card
A wide screenshot letterboxed on slate inside a dark social card.
{
"photo.imageSize": "contain",
"photo.backgroundColor": "#1E293B",
"photo.borderRadius": 12
}New values, every render
Point '<key>.image' at any image URL per render; opacity, borders and padding can be overridden too. Send only the properties you want to change; everything else keeps its design value. The API guides cover every language.
curl -X POST "https://render.imejis.io/v1/$IMEJIS_DESIGN_ID" \
-H "dma-api-key: $IMEJIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"photo.image": "https://picsum.photos/seed/hello/600/600",
"photo.imageSize": "contain",
"photo.backgroundColor": "#F3F4F6",
"photo.borderRadius": 0
}' \
-o image.pngconst res = await fetch(`https://render.imejis.io/v1/${process.env.IMEJIS_DESIGN_ID}`, {
method: "POST",
headers: {
"dma-api-key": process.env.IMEJIS_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"photo.image": "https://picsum.photos/seed/hello/600/600",
"photo.imageSize": "contain",
"photo.backgroundColor": "#F3F4F6",
"photo.borderRadius": 0
}),
})
if (!res.ok) throw new Error(`render failed: ${res.status}`)
const image = Buffer.from(await res.arrayBuffer())import os
import requests
response = requests.post(
f"https://render.imejis.io/v1/{os.environ['IMEJIS_DESIGN_ID']}",
headers={
"dma-api-key": os.environ["IMEJIS_API_KEY"],
"Content-Type": "application/json",
},
json={
"photo.image": "https://picsum.photos/seed/hello/600/600",
"photo.imageSize": "contain",
"photo.backgroundColor": "#F3F4F6",
"photo.borderRadius": 0
},
)
response.raise_for_status()
with open("image.png", "wb") as f:
f.write(response.content)Other image styles
Contain Image questions
What does the Contain style change on the image component?
The full image letterboxed inside its box on a neutral background. It sets 3 properties on the image component: imageSize, backgroundColor, borderRadius. Everything else keeps the component's defaults, so your data and layout carry over.
How do I render the contain image through the API?
Add a image component to a design, then send its data together with the style's properties as flat overrides (for example photo.imageSize and photo.backgroundColor) in the render request. Each render can carry different data while keeping the Contain look.
Can I change the image on every API call?
Yes — point '<key>.image' at any publicly reachable image URL in the modifications JSON and each render fetches that image.
How is the image fitted inside its box?
imageSize maps to CSS object-fit (cover, contain, fill, none, scale-down) and imagePosition sets the focal point, so you control cropping precisely.
Where the image component fits
Free tools built on it, guides that use it, and the components that sit beside it.


