Skip to content

Processing images

Depicta provides 21 server-side image processing operations. Each takes an input image and returns a processed result via signed URL.

Generative AI models are powerful at creating images, but they are not a replacement for traditional image processing. An AI model can generate a stunning product photo, but it can’t reliably crop it to exact pixel dimensions, convert it to WebP for your website, or strip unwanted metadata (with legal limits). Processing operations handle the precise, deterministic work that AI generation was never designed for.

Your AI assistant can chain generation and processing together — generate an image, remove the background, resize it to the exact dimensions needed, and convert to the right format — all in one workflow.

API pattern: POST /v1/process/{operation} with a JSON body containing input_image_url (an HTTPS URL) plus the operation’s parameters. To process a local file, upload it first with POST /v1/upload (multipart, field image) and pass the returned URL. The CLI uploads local files for you.

Each operation costs 0.02, and vectorize 0.10, in credits (EUR, excluding VAT; VAT is added when you buy credits). Current prices are in GET /v1/pricing (processing_cost_eur and processing_operation_costs).

Every input image goes through the content check before it’s processed. If it’s refused, you get 451 content_rejected and nothing is charged. For overlay, both images are checked together, as the combined result.

Response: every operation returns the processed image’s signed URL:

{
"image_url": "https://media.depicta.ai/...",
"expires_at": "2026-10-15T10:04:30Z",
"operation": "resize",
"content_type": "image/png"
}

The image URL expires after 1 hour.

CLI pattern: depicta process {operation} <input> [options]


Adjust brightness, contrast, and saturation. Values range from -1 to 1; provide at least one.

Terminal window
depicta process adjust photo.png --brightness 0.2 --contrast 0.1 --saturation -0.15
Parameter Type Description
brightness number -1 to 1. Negative = darker, positive = brighter
contrast number -1 to 1. Negative = less contrast, positive = more
saturation number -1 to 1. Negative = desaturate, positive = saturate

Convert to grayscale.

Terminal window
depicta process grayscale photo.png

No additional parameters.

Invert pixel values (photographic negative effect).

Terminal window
depicta process invert photo.png

No additional parameters.


Extract a rectangular region.

Terminal window
depicta process crop photo.png --x 100 --y 50 --width 800 --height 600
Parameter Type Required Description
x integer yes Left offset in pixels
y integer yes Top offset in pixels
width integer yes Crop width
height integer yes Crop height

Resize to a width, a height, or both. Give one side and the other follows the original proportions.

Terminal window
depicta process resize photo.png --width 512
Parameter Type Description
width integer Target width (aspect ratio preserved if height omitted)
height integer Target height (aspect ratio preserved if width omitted)

Rotate by an arbitrary angle. Areas outside the original bounds are filled with the background color.

