From: Charles G W. <cg...@al...> - 2002-02-15 20:22:32
|
John J. Lee writes: > I think -- correct me if I'm wrong -- he was asking about interpolation. I think that only Mr Yeates knows for sure! I read the query a few times and I think he's looking for straight-ahead subsampling without interpolation. > If a Python loop is too slow, you can probably do it with the standard > numpy functions, with some experimentation. If interpolation is desired, it might also be worthwhile looking at the Python Imaging Library (PIL), I believe it has routines for resizing images with bilinear interpolation. Since PIL supports many different data formats (even floating point) and it's fairly easy, if inelegant, to inter-convert PIL images and NumPy arrays using "fromstring/tostring" methods (there should be tighter integration between these packages, maybe somebody has done this since last I looked), you might find that the PIL image resizing does what you're looking for. |