Step 8: Under Return value, click the
ImageData link
to learn more about what the method returns. Under Instance properties,
click the
ImageData.data link
to learn more about the underlying data. Scroll down to the JavaScript example.
Note that each pixel consists of four values. Copy the
for loop header
into your function to loop through every pixel:
for (let i = 0; i < imageData.data.length; i += 4) {
}