[Image-SIG] Comparison of PIL and GD speed for setting pixels through python

Christopher Barker Chris.Barker at noaa.gov
Fri Feb 2 21:30:56 CET 2007

John Barratt wrote:
> Hi,
> 	I've had a need to do some optimisation of some low level pixel setting 
> code, and have as such done some tests of different ways of doing this 
> using PIL and alternatively with gd via ctypes.

Have you tried using PIL + numpy -- you can convert a PIL image (some 
eof them, anyway) to a numpy array, and manipulate it there. Numpy 
provides a number if efficient ways to do such manipulations.

In the most recent PIL, you should be able to convert to/from PIL/numpy 
without any copying of the data, though I don't think it's been heavily 


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the Image-SIG mailing list