Am Montag, 21. Januar 2008 15:39:21 schrieb theodore test: > Right now it takes around 9 seconds for a single 1600x1200 RGB image, a > conversion that I've seen implemented more or less instantly in, say, > ImageJ. What can I do to make this conversion more efficient?
You should "just remove" the loop. Try to convert all operations to elementwise array/matrix-operations, which are very fast. IOW, make the algorithm work on all pixels in parallel. The only tricky part is the conditional operation, but you can emulate that with the binary operators and e.g. put(). -- Ciao, / / /--/ / / ANS _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion