| Ocalt Query Language
Pricing Dashboard ocalt.com v1.0

IMAGE (Canvas)

Load, manipulate, composite, and export raster images. All operations execute on the GPU thread pool via the Ocalt image pipeline.

VerbDescription
IMAGE LOAD "/root/img.jpg" SET ?imgLoad from filesystem
IMAGE LOAD "https://..." SET ?imgLoad from URL
RESIZE ?img TO "WxH"Resize to exact dimensions
RESIZE ?img TO "W"Scale width, preserve aspect ratio
CROP ?img FROM "x,y" TO "w,h"Crop region
ROTATE ?img AS "90"Rotate: "90", "180", "270"
FLIP ?img AS "horizontal"Flip: "horizontal", "vertical"
WATERMARK ?img WITH "text"Add text watermark
WATERMARK ?img WITH ?logoComposite another image as watermark
THUMBNAIL ?img TO "WxH"Smart-crop thumbnail
FILTER ?img AS "greyscale"Filters: greyscale, sepia, blur, sharpen, invert
DRAW ?img WITH "x,y,r,g,b" AS "rect:w,h"Draw shape onto image
COMPOSITE ?img WITH ?overlay AT "x,y"Composite overlay image at position
HISTOGRAM ?img SET ?dataColour histogram as {r:[],g:[],b:[]}
EMIT ?img AS "png"Output as PNG (also: jpg, bmp)
WRITE ?img INTO "/root/out.jpg" AS "jpg"Save to filesystem

Load, resize, and save

IMAGE LOAD "https://httpbin.org/image/png" SET ?img AFTER RESIZE ?img TO "400x300" SET ?resized AFTER WRITE ?resized INTO "/root/files/thumb.png" AS "png" AFTER SHARE "/root/files/thumb.png" SET ?url AFTER EMIT ?url

Multiple operations

IMAGE LOAD "https://httpbin.org/image/jpeg" SET ?img AFTER RESIZE ?img TO "800" SET ?r AFTER FILTER ?r AS "greyscale" SET ?g AFTER WATERMARK ?g WITH "© Ocalt" SET ?w AFTER EMIT ?w AS "jpg"

Thumbnail for avatar

IMAGE LOAD ?uploaded_path SET ?img AFTER THUMBNAIL ?img TO "128x128" SET ?thumb AFTER WRITE ?thumb INTO "/root/avatars/" & ?user_id & ".jpg" AS "jpg" AFTER EMIT "Avatar saved"

Composite logo watermark

IMAGE LOAD ?background SET ?bg AND IMAGE LOAD "/root/assets/logo.png" SET ?logo AFTER COMPOSITE ?bg WITH ?logo AT "20,20" SET ?out AFTER WRITE ?out INTO "/root/branded.jpg" AS "jpg"