Skip to main content

Layers and text

The Media Delivery API lets you overlay images and text onto a base asset. Layer 0 is always the base and further layers are added on top using indexed parameters, each with its own source, position, anchor, opacity, and visibility.

Base URL pattern

The parameters on this page are appended to a Dynamic Media image URL. For the URL pattern and how parameters chain together, see the Media Delivery API guide.

Layers
Link copied!

Layers allow multiple images to be composited together. Layer 0 is always the base image. Additional layers are applied on top using indexed parameters (layer1, layer2, etc.). Parameters for each layer are enclosed in square brackets [].

https://cdn.media.amplience.net/i/ampproduct/blue-dress-outside?layer1=[src=/i//exampleRoundel]

To apply parameters to the base image itself, address it as layer0:

https://cdn.media.amplience.net/i/ampproduct/blue-dress-outside?layer0=[w=800]&layer1=[src=/i//exampleRoundel&w=150]

src - Layer image source
Link copied!

The URL of the image for the specified layer. Starting the path with /i// reuses the account domain from the base URL.

https://cdn.media.amplience.net/i/ampproduct/woman-in-blue-spotted-dress?layer1=[src=/i//blue-roundel]
Try it...

top, left, bottom, right - Layer position
Link copied!

Positions a layer relative to the previous layer. By default, layers are positioned in the top-left corner. Values can be pixels or percentages.

Combine with anchor for fine-grained control.

https://cdn.media.amplience.net/i/ampproduct/woman-in-blue-spotted-dress?layer1=[src=/i//blue-roundel&top=50%&left=50%]
Try it...

anchor - Layer anchor
Link copied!

Specifies which point of the layer aligns to the position coordinates. Use with top, left, bottom, right.

ValueDescription
TLTop left
TCTop center
TRTop right
MLMiddle left
MCMiddle center
MRMiddle right
BLBottom left
BCBottom center
BRBottom right
https://cdn.media.amplience.net/i/ampproduct/woman-in-blue-spotted-dress?layer1=[src=/i//blue-roundel&anchor=MC&top=50%&left=50%]
Try it...

opacity - Layer opacity
Link copied!

Sets the transparency of a layer. 0 is fully transparent; 100 is fully opaque.

https://cdn.media.amplience.net/i/ampproduct/woman-in-blue-spotted-dress?layer1=[src=/i//blue-roundel&opacity=50]
Try it...
50

visible - Layer visibility
Link copied!

Controls whether a layer is rendered. 0 is hidden; 1 is visible. Default is 1.

https://cdn.media.amplience.net/i/ampproduct/woman-in-blue-spotted-dress?layer1=[src=/i//blue-roundel&visible=0]
Try it...

canvas - Canvas layer
Link copied!

Creates a blank canvas of the specified dimensions onto which other layers can be drawn. Optionally specify a background colour with bg. Default background is white.

Format: canvas={width},{height}

https://cdn.media.amplience.net/i/ampproduct/?layer0=[canvas=700,400&bg=rgb(226,216,202)]&layer1=[src=/i//running-shoe&w=280&anchor=MC&top=50%&left=50%]&layer2=[src=/i//blue-roundel&w=110&anchor=TR&top=24&right=24]
Try it...
700
400

Text layers
Link copied!

Text can be rendered as a layer on top of an image.

ParameterValuesDescription
textstringText string to render. Use \n or %0A to insert a line break.
fontSizeinteger (pt)Font size in points. Default: 10.
fontFamilystringFont family. Default: Helvetica. Falls back to Helvetica if the requested font is not installed.
fontStylenormal, italic, obliqueFont style. Follows CSS font-style rules.
fontWeight100–900 in multiples of 100, normal, boldText weight. normal = 400; bold = 700.
fontStretchultra-condensedultra-expandedWidens or narrows text. Follows CSS font-stretch rules.
textColorhex, rgb(), or named colourColour of the rendered text. Default: black.
textDecorationunderline, overline, linethroughDecoration applied to the text.
textAlignleft, center, rightAlignment within the text layer (applies when text spans multiple lines). Default: left.
https://cdn.media.amplience.net/i/ampproduct/women-wearing-denim-small?layer1=[text=New%20denim%0AShop%20now&fontSize=48&textColor=white&textAlign=center&fontWeight=400]
Try it...
48
400