All Products
Search
Document Center

PolarDB:ST_ScaleImage

Last Updated:Mar 28, 2026

Scales images in a scene object to reduce storage size and resolution.

Syntax

scene  ST_ScaleImage(scene sc, cstring name, float8 scale);

Parameters

ParameterTypeDescription
scsceneThe scene object.
namecstringThe name of the image to scale. To scale all images in the scene object, pass a pair of single quotation marks ('').
scalefloat8The scale factor. Valid values: (0, 1).

Description

ST_ScaleImage reduces the size of one or all images in a scene object. A lower scale value produces a smaller file with lower resolution.

Passing '' as the name parameter scales all images in the scene object. To scale a single image, specify its exact name.

The images below show the effect of different scale values:

  • Original image with scale of 1.0Original image

  • Image after scale-down with scale of 0.125Image after scale-down

Examples

Scale all images in the scene column to 10% of their original size:

SELECT ST_AsText(ST_ScaleImage(scene, '', 0.1)) from t;

Output:

{"type" : "gltf", "content" : {"accessors":[{"bufferView":0,......