blogs by ramaa.

Images and coordinates

Chapter 4 of 6 · October 2026

A screenshot point and an input point can describe different places with the same numbers. Resizing, cropping, display scaling, and monitor placement change that relationship, which an executor needs before clicking.

A coordinate space defines an origin, an axis direction, and a unit. The origin is where both coordinates are zero, the upper left corner in our images, with horizontal values increasing rightward and vertical downward.

We follow a Save button through several spaces, then examine how the model finds it. The examples reuse the fictional BB-042 note from Chapter 3; its dimensions and calculations illustrate the method rather than measured accuracy.

The same page drawn at half size and full size. A point at 640,400 maps to 1280,800. A wrong unscaled point visibly misses the button. Rulers show the two coordinate systems.What the model sees1280 × 800 pixelsSave× 2SaveUnscaled click missesReal display / 2560 × 1600 pixels(640, 400)Point in the sent picture(1280, 800) / Point on the real display
A point in a smaller screenshot must map to the matching point on the full display.

Convert the point from the sent image

Figure 4.1 draws the capture and the smaller sent image at one scale. Switch display sizes, then turn conversion off. The 4K preset uses an illustrative local resize choice, not a provider's dimensions.

RealSenthit
Display

Figure 4.1. Converting the model point places the input on the intended control. Synthetic example.

The unconverted click lands near the target's upper left. It reuses a small-image point from the larger capture. Turning conversion on restores the intended location while the model's point stays the same.

We must name three spaces before the arithmetic. Capture space holds the original screenshot's pixels, sent-image space the pixels actually submitted, and input space the positions the pointer tool accepts.

These spaces sometimes match. A 1280 × 800 capture sent unchanged to a pixel-based input tool needs no conversion. They differ when the application shrinks the capture before sending, and display scaling adds another between capture and input space.

Start with a 2560 × 1600 capture reduced to 1280 × 800. The width ratio is 2560 / 1280 = 2. The height ratio is 1600 / 800 = 2. A model point (412, 230) therefore becomes capture point (824, 460).

Now compare a 1920 × 1080 capture reduced to 1280 × 720. Both ratios are 1.5, so the same model point becomes (618, 345). Reusing the multiplier of two would overshoot by 206 horizontal and 115 vertical pixels.

The rule depends on this observation's dimensions, not the monitor's resolution or a remembered preset. Store the capture and sent dimensions together, and never reconstruct them from a later screenshot.

A transform maps a point between spaces. For a plain resize, multiply each sent coordinate by its capture-to-sent ratio. Horizontal input uses the width ratio, vertical the height ratio.

Use separate ratios even when they usually match. The 3840 × 2160 preset sends 1430 × 804 pixels. Its horizontal ratio is about 2.6853, its vertical about 2.6866. Integer dimensions create this difference without a deliberate stretch.

A large target may tolerate that difference; a narrow control near the screen bottom may not. Keeping the real ratios costs little and removes an assumption, and a stretched image needs separate ratios too, though it may distort the controls the model sees.

One more question precedes these. Some tools expect normalized coordinates, fractions of an image rather than pixel positions. Read the tool contract and define its unit. Do not apply a pixel formula to an unrelated convention.

The interactive example assumes top-left origins, pixel coordinates, and a resize with no crop or border. Those assumptions keep the arithmetic short. Real preparation can add margins or crop the capture, and we must undo those changes in order.

Undo padding and cropping

Two preparation steps, two different undosPadding shifts the origin. A resize changes the scale.A · Letterbox: remove the padding first(400, 400)(400, 100)175 px padding175 px paddingsent · 800 × 800content 800 × 450remove the 175 pxof top padding(400, 225)content spacepadding gone, size halvedundo the0.5 resizeSave(800, 450)hitcapture · 1600 × 900the point the input needsmodel (400, 400) − (0, 175) → content (400, 225) → × 2 → capture (800, 450)model (400, 100) sits in the padding. It has no capture point, so reject it.B · Crop: add the origin last(600, 300)capture · crop origin (600, 300) · crop 800 × 400the crop rectangle on the original imagesend the cropat 2×(400, 200)sent crop · 1600 × 800model point in crop space÷ 2, thenadd the originCapture pointcrop (200, 100)+ origin (600, 300)= capture (800, 400)skip the origin and theinput clicks (200, 100)model (400, 200) ÷ 2 → crop (200, 100) + origin (600, 300) → capture (800, 400)Each step reverses one preparation operationRemove the padding, reverse the resize, then add the crop origin. Their order is easier to checkthan one unexplained multiplier.
Figure 4.2. Letterbox and crop preparation, each undone in the order it was applied. Synthetic example.

