AutoHotkey Migration: CV, Pixels, And Images

Mapping AutoHotkey CoordMode, PixelGetColor, PixelSearch, and ImageSearch to EyeAuras CV APIs.

AutoHotkey Migration: CV, Pixels, And Images

Use this page for CoordMode, PixelGetColor, PixelSearch, and ImageSearch.

Quick Map

AutoHotkey NeedAHK APIsEyeAuras RouteFirst C# ShapeJudgmentNotes
Find pixels or imagesPixelGetColor, PixelSearch, ImageSearch, CoordModeIComputerVisionExperimentalScriptingApi, ICvAccessor, IOsdSelectionServiceCV.ForScreen().PixelSearch(Color.Red, new Percentage(90), region)More explicit than AHK, but heavier.ForScreen() and ForWindow(window) replace implicit AHK coordinate modes. The CV API is marked experimental.

Pixel Search Then Click

AutoHotkey v2:

ahk
CoordMode "Pixel", "Screen"
CoordMode "Mouse", "Screen"
if PixelSearch(&x, &y, 0, 0, 800, 600, 0xFF0000, 10)
    Click x, y

EyeAuras script:

csharp
IComputerVisionExperimentalScriptingApi CV { get; init; }
ISendInputScriptingApi SendInput { get; init; }

{
    using var screen = CV.ForScreen();
    var point = screen.PixelSearch(
        Color.FromArgb(255, 255, 0, 0),
        new Percentage(90),
        new Rectangle(0, 0, 800, 600));

    if (!point.IsEmpty)
    {
        SendInput.MouseLeftClick(point.X, point.Y);
    }
}

Run this in a C# Action with CV and Roxy available. A match produces one click through the default Windows Input simulator. The accessor is owned by this scope.

Percentage(90) is an EyeAuras threshold, not a conversion of AHK variation 10. AHK variation permits an absolute difference in each RGB channel; its coordinate default is the active window's client area until CoordMode changes it. The example explicitly sets both Pixel and Mouse to Screen.

PixelSearch uses Point.Empty for no match, so IsEmpty also skips a real match at (0, 0). When that point matters, use PixelSearchRaw and check nullable Detected.Bounds. Capture or trigger errors can throw.

For window-relative work, resolve an IWindowHandle and use CV.ForWindow(window). Do not pass its point directly to absolute desktop input: the simple result uses WorldToWindow, while screen search uses WorldToScreen. This does not promise Win32 client coordinates or equivalence to every AHK coordinate mode.

Recommendation: Good enough, but heavier than AHK. EyeAuras is clearer about screen vs window coordinates; migration still needs a dedicated CoordMode mapping table.