HTML:Canvas:PixelManipulation
lastmod 2026-11-10created 2023-02-222 edits
Pixel manipulation on an HTML Canvas means reading the pixels of a canvas region as an RGBA byte array (ImageData) with getImageData, changing the values, and drawing them back with putImageData. It is used to implement filters such as color inversion, grayscale, and thresholding directly in JavaScript, or to read the color at a specific coordinate. Note that images from other origins cannot be read because of CORS restrictions.