FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   speed of get/setPixel
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: speed of get/setPixel  (Read 2346 times)
mawend

Email
speed of get/setPixel
« on: Jan 20th, 2003, 5:13am »

My experience so far with the getPixel and setPixel methods is that they are quite slow. I tried writing  a simple cellular automaton program using getPixel to query pixels and their neighbors, and it was brutally slow. Seems like it is much better to store pixel values in a big array yourself (as in Mike Davis' POLLEN examples), than to regularly query the screen with getPixel. Is this always true?
 
REAS


WWW
Re: speed of get/setPixel
« Reply #1 on: Jan 20th, 2003, 10:46am »

This is true. The getPixel() and setPixel() methods are there for beginners. For speed, you should save each pixel as an integer and extract the individual color components using bitwise operations. For example:
http://proce55ing.net/discourse/yabb/board_Syntax_action_displa_y_num_1037826044.html
 
REAS


WWW
Re: speed of get/setPixel
« Reply #2 on: Feb 5th, 2004, 10:09pm »

getPixel() and setPixel() no longer work!
 
the new names are get() and set()
« Last Edit: Feb 5th, 2004, 10:09pm by REAS »  
Pages: 1 

« Previous topic | Next topic »