¡@

Home 

python Programming Glossary: pgm2pil

How to write PIL image filter for plain pgm format?

http://stackoverflow.com/questions/4270700/how-to-write-pil-image-filter-for-plain-pgm-format

edit Ok I think I got it now. Below is the wrapper pgm2pil.py import Image import numpy def pgm2pil filename try inFile.. is the wrapper pgm2pil.py import Image import numpy def pgm2pil filename try inFile open filename header None size None maxGray.. except pass return None def imageOpenWrapper fname pgm pgm2pil fname if pgm is not None return Image.fromarray pgm return origImageOpen..