Qu

image.autocrop

Builtin index

What it is

No chapter describes this one yet. It exists -- the name comes from the interpreter's own table -- but the prose has not been written. That is a gap in the documentation, not in the engine.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
no inputnot documented yet—

Examples

No documentation example calls this form yet.

How it works

autocrop(img, [tolerance=10]) -- background is read from the four corner pixels (majority color among them, so a single stray corner artifact doesn't define "background"); the crop box is the tightest rectangle containing every pixel whose per-channel distance from that color exceeds tolerance. An all-background image (nothing exceeds tolerance) returns the image unchanged rather than an empty/zero-size crop -- "nothing to trim" is not an error.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.