Skip to content

Image Templates

Image Templates let you compose complex images from multiple layers including images, text, shapes, SVGs, and AI-generated content. Templates are defined once and can be rendered on demand with dynamic variable substitution.

A template defines a canvas with one or more layers. Each layer has a type (image, text, shape, SVG, or AI image), positioning, blend mode, effects, and opacity. When you render a template, PixelFiddler composites all layers together and returns the resulting image.

Templates are managed per space and referenced by name.

  • Max layers per template: 20
  • Max image layers per template: 3
  • Max SVG layers per template: 10
  • Max templates per space: 100

The canvas defines the base for your composition.

PropertyDescription
dimensionsWidth and height of the canvas in pixels (optional)
imageA base image layer to use as the canvas background (optional)
backgroundColorBackground color in hex format (optional)

If no dimensions are provided, the canvas size is determined by the base image or the first layer’s dimensions.

Displays an image from a connected media source. Supports all standard transformations and effects.

PropertyDescription
defaultSourcePathReference to a media source and file path
effectsList of effects to apply (blur, brightness, contrast, etc.)
asyncTransformationsAI transformations (background removal, AI edit)

Renders styled text on the canvas. Supports all text transformation parameters including font, color, size, shadow, and positioning.

PropertyDescription
textThe text content to display
colorText color in hex format
fontFont family name
fontSizeFont size in pixels
fontWeightFont weight (e.g. 400, 700)
opacityText opacity (0-100)
backgroundBackground color behind text
shadowShadow settings (color, blur, x, y, opacity)

Renders geometric shapes on the canvas.

Renders raw SVG content directly on the canvas.

PropertyDescription
contentRaw SVG string

Generates an image using AI models from a text prompt.

PropertyDescription
defaultPromptText prompt for AI image generation (optional)
dimensionsRequired width and height for the generated image
modelAI model tier: BASIC or QUALITY

Every layer (regardless of type) supports these common properties:

PropertyDescription
positionX and Y coordinates for layer placement
dimensionsOptional width and height of the layer
angleRotation angle in degrees
opacityLayer transparency (0-100)
fitModeHow the layer fits within its bounds: CROP or RESIZE
blendModeCompositing blend mode (see below)
effectsVisual effects applied to the layer

The following blend modes are available for layer compositing:

OVER, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, and more.

Templates support dynamic variables that can be substituted at render time:

  • String variables - Replace text content dynamically
  • Media source path variables - Swap images dynamically

Variables are defined in the template and provided as parameters when generating the image.

Create animated GIFs by defining multiple frames, each as its own image template.

PropertyDescription
delayFrame delay in milliseconds
loopsNumber of animation loops (-1 for infinite)
framesList of image templates, one per frame
GET /accounts/self/spaces/{spaceId}/image-templates

Returns all templates in the specified space.

PUT /accounts/self/spaces/{spaceId}/image-templates/{templateName}

Create a new template or update an existing one. Template names must be unique within a space.

Example request body:

{
"canvas": {
"backgroundColor": "ffffff",
"dimensions": {
"width": 800,
"height": 600
}
},
"layers": [
{
"type": "IMAGE",
"name": "background",
"descriptor": {
"position": { "x": 0, "y": 0 },
"opacity": 100,
"blendMode": "OVER"
},
"defaultSourcePath": {
"sourceAlias": "my-source",
"filePath": "backgrounds/hero.jpg"
}
},
{
"type": "TEXT",
"name": "title",
"descriptor": {
"position": { "x": 50, "y": 50 },
"opacity": 100
},
"text": "Hello World",
"color": "000000",
"fontSize": 48,
"fontWeight": 700
}
]
}
DELETE /accounts/self/spaces/{spaceId}/image-templates/{templateName}
POST /sources/{sourceId}/images

Renders a template and returns the generated image. Pass template variables in the request body to dynamically substitute content.

POST /sources/{sourceId}/gifs

Renders a multi-frame GIF template and returns the generated animation.