Letterboxing adds margins so an image fits a different shape without stretching. Suppose a 1600 × 900 capture fits inside an 800 × 800 sent image. Halving it gives 800 × 450 content pixels, centered with 175 pixels of padding above and below.

A model point (400, 400) lies inside the content. Remove the top padding first, giving content point (400, 225). Undo the half-size resize to get capture point (800, 450). Multiplying before removing padding puts the vertical coordinate 350 pixels too low.

A point (400, 100) lies inside the upper padding instead. It has no corresponding capture point. Reject it rather than clicking above the source image. Padding belongs to the sent picture, not the application.

A crop is a rectangle from a larger image. Suppose its upper left corner is capture point (600, 300). The crop is 800 × 400 pixels, sent at twice that size. A model point (400, 200) maps to crop point (200, 100).

Add the crop origin after undoing the resize, giving capture point (800, 400). If we forget the origin, we click (200, 100) elsewhere on the desktop. Enlarging a crop changes its scale, while taking one changes its origin.

A combined transform removes padding, reverses resizing, then adds the crop origin. Each step reverses one preparation operation. Keep those values with the observation. Their order is easier to check than one unexplained multiplier.

Choose image detail and cost

A larger screenshot preserves more detail, but the model must process it. Figure 4.3 compares patch count with a schematic text example. The text row illustrates shrinking only. It does not establish reading accuracy at any size.

040080012001600050010001500tokens1092 px per side · 39 × 39 patches · 1521 tokensSquare-image edge length in pixelsUI text, shown enlarged, sent at100%Save note50%Save note33%Save note25%Save notewhere it stops being readable is yourmeasurement to make, per UI
Figure 4.3. A square-image example compares patch cost with the detail left in small text. Source-based diagram.

The stepped curve rises when another patch becomes necessary; its flat portion illustrates a square-image budget cap. It does not mean unlimited pixels cost the same or preserve unlimited detail, so image preparation must respect the selected model's limits.

A visual token represents image information for model processing. Claude's vision documentation describes 28 × 28 pixel patches. Its formula is ceil(width / 28) × ceil(height / 28), where ceil rounds up to the next integer.

For a 1092 × 1092 image, each axis spans 39 patches, so 39 × 39 = 1521 visual tokens. The standard tier allows a 1568-pixel long edge and 1568 tokens. The high-resolution tier allows a 2576-pixel long edge and 4784 tokens.

Ordinary oversized images are resized under the rules. Oversized computer-use or browser-use tool-result images instead need client resizing, or the API rejects them. These limits describe Claude's current tiers, not every vision provider; check the Claude vision documentation against the selected model before sending.

The arithmetic also explains why a small size change can change cost. A 280 × 280 image needs ten patches per axis; at 281 pixels it needs eleven horizontal patches, so 110 instead of 100, though its width grew by one pixel.

One extra pixel is not inherently harmful; dimensions and patch boundaries determine this cost. Text tokens from instructions add their own cost, so a complete request costs more than the visual-token count shown here.

Shrinking a full desktop reduces pixels per control. In a made-up example, a twelve-pixel-high label becomes six pixels high after a half-size resize, so several letters may look similar. No coordinate formula recovers information removed before the model saw the image.

Compare shrinking the whole screen with sending a relevant window unchanged; both may produce the same image dimensions. The window image gives its labels more pixels, since it excludes unrelated desktop area, but less context about other windows.

Choose the image around the task. A scorecard reading step needs legible team names, scores, and the match identifier. A window-switching step needs desktop context to identify the window. One image size does not serve both equally well.

Map capture pixels into input coordinates

The resize conversion only restores capture space. Figure 4.4 shows two reasons input space may still differ. The left example uses a display scale of two. The right uses one possible monitor arrangement, not a rule for every operating system.

