[PYTHON IMAGE-SIG] PIL bands
Fredrik Lundh
fredrik_lundh@ivab.se
Sun, 10 Nov 1996 18:10:48 +0100
> I'm trying to separate a mode = 'RGB' image into its component
> bands. I've tried 'imageBands = img.split()' but I get an error
The split code in 0.1b1 is broken; here's a better version:
def split(self):
"Split image into bands"
ims = []
self.load()
for i in range(self.im.bands):
ims.append(self._makeself(self.im.getband(i)))
return tuple(ims)
Regards /F
=================
IMAGE-SIG - SIG on Image Processing with Python
send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
=================