Skip to content

ops ​

Interfaces ​

InterfaceDescription
FontOptionsWhat font sets; give at least one.
OverlayOptionsOptions for overlay. Params are positional and ordered.

Type Aliases ​

Type AliasDescription
AlignKeywordOne of the ALIGN_KEYWORDS alignment keywords.
AlignmentPosition: an alignment keyword, or explicit offsets (px or percent).
BlurRegionOptionsOptions for blurRegion: a rectangle, or all detected faces.
CropTagObject tags recognized by cropByTag.
FilterNameOne of the FILTER_NAMES presets.
FontFamilyOne of the FONT_FAMILIES values.
FontStyleOne of the FONT_STYLES values.
FontWeightOne of the FONT_WEIGHTS values.
FormatOne of the FORMATS values.
OverlaySourceOverlay source: another file's UUID, or 'self' for the image itself. The & {} keeps 'self' in autocomplete without collapsing to string.
QualityOne of the QUALITIES presets.
RadiiOne or more (1–4) radius values in pixels or percent.
RelativePointA point given as an alignment keyword, offsets object or [x, y] pair.
ScaleCropTypeOne of the SCALE_CROP_TYPES smart detection types.
SizeValueA dimension value: pixels as a number, or a percentage as '50p' / '50%'.
SrgbModeOne of the SRGB_MODES values.
StretchModeOne of the STRETCH_MODES values.
StripMetaModeOne of the STRIP_META_MODES values.
TextBoxModeOne of the TEXT_BOX_MODES values.
TextHAlignHorizontal alignment for textAlign.
TextVAlignVertical alignment for textAlign.

Variables ​

VariableDescription
ALIGN_KEYWORDSAlignment keywords accepted wherever an Alignment is expected.
autorotateEXIF-based automatic rotation on/off (CDN default on).
blurGaussian blur; strength 0..5000 (CDN default 10), amount -200..100 (negative values sharpen via an unsharp mask).
blurRegionBlurs a rectangular region, or every detected face. Repeatable.
borderRadiusCSS-like border radius; 1–4 radii in pixels or percent ('50p'), with an optional second set of vertical radii.
brightnessBrightness adjustment, -100..100 (neutral 0).
contrastContrast adjustment, -100..500 (neutral 0).
cropCrops to the given size at an offset (CDN default 0,0). Dimensions accept percent values ('50p'); pixel offsets may be negative.
cropByRatioCrops to an aspect ratio, e.g. '16:9' (CDN default alignment center).
cropByTagObject-aware crop around detected faces or the main image content. Size is relative to the detected object (percent values).
enhanceAutomatic photo enhancement; strength 0..100 (CDN default 50).
exposureExposure adjustment, -500..500 (neutral 0).
filterNamed photo filter; amount -100..200 (CDN default 100).
FILTER_NAMESNamed photo filter presets accepted by filter.
flipFlips the image vertically.
fontFont state for the following text operation. Only the parts you give are written, in the order the CDN requires.
FONT_FAMILIESFamilies accepted by font.
FONT_STYLESStyles accepted by font.
FONT_WEIGHTSWeights accepted by font.
formatOutput format. auto negotiates modern formats (WebP/AVIF) with the client; jpeg also raises the output dimension ceiling to 5000px.
FORMATSOutput formats accepted by format.
gammaGamma adjustment, 0..1000 (neutral 100).
grayscaleDesaturates the image.
inlineContent-Disposition override: show in the browser vs download.
invertInverts the image colors.
jsonReturns file/image info as JSON instead of the image itself.
jsonpReturns file/image info as JSONP (uploadcare_callback).
mainColorsReturns the dominant colors as JSON; must be the last operation.
maxIccSizeICC profile size threshold in KB for the srgb/icc mode (CDN default 10).
mirrorMirrors the image horizontally.
overlayOverlays 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.
previewDownscales an image proportionally to fit the given dimensions (2048x2048 when omitted). With no arguments it acts as the minimal "process this image" core operation.
progressiveProgressive JPEG delivery (CDN default off).
QUALITIESQuality presets accepted by quality.
qualityCompression quality preset; smart/smart_retina are content-aware.
rasterizeRasterizes an SVG so the full set of raster operations applies.
rectDraws a solid color rectangle. Repeatable.
resizeResizes to exact dimensions; one side may be omitted to preserve the aspect ratio. Providing both sides may distort the image.
rotateCounterclockwise rotation; the angle must be a multiple of 90.
saturationSaturation adjustment, -100..500 (neutral 0).
SCALE_CROP_TYPESSmart scaleCrop detection types (applied as a fallback chain).
scaleCropScales down and crops to exactly WxH (cover). Smart types use content detection; the explicit alignment is then only a fallback.
setfillBackground fill color used by crop-outside-of-image, stretch/fill and alpha-channel flattening into JPEG.
sharpSharpens the image; strength 0..20 (CDN default 5).
smartResizeContent-aware resize that generates missing parts. Both dimensions required.
srgbColor profile conversion to sRGB.
SRGB_MODESAllowed srgb conversion modes.
stretchUpscale behavior for the following resize/scale_crop operation — ordering matters, and the pair may repeat.
STRETCH_MODESAllowed stretch modes.
STRIP_META_MODESAllowed stripMeta modes.
stripMetaControls which meta information survives in the output (CDN default all).
textText overlay (disabled by default; enabled per project). The string is escaped per the documented ~s/~n/~~ rules and percent-encoded.
TEXT_BOX_MODESAllowed textBox modes.
textAlignAlignment state for the following text operation (CDN default center/center).
textBoxBackground 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.
trimCrops 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.
vibranceVibrance adjustment, -100..500 (neutral 0).
warmthWarmth adjustment, -100..100 (neutral 0).
zoomObjectsZooms in on detected objects (1..100). Works on images with a solid or uniform background only.

Functions ​

FunctionDescription
rawOpEscape hatch: builds an arbitrary operation without any validation. Useful for internal directives (@clib, @finfo) and operations the library does not know about yet.