1 · Display scalecapture pixels(824, 460)÷ scale 2input points(412, 230)One point, four pixels. Divide once.2 · Monitor originsx −1920 … −1y −1080… −1primary(0, 0)local on left monitor(400, 200)+ origin (−1920, 0)(−1520, 200)Negative is valid here. Do not reject it.3 · Round lastearly100.4 → 100 → ×2 → 200late100.4 → ×2 → 200.8 → 201SaveCancel200201One pixel apart, on two controls.Harmless mid-button, not here.Aim for an interior point.
Figure 4.4. Display scale and monitor placement change the meaning of a coordinate. Diagram.

The left square covers four pixels but one logical point. The right layout includes positions left of and above the primary. A point's sign and unit matter as much as its value. Read the platform's reported geometry before injecting input.

A logical point is a display unit covering several physical pixels. High-density displays use it to keep controls a useful apparent size. Apple's high-resolution explanation describes the points-to-pixels relationship. Do not assume every capture or input API shares that unit.

Suppose our earlier capture point is (824, 460). If the input API uses logical points at scale two, divide both values by two, so input point (412, 230) addresses the target. The two conversions cancel here.

That cancellation can hide a bug. An implementation may look correct after skipping both conversions on one display. Change the sent-image size or display scale, and the same code fails. Record each relationship even when the numbers look familiar.

Multiple monitors introduce origins as well as scales; Windows describes a virtual screen whose coordinates go negative outside the primary monitor. A captured monitor can still have its own top-left origin, and mapping between spaces requires its offset.

Put a 1920-pixel-wide monitor directly left of the primary. In a pixel-based global input space, its left edge can have coordinate -1920. Local point (400, 200) then becomes global point (-1520, 200). Rejecting negative global coordinates would exclude a valid target.

This assumes matching units and vertically aligned monitors. Mixed display scales need the platform's own conversion rules. A screenshot stitched from several monitors may not share one scale across its width, so store the monitor geometry rather than guess from the combined rectangle.

Round only when the input API requires an integer. Earlier rounding loses detail that later conversions may magnify. If a sent coordinate maps to 100.4 capture pixels, rounding gives 100. Multiplying that by two differs from rounding 200.8 at the end.

The difference is one pixel here. That may not matter for a large Save button. It can matter near a narrow border between controls. Choose an interior point with room for rounding error, then check the input bounds.

Inspect a small target with a crop

A location needs the right identity before the right conversion. Grounding connects a description, such as Settings, to a control in the observation. Figure 4.5 enlarges a schematic toolbar region. Follow the crop origin as the icon becomes easier to inspect.

zoom(region) · crop returned at 8×= Settingscrop origin + crop point ÷ 8then apply the screenshot transform
Figure 4.5. A larger crop makes one schematic toolbar icon easier to inspect. Diagram.

The enlarged view shows the chosen icon more clearly. The crop origin determines where that icon sits. A correct visual choice with a forgotten offset remains an incorrect click. Detail and geometry solve different parts of the problem.

A crop helps when the original capture has detail the sent image lost to shrinking. Take it from the original capture whenever possible. Enlarging a shrunken image adds pixels without recovering missing letters, making blurred edges larger but no more certain.

The eightfold crop is schematic. Suppose the crop starts at capture point (440, 20). A model point (160, 80) in an eightfold enlargement maps to (20, 10) inside the crop. Adding the origin gives capture point (460, 30).

A fresh crop may expose a changed interface. Suppose the toolbar moved after the earlier full capture, so the new crop and old transform describe different moments. Give the crop its own observation identifier and geometry rather than attaching it to the old image.

Compare a labeled Save button with an unlabeled disk icon. The button provides text naming the action. The icon requires interpreting its drawing and context. Hovering may reveal a tooltip, but that requires another input and observation.

A tooltip reduces uncertainty without proving the task. It may name Save while leaving the destination note unclear. Keep the BB-042 title or nearby editor context visible. Enlarging only the icon can remove the context needed to associate it with the document.

We have not measured how often a model succeeds on either control. The example explains why the evidence differs. Smaller controls leave less room for location error. Missing labels require more interpretation before the click begins.

Use a crop to answer one unresolved question. It might reveal whether an icon is Settings, whether the score reads 168/6, or whether a row says BB-042. Once answered, return to enough context to act safely.

Combine visual and structured evidence

Figure 4.6 shows the same fictional note page through four methods. Compare what each provides about Save and what it leaves uncertain. The parser confidence number is illustrative, not a measured probability that the save will succeed.

