Documentation

Complete reference for DrawByURL syntax and features

Home·Builder

Quick Start

DrawByURL uses a packed key-value syntax where each element is described in a URL path segment. Elements are separated by forward slashes (/), and attributes within each element are separated by hyphens (-).

/{type}[-{key}-{value}]*[/{type2}[-{key}-{value}]*]*

Each segment starts with an element type (circle, square, text, background, etc.), followed by any number of key-value pairs. The order of attributes doesn't matter—circle-color-blue-size-150 is the same as circle-size-150-color-blue.

Example:

/circle-color-blue-size-150
Example

Key Points:

  • First token in each segment is the element type
  • Remaining tokens are parsed as key-value pairs
  • Use / to separate multiple elements
  • Use - to separate attributes within an element
  • Order of attributes doesn't matter
  • Use short aliases (c, s, w, h, etc.) for cleaner URLs
  • Use | in text-value for line breaks
  • Use p suffix for relative positioning (e.g., x-50p) or decimals (x-0.5). For % in URLs, encode as %25.

✨ New Features:

  • Human-readable aliases: Use c instead of color, s instead of size
  • New shapes: ellipse, polygon, heart, diamond, hexagon, octagon, arrow
  • Groups & layouts: Use group-layout-row or scene-layout-grid for automatic arrangements
  • Shadows: Add shadow-medium or custom shadows
  • Rounded corners: Use br-20 for border radius
  • Multiline text: Use | in text-value for line breaks
  • Smart defaults: Objects auto-position if no coordinates specified

Shapes Reference

DrawByURL supports 14+ shapes including circles, squares, polygons, hearts, diamonds, and more. Each shape can be customized with colors, sizes, positions, strokes, rotations, shadows, and more. Shapes are drawn in the order they appear in the URL, with later shapes appearing on top. Use human-readable aliases like c for color,s for size, w for width, and h for height to make URLs shorter and more readable.

circle

Creates a perfect circle

Example:

/circle

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezshadow
circle

square

Creates a square shape

Example:

/square-c-blue-s-300

Supported Attributes:

colorsizewidthheightxystrokestroke-coloropacityrotatefillzradiusshadow
square

rectangle

Creates a rectangle with customizable width and height

Example:

/rectangle-c-green-w-500-h-250

Supported Attributes:

colorwidthheightxystrokestroke-coloropacityrotatefillzradiusshadow
rectangle

triangle

Creates a triangle shape

Example:

/triangle-c-purple-s-300

Supported Attributes:

colorsizewidthheightxystrokestroke-coloropacityrotatefillzshadow
triangle

star

Creates a star (default 5 points, customizable)

Example:

/star-c-yellow-s-300

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezpointsshadow
star

ellipse

Creates an ellipse (oval)

Example:

/ellipse-c-blue-w-500-h-250

Supported Attributes:

colorwidthheightxystrokestroke-coloropacityrotatefillzshadow
ellipse

polygon

Creates a polygon with customizable number of sides

Example:

/polygon-c-blue-s-250-pts-8

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezpointsshadow
polygon

heart

Creates a heart shape

Example:

/heart-c-red-s-250

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezshadow
heart

diamond

Creates a diamond shape

Example:

/diamond-c-green-w-250-h-200

Supported Attributes:

colorwidthheightxystrokestroke-coloropacityrotatefillzshadow
diamond

hexagon

Creates a hexagon (6-sided polygon)

Example:

/hexagon-c-blue-s-250

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezshadow
hexagon

octagon

Creates an octagon (8-sided polygon)

Example:

/octagon-c-purple-s-250

Supported Attributes:

colorsizexystrokestroke-coloropacityrotatezshadow
octagon

arrow

Creates an arrow shape

Example:

/arrow-c-blue-w-350-h-175

Supported Attributes:

colorwidthheightxystrokestroke-coloropacityrotatefillzshadow
arrow

line

Creates a horizontal line

Example:

