May 122009
Today, Paul Rouget pointed out that the Firefox 3.5 for developers page didn’t mention the newly-implemented createImageData() method.
While looking for the right place to add documentation for that method, I realized that we had no documentation at all for using the ImageData object to manipulate pixel data in a canvas. So I settled in and wrote Pixel manipulation with canvas.
This is one of those times when documenting a new feature (the createImageData() method) led to writing content about previously existing features (all the other ImageData methods). Everybody wins!
I think there is a problem with the blue lookup example in the docs.
First there is a missing *4 or times 4 to account for the rgba width of each data item.
Also the 1 offset at the end for blue should be 2. ie, 0=r, 1=g, 2=b, 3=a
You’re right. Both myself and the reviewer missed that. Good catch. :)