Skip to main content

Layer Types

JsonCut supports five main layer types, each designed for specific visual elements. Layers are rendered in the order they appear in your configuration, from bottom to top.

Image Layers

Display uploaded images with advanced positioning and effects.

Image Layer Example

{
"type": "image",
"config": {
"width": 1200,
"height": 700,
"backgroundColor": "#592B1E",
"layers": [
{
"type": "image",
"path": "/image/2000-09-09/cmejszvz00/5399b3f3-a21e-4161-bc9e-9dc64f383e19.jpg",
"position": "center",
"width": 800,
"height": 600,
"fit": "contain",
"opacity": 0.8,
"rotation": 5,
"blur": 4
}
]
}
}

Properties

PropertyTypeRequiredDescription
pathstringRelative path to uploaded image (e.g., /image/2024-01-15/user123/file.jpg)
x, ynumberPosition in pixels
width, heightnumberScaled dimensions
fitstringHow to fit image: cover, contain, fill, inside, outside
opacitynumberTransparency (0-1)
rotationnumberRotation in degrees
blurnumberBlur radius in pixels
borderRadiusnumberCorner radius in pixels for rounded edges

Fit Modes

  • cover - Crop to fill dimensions while maintaining aspect ratio
  • contain - Scale to fit within dimensions, may leave empty space
  • fill - Stretch to exact dimensions, may distort image
  • inside - Scale down only, never up
  • outside - Scale to cover dimensions, may crop

Text Layers

Add text with extensive typography control and custom font support.

Text Layer Example

{
"type": "image",
"config": {
"width": 800,
"height": 400,
"backgroundColor": "#007acc",
"layers": [
{
"type": "text",
"text": "This is a text layer!",
"x": 400,
"y": 200,
"fontSize": 48,
"fontPath": "/font/2000-01-09/cmejszvz00/cd9c64d5-c92c-4c04-9ebc-b976361c3f5e.ttf",
"color": "#FFFFFF",
"align": "center",
"opacity": 0.8,
"rotation": 0,
"backgroundColor": "#644691"
}
]
}
}

Properties

PropertyTypeRequiredDescription
textstringText content to display
x, ynumberPosition in pixels
fontSizenumberFont size in pixels (default: 24)
fontFamilystringFont family name (default: "Arial")
fontPathstringPath to custom font file
colorstringText color (default: "#000000")
alignstringText alignment: left, center, right
wrapbooleanEnable text wrapping
lineHeightnumberLine height multiplier (e.g., 1.2)
backgroundColorstringText Background color as Hex code (Note: Only works with single line text)

Rectangle Layers

Create solid or outlined rectangular shapes for backgrounds, borders, and UI elements.

Rectangle Layer Example

{
"type": "image",
"config": {
"width": 600,
"height": 300,
"backgroundColor": "#6B6B6B",
"layers": [
{
"type": "rectangle",
"x": 100,
"y": 50,
"width": 400,
"height": 200,
"fill": "#007acc",
"stroke": "#004d7a",
"strokeWidth": 4,
"opacity": 0.8
}
]
}
}

Properties

PropertyTypeRequiredDescription
x, ynumberPosition in pixels
width, heightnumberRectangle dimensions
fillstringFill color (hex, rgb, or named color)
strokestringBorder color
strokeWidthnumberBorder width in pixels
opacitynumberTransparency (0-1)
rotationnumberRotation in degrees
blurnumberBlur radius in pixels
borderRadiusnumberCorner radius in pixels for rounded edges

Style Variations

Rectangle Variations

{
"type": "image",
"config": {
"width": 500,
"height": 200,
"backgroundColor": "#f8f9fa",
"layers": [
{
"type": "rectangle",
"x": 50, "y": 50, "width": 100, "height": 100,
"fill": "#ff6b6b"
},
{
"type": "rectangle",
"x": 200, "y": 50, "width": 100, "height": 100,
"stroke": "#4ecdc4", "strokeWidth": 3
},
{
"type": "rectangle",
"x": 350, "y": 50, "width": 100, "height": 100,
"fill": "#45b7d1", "stroke": "#2c3e50", "strokeWidth": 2
}
]
}
}

Circle Layers

Add circular and elliptical shapes for icons, decorative elements, and UI components.

