create_image_config
Generate JSON configurations for creating layered images with text, shapes, gradients, and effects using the Jsoncut API. Configure canvas dimensions, layer positioning, and output formats programmatically.
Instructions
Create a JSON configuration for image generation based on jsoncut documentation.
Returns a complete configuration object that can be used with the validate_config tool or submitted directly to the jsoncut API.
WORKFLOW:
First get the schema (read resource schema://image or call get_image_schema) to understand all available options
Create the configuration with this tool
Call validate_config to verify the configuration (if user provided media file paths)
Image Structure:
Layer-based system (rendered bottom to top, max 50 layers)
Canvas with dimensions, background color, and output format
Support for defaults to avoid repetition
Layer Types:
image: Display uploaded images with fit modes (cover, contain, fill, inside, outside)
text: Text with custom fonts, alignment, wrapping, and effects
rectangle: Rectangular shapes with fill, stroke, and rounded corners
circle: Circular and elliptical shapes
gradient: Linear or radial color gradients
Positioning Options:
x, y coordinates (pixels from top-left)
position strings: center, top, bottom, top-left, top-right, center-left, center-right, bottom-left, bottom-right
position objects: { x: 0-1, y: 0-1, originX: left|center|right, originY: top|center|bottom }
Visual Effects:
opacity: 0-1 transparency
rotation: degrees
blur: pixel radius
borderRadius: rounded corners (image, rectangle)
Text Features:
Custom fonts via fontPath or Google Fonts via googleFont (format: 'FontName:weight' e.g. 'Roboto:600')
Text wrapping with width and lineHeight
Alignment: left, center, right
backgroundColor (single line only)
Output Formats:
png: Lossless with transparency (default)
jpeg: Lossy compression (use quality parameter)
webp: Modern format with transparency and compression
Defaults System:
defaults.layer: Properties for all layers
defaults.layerType.{type}: Properties for specific layer types
File paths should be placeholders like "/image/2024-01-15/userXXX/filename.ext" or "/font/2024-01-15/userXXX/font.ttf".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Canvas width in pixels (max 4096px) | |
| height | No | Canvas height in pixels (max 4096px) | |
| backgroundColor | No | Background color (hex, rgb, or named). Default: transparent | |
| format | No | Output format: png (default, transparent), jpeg (compressed), webp (modern) | png |
| quality | No | Quality for JPEG/WebP (1-100, default: 90) | |
| defaults | No | Default properties for layers | |
| layers | Yes | Array of layer objects (max 50). Layer types: - image: { type: "image", path, x/y/position, width, height, fit, opacity, rotation, blur, borderRadius } - text: { type: "text", text, x/y/position, fontSize, fontPath/googleFont, color, align, wrap, width, lineHeight, backgroundColor, opacity, rotation, blur } - rectangle: { type: "rectangle", x, y, width, height, fill, stroke, strokeWidth, opacity, rotation, blur, borderRadius } - circle: { type: "circle", x, y, width, height, fill, stroke, strokeWidth, opacity, blur } - gradient: { type: "gradient", x, y, width, height, gradient: { type: linear/radial, colors: [], direction: horizontal/vertical/diagonal }, opacity, rotation, blur } |