Pixels onlythe model names a pointBoundaryboard / match notesSearch notes?Match BB-042Kites won by 6 wickets.Saveclick (388, 182)?DOM or accessibility treenames and element boundsBoundaryboard / match notesSearch notes?Match BB-042Kites won by 6 wickets.Savebutton “Save” · box [326, 166, 124, 32]Set-of-marksnumbered boxes; "click 6"Boundaryboard / match notesSearch notes?Match BB-042Kites won by 6 wickets.Save123456click element 6Vision parsera second model lists elementsBoundaryboard / match notesSearch notes?Match BB-042Kites won by 6 wickets.Savebutton “Save” · confidence 0.97Prefer the DOM when it exists. Keep pixels as the fallback.Hard cases: canvas apps, custom controls, overlapping windows, low contrast, and misleading visual affordances.
Figure 4.6. Four methods provide different evidence about the same fictional Save button. Diagram.

All four methods point at the same button here. They give different reasons for choosing it. None removes the need to check the page state before input or proves that the saved note contains the correct match result.

With pixels alone, the model reads the label and estimates a location. This works for interfaces with no machine-readable structure, though it requires the screenshot to preserve enough detail. A painted control can look enabled even when the application ignores it.

The Document Object Model, or DOM, is a browser's structured page representation. The accessibility tree describes controls through properties such as role and accessible name. A role gives a control's kind, such as button; its accessible name identifies it to assistive software.

These structures can select a button named Save within the BB-042 editor. They also distinguish it from another Save button elsewhere. A rectangle alone cannot establish that context. The target's relationship to the right note matters.

Structure has limits. A page can include hidden controls or labels that do not match the screen. A canvas may draw controls with no separate DOM elements. Use the evidence the interface provides, and compare uncertain structure with a fresh image.

Set-of-Mark prompting places identifiers on image regions the model can refer to. The original Set-of-Mark paper describes the method. Here the model chooses mark 6 instead of estimating a point. The executor resolves that mark into a rectangle from the same observation.

The marks depend on finding useful regions. A missing button cannot become selectable merely because other regions have numbers. Old marks can identify the wrong places after scrolling or layout changes. Store the mark map with its image and discard it when the state changes.

A vision parser detects regions and attaches descriptions or labels. Microsoft's OmniParser is one implementation. It can supply candidate controls before the action model chooses among them, though a parser can still miss, split, or mislabel a region.

Its confidence score describes the parser's own output under its method. It does not combine target identity, permission, input delivery, and application success into one certainty, so a high score for detecting Save cannot replace checking which note receives the save.

For the note, combine the button's label with the editor title and match facts. The title should identify BB-042. The body should state Pune Lanterns 168/6 and Jaipur Kites 169/4. The result should name Jaipur Kites winners by six wickets.

The target evidence identifies the intended control; the transform maps its point into the input system. The executor needs both, then a fresh observation to establish the effect.

Keep geometry with the observation

Each observation needs a geometry record beside its image. Record the capture dimensions, sent dimensions, crop origin, padding, and the relevant display scale. Include the observation identifier and monitor origin too, since they describe how this image relates to the input system.

Do not replace that record when the display setup changes. An old screenshot still belongs to its geometry. A proposal based on it should use its matching record or be rejected as stale. Reading current monitor settings cannot repair an old point.

Image preparation also decides what leaves the computer. Crop unrelated windows and mask private areas before uploading the screenshot. Apply the same rule before storing a trace, since removing private text from a later caption cannot remove pixels already sent.

These records diagnose a miss in order. First check whether the model selected the intended control, then recompute its capture and input points from the stored values, then check whether the target moved before input. Each concerns a different source of error.

A point becomes usable when its observation, origin, unit, and conversion are known. More image detail can improve target evidence, but cannot repair a wrong transform. The next chapter applies permission checks to actions whose targets we can now locate.

Further reading

Claude vision documentation gives current image dimensions, patch costs, and tool-result restrictions. Use its selected-model limits when preparing screenshots.

Apple's high-resolution explanation defines points versus pixels. Microsoft's virtual-screen documentation explains monitor origins and negative coordinates.

The Set-of-Mark paper explains numbered visual references. OmniParser's repository shows how a separate parser can describe controls from screenshots.