Resize an image

Scale an image by a factor, or fill an exact box. Use 'scale' for uniform scaling, or 'scale_x'/'scale_y' for independent axes (float factors, e.g. 0.5 = half size). Alternatively set 'width'+'height' for fill mode: resize and smart-crop to those exact dimensions in one call (optional 'gravity', default attention). The two modes are mutually exclusive. Optional enhancement modifiers: denoise (1-3), equalize, sharpen (applied denoise -> equalize -> op -> sharpen).

post/v1/resize

Request

  • Base URL: https://api.pictomancer.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.pictomancer.ai/v1/resize
  • Auth: none declared

Request body

sourcestring required

Image source: a public URL (https://...) or a base64-encoded string (optionally as a data URI like data:image/png;base64,...).

scale_xnumber nullable

Horizontal scale factor (e.g. 0.5 = half width). If only scale_x is given, scale_y defaults to the same value.

scale_ynumber nullable

Vertical scale factor (e.g. 0.75 = 75% height). Optional; defaults to scale_x if omitted.

scalenumber nullable

Uniform scale factor applied to both axes (e.g. 0.5 = half size). Use this for simple scaling; use scale_x/scale_y for independent axes.

formatstring nullable

Output format: jpeg, png, webp, tiff, gif, or avif. If omitted, the original format is preserved.

widthinteger nullable

Target width in pixels for fill mode: resize and smart-crop to these exact dimensions in one call. Requires height. Mutually exclusive with scale/scale_x/scale_y. Upscaling is allowed.

heightinteger nullable

Target height in pixels for fill mode. Requires width.

gravitystring nullable

Fill-mode smart-crop strategy: one of ('attention', 'entropy', 'centre'). Only valid together with width and height; defaults to attention.

autorotboolean nullable

Apply EXIF orientation before resizing. Opt-in; default false, which preserves current byte-for-byte behavior.

denoiseinteger nullable

Median denoise before resizing: radius 1-3 (window 3x3 to 7x7). Opt-in; no surcharge.

equalizeboolean nullable

Auto-contrast (histogram equalisation of the value channel; hue and saturation preserved) before resizing. Opt-in.

sharpenboolean nullable

Unsharp-mask sharpen after resizing (libvips defaults). Opt-in.

Response

Processed image binary

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.