/line-c-black-x-400-y-225-s-600-sw-15

Supported Attributes:

colorsizexystrokeopacityrotatez
line

photo

Creates a photo placeholder icon

Example:

/photo-c-blue-w-450-h-330

Supported Attributes:

colorwidthheightxystrokestroke-coloropacityz
photo

Text Elements

Add text overlays to your images using the text element. Text supports custom fonts, sizes, colors, positions, alignment, and weight. Always specify x and y coordinates for text positioning, as text doesndoesn'tapos;t have a default position like shapes do.

Basic Text

Simple text with default styling

/text-value-Hello-World
Basic Text

Text with Color

Colored text

/text-value-Hello-World-color-blue
Text with Color

Text with Size

Custom font size

/text-value-Hello-World-color-black-size-96
Text with Size

Text with Position

Positioned text

/text-value-Hello-World-color-white-x-400-y-225-size-72
Text with Position

Bold Text

Bold font weight

/text-value-Hello-World-color-black-size-80-weight-bold
Bold Text

Text Alignment

Left, center, or right aligned text

/text-value-Left-Aligned-color-black-x-200-y-225-size-64-align-left
Text Alignment

Important Notes:

  • Use hyphens (-) in text-value to represent spaces (e.g., Hello-World becomes "Hello World")
  • Always specify x and y coordinates for text positioning
  • Text size is in pixels and affects both width and height proportionally
  • Use weight-bold for bold text, or omit for normal weight
  • Alignment (align-left, align-center, align-right) affects text relative to the x position

Backgrounds

Set the canvas background using the background element. Backgrounds should be placed first in your URL, before any shapes or text. You can use solid colors or gradient presets. Backgrounds are drawn first, so all other elements appear on top of them.

Solid Color Background

Single color background

/background-color-blue/circle-color-white-size-150
Solid Color Background

Sunset Gradient

Beautiful sunset gradient preset

/background-gradient-sunset/text-value-Sunset-color-white-x-400-y-225-size-96
Sunset Gradient

Ocean Gradient

Ocean blue gradient preset

/background-gradient-ocean/text-value-Ocean-color-white-x-400-y-225-size-96
Ocean Gradient

Background Syntax:

  • background-color-COLOR - Solid color background
  • background-gradient-sunset - Sunset gradient preset
  • background-gradient-ocean - Ocean gradient preset

More gradient presets may be added in the future. Backgrounds are always drawn first, regardless of position in URL.

Attributes Reference

Complete reference of all attributes you can use to customize elements. Attributes are specified as key-value pairs separated by hyphens. The order of attributes doesndoesn'tapos;t matter.

Color & Styling

color

Set fill color (named colors or hex)

/circle-color-blue

Values: red, blue, green, yellow, orange, purple, pink, black, white, gray, #ff00aa, etc.

stroke

Stroke width in pixels

/circle-color-blue-stroke-4

Values: Number (e.g., 4, 8, 12)

stroke-color

Stroke color

/circle-color-blue-stroke-4-stroke-color-white

Values: Any color name or hex

fill

Fill style

/circle-outline

Values: solid, outline

opacity

Opacity level (0-1)

/circle-color-blue-opacity-0.5

Values: 0.0 to 1.0

Size & Dimensions

size

Uniform size for shapes

/circle-color-blue-size-150

Values: Number in pixels

width

Width in pixels

/rectangle-color-blue-width-200

Values: Number in pixels

height

Height in pixels

/rectangle-color-blue-height-100

Values: Number in pixels

Position

x

X position from left edge (or use percentage like x-50p or x-0.5)

/circle-c-blue-x-300

Values: Number in pixels, x-50p (50%), x-0.5 (decimal), or x-50% (URL-encode % as %25)

y

Y position from top edge (or use percentage like y-50p or y-0.5)

/circle-c-blue-y-200

Values: Number in pixels, y-50p (50%), y-0.5 (decimal), or y-50% (URL-encode % as %25)