Terminal window
depicta process rotate photo.png --angle 45
Parameter Type Required Description
angle number yes Rotation angle in degrees, -360 to 360. Positive = counter-clockwise
expand boolean no Expand the canvas to fit the rotated image (default: true)
fill_color string no Hex color for exposed areas (default: #FFFFFF)

Mirror horizontally or vertically.

Terminal window
depicta process flip photo.png --direction horizontal
Parameter Type Required Description
direction string yes horizontal or vertical

Auto-trim uniform borders (e.g., white space around an image).

Terminal window
depicta process trim photo.png --tolerance 10
Parameter Type Description
tolerance integer Color distance threshold for border detection, 0–255 (default: 10)

Add padding to reach a target size. The image is centered on the canvas by default.

Terminal window
depicta process pad icon.png --width 512 --height 512
Parameter Type Required Description
width integer yes Target canvas width, 1–16384
height integer yes Target canvas height, 1–16384
color string no Hex color for the padding (default: #FFFFFF)
gravity string no Image placement: center (default), north, south, east, west, north-east, north-west, south-east, south-west

Remove the background, producing a transparent PNG.

Terminal window
depicta process remove-bg photo.png

No additional parameters. Output is always PNG (transparency).

Reduce chroma noise.

Terminal window
depicta process denoise photo.png --strength 10
Parameter Type Description
strength integer Chroma noise reduction strength, 1–40 (default: 10)

Apply unsharp mask sharpening.

Terminal window
depicta process sharpen photo.png --amount 1.5 --threshold 0
Parameter Type Description
amount number Sharpening strength, greater than 0 and up to 10 (default: 1.5)
threshold integer Edge detection threshold, 0–255 (default: 3)

Apply Gaussian blur.

Terminal window
depicta process blur photo.png --radius 5
Parameter Type Required Description
radius number yes Blur radius in pixels, greater than 0 and up to 100

Convert between image formats.

Terminal window
depicta process convert photo.png --format webp
depicta process convert photo.png -f jpeg --quality 85
Parameter Type Required Description
format string yes png, jpeg, or webp
quality integer no Encoding quality for jpeg and webp, 80 to 100 (default 93). Lower makes a smaller file. Not accepted for png (422)

--quality needs CLI 1.4.0 or later.

Reduce file size via color quantization without visible quality loss.

Terminal window
depicta process optimize screenshot.png
Parameter Type Description
colors integer Palette size, 2–256. Omit to let Depicta reduce colors automatically while keeping quality above min_psnr
min_psnr number Minimum quality in dB for automatic reduction (default: 38)

Convert a raster image into a scalable SVG by remapping pixels to a palette you supply and tracing each color region. Best for logos, icons, monograms, and flat illustrations — not photographs.

Terminal window
depicta process vectorize logo.png --color "#1d1d1d" --color "#df4a2a" --bg "#ffffff"

Or with the API:

Terminal window
curl -X POST https://api.depicta.ai/v1/process/vectorize \
-H "Authorization: Bearer dpct_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input_image_url": "https://media.depicta.ai/...", "colors": ["#1d1d1d", "#df4a2a"], "background_color": "#ffffff"}'
CLI flag API field Required Description
<input> input_image_url yes The PNG to vectorize: a file, URL or - for stdin (CLI); an HTTPS URL (API)
--color, -c (repeat) colors (array) yes Foreground hex colors #RRGGBB, 1–20, in order
--bg, -b background_color no Background hex color #RRGGBB, composited under transparent inputs
--no-clip clip: false no For transparent (RGBA) inputs, keep interior light fills (green-key) instead of the default clip-mask silhouettes

The vectorize command needs CLI 1.3.0 or later.

Output is image/svg+xml — the saved file gets a .svg extension. When Content Credentials signing is enabled, the SVG carries an embedded C2PA manifest that preserves provenance from the source image.

Strip EXIF and XMP metadata. C2PA Content Credentials are preserved — this operation only removes non-provenance metadata.

Terminal window
depicta process metadata-strip photo.jpg
Parameter Type Description
keep_icc boolean Preserve ICC color profile (default: true)

Composite one image on top of another.

Terminal window
depicta process overlay background.png --overlay logo.png --x 20 --y 20 --opacity 0.8
Parameter Type Required Description
overlay_image_url (API) / --overlay (CLI) URL / file yes Image to overlay
x integer yes Left offset in pixels
y integer yes Top offset in pixels
opacity number no 0.0–1.0 (default: 1.0)

Replace transparency with a solid color.

Terminal window
depicta process alpha-to-color icon.png --color "#FFFFFF"
Parameter Type Description
color string Hex color (default: #FFFFFF)

Make a specific color transparent.

Terminal window
depicta process color-to-alpha logo.png --color "#FFFFFF" --tolerance 30
Parameter Type Required Description
color string yes Hex color to make transparent (#RRGGBB)
tolerance integer no Color matching tolerance, 0–255 (default: 10)

Apply EXIF orientation metadata and strip the tag. Useful for photos from phones that appear rotated.

Terminal window
depicta process auto-orient photo.jpg

No additional parameters.