ops
Interfaces
| Interface | Description |
|---|---|
| FontOptions | What font sets; give at least one. |
| OverlayOptions | Options for overlay. Params are positional and ordered. |
Type Aliases
| Type Alias | Description |
|---|---|
| AlignKeyword | One of the ALIGN_KEYWORDS alignment keywords. |
| Alignment | Position: an alignment keyword, or explicit offsets (px or percent). |
| BlurRegionOptions | Options for blurRegion: a rectangle, or all detected faces. |
| CropTag | Object tags recognized by cropByTag. |
| FilterName | One of the FILTER_NAMES presets. |
| FontFamily | One of the FONT_FAMILIES values. |
| FontStyle | One of the FONT_STYLES values. |
| FontWeight | One of the FONT_WEIGHTS values. |
| Format | One of the FORMATS values. |
| OverlaySource | Overlay source: another file's UUID, or 'self' for the image itself. The & {} keeps 'self' in autocomplete without collapsing to string. |
| Quality | One of the QUALITIES presets. |
| Radii | One or more (1–4) radius values in pixels or percent. |
| RelativePoint | A point given as an alignment keyword, offsets object or [x, y] pair. |
| ScaleCropType | One of the SCALE_CROP_TYPES smart detection types. |
| SizeValue | A dimension value: pixels as a number, or a percentage as '50p' / '50%'. |
| SrgbMode | One of the SRGB_MODES values. |
| StretchMode | One of the STRETCH_MODES values. |
| StripMetaMode | One of the STRIP_META_MODES values. |
| TextBoxMode | One of the TEXT_BOX_MODES values. |
| TextHAlign | Horizontal alignment for textAlign. |
| TextVAlign | Vertical alignment for textAlign. |
Variables
| Variable | Description |
|---|---|
| ALIGN_KEYWORDS | Alignment keywords accepted wherever an Alignment is expected. |
| autorotate | EXIF-based automatic rotation on/off (CDN default on). |
| blur | Gaussian blur; strength 0..5000 (CDN default 10), amount -200..100 (negative values sharpen via an unsharp mask). |
| blurRegion | Blurs a rectangular region, or every detected face. Repeatable. |
| borderRadius | CSS-like border radius; 1–4 radii in pixels or percent ('50p'), with an optional second set of vertical radii. |
| brightness | Brightness adjustment, -100..100 (neutral 0). |
| contrast | Contrast adjustment, -100..500 (neutral 0). |
| crop | Crops to the given size at an offset (CDN default 0,0). Dimensions accept percent values ('50p'); pixel offsets may be negative. |
| cropByRatio | Crops to an aspect ratio, e.g. '16:9' (CDN default alignment center). |
| cropByTag | Object-aware crop around detected faces or the main image content. Size is relative to the detected object (percent values). |
| enhance | Automatic photo enhancement; strength 0..100 (CDN default 50). |
| exposure | Exposure adjustment, -500..500 (neutral 0). |
| filter | Named photo filter; amount -100..200 (CDN default 100). |
| FILTER_NAMES | Named photo filter presets accepted by filter. |
| flip | Flips the image vertically. |
| font | Font state for the following text operation. Only the parts you give are written, in the order the CDN requires. |
| FONT_FAMILIES | Families accepted by font. |
| FONT_STYLES | Styles accepted by font. |
| FONT_WEIGHTS | Weights accepted by font. |
| format | Output format. auto negotiates modern formats (WebP/AVIF) with the client; jpeg also raises the output dimension ceiling to 5000px. |
| FORMATS | Output formats accepted by format. |
| gamma | Gamma adjustment, 0..1000 (neutral 100). |
| grayscale | Desaturates the image. |
| inline | Content-Disposition override: show in the browser vs download. |
| invert | Inverts the image colors. |
| json | Returns file/image info as JSON instead of the image itself. |
| jsonp | Returns file/image info as JSONP (uploadcare_callback). |
| mainColors | Returns the dominant colors as JSON; must be the last operation. |
| maxIccSize | ICC profile size threshold in KB for the srgb/icc mode (CDN default 10). |
| mirror | Mirrors the image horizontally. |
| overlay | Overlays another file (by uuid) or the image itself ('self'). Repeatable — overlays stack in chain order. Because the CDN params are positional, position requires size and opacity requires position. |
| preview | Downscales an image proportionally to fit the given dimensions (2048x2048 when omitted). With no arguments it acts as the minimal "process this image" core operation. |
| progressive | Progressive JPEG delivery (CDN default off). |
| QUALITIES | Quality presets accepted by quality. |
| quality | Compression quality preset; smart/smart_retina are content-aware. |
| rasterize | Rasterizes an SVG so the full set of raster operations applies. |
| rect | Draws a solid color rectangle. Repeatable. |
| resize | Resizes to exact dimensions; one side may be omitted to preserve the aspect ratio. Providing both sides may distort the image. |
| rotate | Counterclockwise rotation; the angle must be a multiple of 90. |
| saturation | Saturation adjustment, -100..500 (neutral 0). |
| SCALE_CROP_TYPES | Smart scaleCrop detection types (applied as a fallback chain). |
| scaleCrop | Scales down and crops to exactly WxH (cover). Smart types use content detection; the explicit alignment is then only a fallback. |
| setfill | Background fill color used by crop-outside-of-image, stretch/fill and alpha-channel flattening into JPEG. |
| sharp | Sharpens the image; strength 0..20 (CDN default 5). |
| smartResize | Content-aware resize that generates missing parts. Both dimensions required. |
| srgb | Color profile conversion to sRGB. |
| SRGB_MODES | Allowed srgb conversion modes. |
| stretch | Upscale behavior for the following resize/scale_crop operation — ordering matters, and the pair may repeat. |
| STRETCH_MODES | Allowed stretch modes. |
| STRIP_META_MODES | Allowed stripMeta modes. |
| stripMeta | Controls which meta information survives in the output (CDN default all). |
| text | Text overlay (disabled by default; enabled per project). The string is escaped per the documented ~s/~n/~~ rules and percent-encoded. |
| TEXT_BOX_MODES | Allowed textBox modes. |
| textAlign | Alignment state for the following text operation (CDN default center/center). |
| textBox | Background box state for the following text operation. The parts are positional, so a padding needs a color before it, and a border radius writes a zero padding when none is given. |
| trim | Crops away a solid background or fully transparent edges. tolerance (0..99) widens the colors treated as background; padding keeps a margin, as a percentage of the result ('10p', 0–100%). The CDN documents no default tolerance, so a padding needs one before it. |
| vibrance | Vibrance adjustment, -100..500 (neutral 0). |
| warmth | Warmth adjustment, -100..100 (neutral 0). |
| zoomObjects | Zooms in on detected objects (1..100). Works on images with a solid or uniform background only. |
Functions
| Function | Description |
|---|---|
| rawOp | Escape hatch: builds an arbitrary operation without any validation. Useful for internal directives (@clib, @finfo) and operations the library does not know about yet. |