Circle Layer Example

{
"type": "image",
"config": {
"width": 600,
"height": 300,
"backgroundColor": "#ffffff",
"layers": [
{
"type": "circle",
"x": 200,
"y": 50,
"width": 200,
"height": 200,
"fill": "#4ecdc4",
"stroke": "#2c3e50",
"strokeWidth": 5
}
]
}
}

Properties

PropertyTypeRequiredDescription
x, ynumberPosition in pixels
width, heightnumberCircle/ellipse dimensions
fillstringFill color
strokestringBorder color
strokeWidthnumberBorder width in pixels
opacitynumberTransparency (0-1)
blurnumberBlur radius in pixels
Perfect Circles

To create a perfect circle, set width and height to the same value. Different values create ellipses.

Gradient Layers

Create smooth color transitions for backgrounds and visual effects.

Gradient Layer Example

{
"type": "image",
"config": {
"width": 800,
"height": 300,
"layers": [
{
"type": "gradient",
"x": 0,
"y": 0,
"width": 800,
"height": 300,
"gradient": {
"type": "linear",
"colors": ["#ff6b6b", "#4ecdc4", "#45b7d1"],
"direction": "diagonal"
}
}
]
}
}

Properties

PropertyTypeRequiredDescription
x, ynumberPosition in pixels
width, heightnumberGradient area dimensions
gradientobjectGradient configuration
opacitynumberTransparency (0-1)
rotationnumberRotation in degrees
blurnumberBlur radius in pixels

Gradient Types

Linear Gradients

Linear Gradient Examples

{
"type": "image",
"config": {
"width": 600,
"height": 300,
"layers": [
{
"type": "gradient",
"x": 0,
"y": 0,
"width": 600,
"height": 300,
"gradient": {
"type": "linear",
"colors": ["#667eea", "#764ba2"],
"direction": "vertical"
}
}
]
}
}

Direction options:

  • horizontal - Left to right
  • vertical - Top to bottom
  • diagonal - Top-left to bottom-right

Radial Gradients

Radial Gradient Examples

{
"type": "image",
"config": {
"width": 600,
"height": 300,
"layers": [
{
"type": "gradient",
"x": 0,
"y": 0,
"width": 600,
"height": 300,
"gradient": {
"type": "radial",
"colors": ["#ff6b6b", "#4ecdc4", "#45b7d1"]
}
}
]
}
}

Multi-Color Gradients

You can use any number of colors in your gradients:

Multi-Color Gradient

{
"type": "image",
"config": {
"width": 600,
"height": 200,
"layers": [
{
"type": "gradient",
"x": 0,
"y": 0,
"width": 600,
"height": 200,
"gradient": {
"type": "linear",
"colors": [
"#ff9a9e", "#fecfef", "#fecfef",
"#a8edea", "#fed6e3", "#d299c2"
],
"direction": "horizontal"
}
}
]
}
}

Best Practices

Performance Tips

  1. Optimize layer count - Keep under 50 layers for best performance
  2. Use appropriate image sizes - Don't use 4K images for small elements
  3. Minimize blur effects - High blur values can slow processing

Design Guidelines

  1. Layer hierarchy - Place backgrounds first, foreground elements last
  2. Consistent styling - Use defaults for repeated properties
  3. Readable text - Ensure sufficient contrast against backgrounds
  4. Mobile considerations - Test designs at different sizes

Common Patterns

Card Design

Card Design Pattern

{
"type": "image",
"config": {
"width": 600,
"height": 400,
"backgroundColor": "#f8f9fa",
"layers": [
{
"type": "rectangle",
"x": 50, "y": 50, "width": 500, "height": 300,
"fill": "#ffffff", "stroke": "#e0e0e0", "strokeWidth": 1
},
{
"type": "image",
"path": "/image/2000-02-09/cmejszvz00/avatar-example.png",
"x": 80, "y": 80, "width": 60, "height": 60
},
{
"type": "text",
"text": "User Name", "x": 160, "y": 95,
"fontSize": 24, "color": "#333333"
},
{
"type": "text",
"text": "Description text here", "x": 160, "y": 125,
"fontSize": 16, "color": "#666666"
}
]
}
}

Next Steps