z

Z-index for layering

/circle-c-blue-z-2

Values: Number (higher = on top)

anchor

Anchor point for positioning

/circle-c-blue-anchor-top-left

Values: center, top-left, top-right, bottom-left, bottom-right, top, bottom, left, right

Text Attributes

value

Text content (use hyphens or | for spaces, | for line breaks)

/text-value-Hello-World

Values: Any text (hyphens become spaces, | creates line breaks)

size / fontSize

Font size in pixels

/text-value-Hello-fs-96

Values: Number in pixels

font

Font family

/text-value-Hello-f-Arial

Values: Font name

weight

Font weight

/text-value-Hello-fw-bold

Values: normal, bold, light

align

Text alignment

/text-value-Hello-a-left

Values: left, center, right, top, bottom

Transformations

rotate / r

Rotation angle in degrees

/square-c-blue-r-45

Values: 0-360 degrees

opacity / o

Opacity level (0-1)

/circle-c-blue-o-0.5

Values: 0.0 to 1.0

Visual Effects

shadow

Drop shadow effect

/circle-c-blue-shadow-medium

Values: small, medium, large, or custom blur-offset-color

radius / br

Border radius for rectangles

/rectangle-c-blue-br-20

Values: Number in pixels

points / pts

Number of points for stars/polygons

/star-c-yellow-pts-6

Values: Number (e.g., 6 for 6-pointed star)

Groups & Layouts

group / scene

Group multiple elements together

/group-layout-row-g-20/circle-c-red/square-c-blue

Values: group or scene

layout

Layout arrangement for groups

/group-layout-row

Values: row, column, grid

gap / g

Gap between elements in layout

/group-layout-row-g-30

Values: Number in pixels

padding / p

Padding inside groups

/group-p-20

Values: Number in pixels

Human-Readable Aliases

bg

Alias for background

/bg-c-gray

Values: Same as background

c

Alias for color

/circle-c-blue

Values: Same as color

s

Alias for size

/circle-s-100

Values: Same as size

w

Alias for width

/rectangle-w-200

Values: Same as width

h

Alias for height

/rectangle-h-100

Values: Same as height

fs

Alias for fontSize

/text-fs-32

Values: Same as fontSize

fw

Alias for fontWeight

/text-fw-bold

Values: Same as weight

sw

Alias for strokeWidth

/circle-sw-4

Values: Same as stroke

sc

Alias for strokeColor

/circle-sc-white

Values: Same as stroke-color

o

Alias for opacity

/circle-o-0.5

Values: Same as opacity

r

Alias for rotate

/square-r-45

Values: Same as rotate

br

Alias for radius

/rectangle-br-15

Values: Same as radius

pts

Alias for points

/star-pts-6

Values: Same as points

Color Reference

DrawByURL supports named colors and hex color codes. Named colors are easier to read and remember, while hex codes give you precise control over colors. You can use either format in the color attribute.

red

#ff0000

blue

#0000ff

green

#008000

yellow

#ffff00

orange

#ffa500

purple

#800080

pink

#ffc0cb

black

#000000

white

#ffffff

gray/grey

#808080

cyan

#00ffff

magenta

#ff00ff

lime

#00ff00

navy

#000080

teal

#008080

sky

#87ceeb

forest

#228b22

coral

#ff7f50

Using Hex Colors:

You can use hex codes with or without the # symbol. Both formats work:

/circle-color-#ff00aa-size-150/circle-color-ff00aa-size-150

Hex colors are useful when you need exact color matching or want to use colors not in the named list.

Complex Examples

These examples demonstrate how to combine multiple elements to create more sophisticated designs. Notice how elements are separated by forward slashes, and how the order affects the final composition.

Multiple Shapes (Short Syntax)

Use aliases for cleaner URLs

/circle-c-blue-s-250-x-200-y-200/square-c-red-s-280-x-400-y-250/triangle-c-green-s-250-x-600-y-200
Multiple Shapes (Short Syntax)

