PowerKeys Scripting API
    Preparing search index...

    Interface ImageSearchOptions

    Optional search tuning for Screen.FindImage / Screen.FindImageBase64. Every field is optional; the defaults are the fast exact-pose, color-verified search. Unknown fields are rejected.

    interface ImageSearchOptions {
        sizeTolerance?: number;
        rotationTolerance?: number;
        matchColor?: boolean;
    }
    Index
    sizeTolerance?: number

    Fractional on-screen size difference tolerated in each direction; 0.1 accepts a target rendered up to 10% larger or smaller than the template. Defaults to 0 (exact size). Reach for it only when the target renders at a different scale from the capture, which is what notOnScreen on an element you can plainly see means. It is the most expensive setting here: the pose sweep measured 203ms of a 258ms tolerant whole-screen scan, so pair it with a region when polling. It also cannot reach a display-scaling mismatch of 150%, the Windows default on a 4K panel, because it stops at 0.25; recapture at the target scale instead.

    rotationTolerance?: number

    Rotation tolerated in each direction, in degrees. Defaults to 0 (unrotated). Small tilts such as an animating button are the intended range; beyond 15 degrees the search would need a rotation-invariant method and the value is rejected. Priced like sizeTolerance: both widen the same pose sweep, which measured 203ms of a 258ms tolerant whole-screen scan, so confirm it earned its cost by comparing elapsedMs and score against the exact-pose run.

    matchColor?: boolean

    When true (default), the winning position must also match in color and absolute brightness: mild brightness/contrast grading still passes, while a same-shape element in a different hue or a much darker/brighter lookalike is rejected. Set false to compare purely on grayscale structure. This is not free, and it is not a setting to ship: it is what admitted every false positive measured on the corpus, three of twelve pairs at 0.81 through 0.84, and most of a sparse crop's safety margin comes from it. The intended use is confirming a colorMismatch diagnosis. If a target genuinely recolors with state, prefer cropping the part that does NOT recolor.