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!

 Posted by at 11:23 AM

  2 Responses to “New MDC content: Pixel manipulation with canvas”

  1. 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

  2. You’re right. Both myself and the reviewer missed that. Good catch. :)