Pixel Reader

By Bobby on Thu, 1 Jan 2009 07:38:29 +0000

: greyscale, flash, pixel,

This flash movie reads pixels from an image dynamically, using Flash's new Pixel read/write capabilities. MouseOver the image to change the selected color. Click the image to convert back and forth between color and greyscale.

Demo





Implementation


Flash 8 introduces methods for reading and writing pixels on a bitmap:

bmp.getPixel(_x, _y);
bmp.setPixel(_x, _y, _color); 


For generating the GreyScale version of a color image, set each pixel's color to its RGB average, that is: R = (R + G + B)/3 G = (R + G + B)/3 B = (R + G + B)/3
Creative Commons License The Pixel Reader article by Bobby Soares, unless otherwise expressly stated, is licensed under a Attribution-Noncommercial-Share Alike 3.0 United States License.

No comments have been added.


Comment moderation is on, so your comments may not be visible immediately after posting.




(see all) web service, tile engine, google docs, flash, window, penn, pixel, python, game, compiler, server, tlslite, token, reference, rtmp, vmware, p vs np, Google Docs, poweredge, javascript, component, vbulletin, proxy, networking, vmware esxi, GData, forum, plugin, gwt, outlook, scales, puzzle, GWT, java, attach, shining force, subsets, appengine, permutations, pong, authentication, roland, screenshot, np-complete, gdata, neural net, php, latex, audio, AppEngine