Extract a rectangular region from an image, optionally locked to an aspect ratio.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
A rectangular source region is selected by position and size, then copied into a destination bitmap; optional aspect-ratio locking adjusts one dimension before sampling. Pixels outside the source bounds are clipped rather than invented.
Input: data:image/png;base64,iVBORw0KGgo= X: 50 Y: 50 Width: 200 Height: 200
PNG data URL containing the 200×200 region starting at (50, 50)
Profile photos, CMS hero images, and thumbnail pipelines crop regions.