Shape with Multiline Text

Add multiline text using | separator

/bg-c-navy/text-value-DrawByURL|Create Images|By Typing URLs-c-white-fs-72-a-center-x-400-y-200
Shape with Multiline Text

Grouped Layout

Use groups with automatic layouts

/group-layout-row-g-50-x-400-y-225/circle-c-white-s-180-shadow-medium/square-c-white-s-180-shadow-medium/triangle-c-white-s-180-shadow-medium
Grouped Layout

Rounded Rectangle with Shadow

Combine border radius and shadows

/rectangle-c-blue-w-500-h-250-br-30-shadow-large-x-400-y-225
Rounded Rectangle with Shadow

New Shapes Collection

Try heart, diamond, hexagon, and more

/heart-c-red-s-250-x-200-y-200/diamond-c-green-w-250-h-200-x-400-y-200/hexagon-c-blue-s-250-x-600-y-200
New Shapes Collection

Percentage Positioning

Use relative positioning with percentages

/circle-c-blue-s-250-x-50p-y-50p/square-c-red-s-200-x-25p-y-25p
Percentage Positioning

Custom Star Points

Create stars with custom point counts

/star-c-yellow-s-300-pts-6-x-300-y-225/star-c-gold-s-300-pts-8-x-500-y-225
Custom Star Points

Grid Layout Scene

Arrange multiple shapes in a grid

/scene-layout-grid-w-700-h-500-x-400-y-225/circle-c-red-s-150/square-c-blue-s-150/triangle-c-green-s-150/heart-c-pink-s-150
Grid Layout Scene

Query Parameters

Query parameters control the canvas dimensions and output format. They're added to the end of your URL after a question mark (?). Multiple parameters are separated by ampersands (&). These parameters don't affect the visual design, only the canvas size and file format.

width

Canvas width in pixels

?width=1200
Default: 800
height

Canvas height in pixels

?height=600
Default: 450
format

Image format

?format=jpeg
Values: png (default), jpeg, webp
quality

Image quality (for JPEG/WebP)

?quality=90
Values: 1-100, default: 90

Example with Multiple Parameters:

/circle-color-blue-size-150?width=1200&height=800&format=jpeg&quality=95

This creates a blue circle on a 1200x800 pixel canvas, exported as a JPEG with 95% quality. The default canvas size is 800x450 pixels, and the default format is PNG.

Best Practices

Follow these guidelines to create better images and avoid common mistakes. These practices help ensure your URLs are readable, maintainable, and produce the expected results.

1. Element Order Matters

Elements are drawn in the order they appear in the URL. Draw backgrounds first, then shapes, then text. Later elements appear on top of earlier ones.

/background-color-blue/circle-color-white/text-value-Hello

2. Use Z-Index for Complex Layering

When you need precise control over which elements appear on top, use the z attribute. Higher z values appear on top. Without z-index, elements are drawn in URL order.

/circle-color-blue-z-1/square-color-red-z-2

3. Always Position Text Explicitly

Text doesndoesn'tapos;t have a default position like shapes do. Always specify x and y coordinates for text to ensure it appears where you want it.

/text-value-Hello-x-400-y-225-size-96

4. Set Canvas Size for Your Use Case

Use query parameters to set the exact canvas size you need. Default is 800x450, but you might need 1200x630 for OpenGraph images, 1080x1080 for Instagram, etc.

/circle-color-blue?width=1080&height=1080

5. Use Hyphens for Spaces in Text

Replace spaces in text-value with hyphens. They'll be automatically converted to spaces in the rendered text.

/text-value-Hello-World → "Hello World"

6. Keep URLs Readable

While attribute order doesndoesn'tapos;t matter, keeping a consistent order (type, color, size, position, etc.) makes URLs easier to read and debug.

/circle-color-blue-size-150-x-400-y-225

DrawByURL Documentation

Syntax may evolve as new features are added. Check back for updates.