Skip to content
Styleof the Image component

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

Contain Image style, sample render

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.

Or ask your AI agent“Using imejis, make a 1200 × 630 image with the Contain style of the Image component (type "image") filled with my data, then give me a render link I can call with new values.”
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.png

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.

Free tools built on it, guides that use it, and the components that sit beside it.