Skip to main content
Vane Data / Reference

resize

resize scales an IMAGE with bilinear sampling and premultiplied alpha. A known mode with constant target dimensions yields a fixed-shape image; per-row dimensions keep a dynamic image with the input mode constraint.

Signature

example.py
vane.resize(image, w, h, *, antialias=False) -> Expression

SQL: resize(image, w, h [, antialias]). Expression method: expr.resize(w, h, antialias=...).

Parameters

NameTypeDescriptionDefault
imageIMAGE value or ExpressionInput imageRequired
w / hPositive integer, Expression, or NoneTarget width and height; NULL produces NULLRequired
antialiasbool or ExpressionWiden the triangle filter during downsampling when TrueFalse

Returns and errors

Returns an IMAGE. NULL image or dimensions return NULL. Non-positive dimensions and out-of-range values raise.

Example

example.py
import vane


con = vane.connect()
con.sql("SELECT resize(decode_image_file(image_file('photo.png')), 224, 224)").show()