Dashboard Overview
Recent Transactions
Quick Start
curl -H "Authorization: Bearer YOUR_API_KEY" "https://dev.trimpng.com/transform/image.png?w=400"
Credits & Billing
Credit Packages
Transform Pricing
| Transform | Category | Credits |
|---|
API Keys
| Name | Key Prefix | Status | Last Used | Actions |
|---|---|---|---|---|
| No API keys yet | ||||
Usage Statistics
Usage by Transform (Last 30 Days)
Transaction History
| Date | Type | Description | Amount | Balance |
|---|---|---|---|---|
| No transactions | ||||
Team Members
| Name | Role | Status | Actions | |
|---|---|---|---|---|
| Loading... | ||||
All Companies
| Company | Status | Credits | Actions | |
|---|---|---|---|---|
| Loading... | ||||
Global Transform Pricing
| Transform | Category | GPU | Credits | Actions |
|---|---|---|---|---|
| Loading... | ||||
Credit Packages
| Name | Credits | Price | Featured | Actions |
|---|---|---|---|---|
| Loading... | ||||
Image Sources
How Sources Work
Sources connect your image storage (like DO Spaces or S3) to TrimPNG. Each source gets a unique subdomain URL for transforms.
Example: https://your-source.trimpng.com/image.png?w=400
| Name | URL | Status | Images | Storage | Bandwidth | Actions |
|---|---|---|---|---|---|---|
| No sources yet. Add one to get started. | ||||||
Source Gallery
System Settings
| Setting | Description | Value | Actions |
|---|---|---|---|
| Loading... | |||
Transform API Documentation
Quick Start
Transform images by adding parameters to your source URL:
https://your-source.trimpng.com/image.png?w=400&format=webp&q=80
Or test with any URL:
https://dev.trimpng.com/transform/url?url=https://example.com/photo.jpg&w=400
Resize & Crop
w
number
Width in pixels. Max 4096.
?w=400
h
number
Height in pixels. Max 4096.
?h=300
fit
string
How to fit image into dimensions.
Values: cover, contain, fill, inside, outside
?w=400&h=400&fit=cover
crop
string
Crop position when using fit=cover.
Values: center, top, bottom, left, right, attention, entropy
?w=400&h=400&fit=cover&crop=attention
dpr
number
Device pixel ratio multiplier (1-3). Multiplies w/h values.
?w=400&dpr=2 → outputs 800px
trim
boolean|number
Auto-crop transparent/whitespace borders. Number sets threshold (default 10).
?trim=true or ?trim=20
extract
string
Extract specific region: left,top,width,height
?extract=100,100,400,300
Format & Quality
format
string
Output format.
Values: webp, png, jpeg, avif, gif, tiff
?format=webp
q
number
Quality 1-100. Default 80.
?format=webp&q=90
auto
string
Auto-select best format based on browser support.
Values: format, compress
?auto=format
dpi
number
Set DPI metadata for print. 72-600.
?dpi=300
Basic Transforms
rotate
number
Rotate image.
Values: 0, 90, 180, 270
?rotate=90
flip
boolean
Flip vertically (top to bottom).
?flip=true
flop
boolean
Flop horizontally (left to right / mirror).
?flop=true
Color Adjustments
brightness
number
Brightness multiplier. 0-3, default 1.
?brightness=1.2
contrast
number
Contrast multiplier. 0-3, default 1.
?contrast=1.3
saturation
number
Saturation multiplier. 0-3, default 1. Use 0 for grayscale.
?saturation=1.5
hue
number
Hue rotation in degrees. 0-360.
?hue=180
gamma
number
Gamma correction. 1-3.
?gamma=2.2
grayscale
boolean
Convert to grayscale.
?grayscale=true
sepia
boolean
Apply sepia tone effect.
?sepia=true
tint
string
Tint with color. Hex or RGB.
?tint=ff6600 or ?tint=255,102,0
negate
boolean
Invert colors (negative).
?negate=true
normalize
boolean
Stretch contrast to full range (auto-levels).
?normalize=true
Effects
blur
number
Gaussian blur sigma. 0.3-1000.
?blur=5
sharpen
number|boolean
Sharpen image. 0.5-10 or true for default.
?sharpen=2
median
number
Median filter for noise reduction. 1-10.
?median=3
threshold
number
Convert to black/white at threshold. 0-255.
?threshold=128
posterize
number
Reduce color levels per channel. 2-256.
?posterize=4
colors
number
Reduce to N colors using color quantization. 2-256.
?colors=16
DTF / Print Processing
halftone
number
DTF halftone effect. LPI (lines per inch) 15-100. Standard is 45.
Only affects semi-transparent pixels. Solid areas stay solid.
?halftone=45
halftone_shape
string
Halftone dot shape.
Values: round, ellipse, line, square, diamond
?halftone=45&halftone_shape=round
halftone_angle
number
Screen angle in degrees. Default 22.5° (standard for screen printing).
?halftone=45&halftone_angle=22.5
alpha_threshold
number
Clean up semi-transparent pixels. 0-255. Pixels below become transparent.
?alpha_threshold=128
Watermark
watermark
string
Text watermark to overlay.
?watermark=Copyright%202024
watermark_logo
string
Storage key for logo image to use as watermark.
?watermark_logo=logos/company.png
watermark_opacity
number
Watermark opacity. 0-1, default 0.3.
?watermark=Text&watermark_opacity=0.5
watermark_tile
boolean
Tile watermark diagonally across image.
?watermark=SAMPLE&watermark_tile=true
watermark_angle
number
Rotation angle in degrees. Default -30.
?watermark=Text&watermark_angle=-45
watermark_scale
number
Logo scale percentage. Default 100.
?watermark_logo=logo.png&watermark_scale=50
Borders & Composition
border
string
Add border. Format: width,color
?border=10,ff0000
rounded
number
Round corners radius in pixels.
?rounded=20
pad
string
Add padding. Format: size or top,right,bottom,left
?pad=20 or ?pad=10,20,10,20
extend
string
Extend canvas. Format: top,right,bottom,left,color
?extend=10,10,10,10,ffffff
AI / ML Transforms
These transforms use GPU acceleration and may take longer to process.
bg
string
Background removal/replacement.
Values: remove, white, blur, transparent
?bg=remove
upscale
number
AI upscale image.
Values: 2, 4, 8
?upscale=4
enhance
boolean
AI image enhancement (auto color/contrast/sharpness).
?enhance=true
face_restore
boolean
AI face restoration for old/damaged photos.
?face_restore=true
colorize
boolean
AI colorization for black & white photos.
?colorize=true
style
string
AI style transfer.
Values: anime, cartoon, sketch, oil, watercolor, pencil, pop_art
?style=anime
tag
boolean
AI auto-tagging using RAM model. Returns tags in response metadata.
?tag=true
denoise
string
AI noise reduction.
Values: light, medium, heavy
?denoise=medium
deblur
boolean
AI motion/blur removal.
?deblur=true
jpg_artifact
boolean
Remove JPEG compression artifacts.
?jpg_artifact=true
hdr
boolean
AI HDR effect enhancement.
?hdr=true
lowlight
boolean
AI low-light image enhancement.
?lowlight=true
depth
boolean
Generate depth map from image.
?depth=true
segment
boolean
AI image segmentation.
?segment=true
age
string|number
AI face age transformation.
Values: young, old, or number 1-100
?age=young or ?age=25
inpaint
string
AI inpainting - fill masked areas. Requires mask image.
?inpaint=mask_key.png
Response Handling
Different transforms return different response types.
Synchronous (Simple Transforms)
Resize, format, quality, halftone, etc. return immediately with a 302 redirect to the image.
HTTP/1.1 302 Found Location: https://nyc3.digitaloceanspaces.com/trim-png/transformed/...
Asynchronous (AI/ML Transforms)
Background removal, upscale, enhance, etc. return 202 Accepted with a job ID:
{
"status": "QUEUED",
"jobId": "db5ed95b-7403-47e7-9627-928dc976a567",
"pollUrl": "/api/status/db5ed95b-7403-47e7-9627-928dc976a567",
"estimatedTime": 5000
}
Polling for Status
Poll GET /api/status/{jobId} until complete:
Completed Response
{
"jobId": "db5ed95b-7403-47e7-9627-928dc976a567",
"status": "COMPLETED",
"type": "REMOVE_BG",
"completedAt": "2025-12-17T06:31:58.000Z",
"result": {
"url": "https://..../transformed/abc123.png",
"mimeType": "image/png",
"width": 800,
"height": 600
}
}
JavaScript Polling Example
async function waitForTransform(jobId) {
const pollUrl = `https://trimpng.com/api/status/${jobId}`;
for (let i = 0; i < 30; i++) {
const res = await fetch(pollUrl);
const data = await res.json();
if (data.status === 'COMPLETED') {
return data.result.url;
}
if (data.status === 'FAILED') {
throw new Error(data.error?.message);
}
await new Promise(r => setTimeout(r, 2000));
}
throw new Error('Timeout');
}