Fredrik Lundh is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

effbot / pil-2009-raclette http://effbot.org/zone/pil-index.htm

Work repository for PIL 1.1.7 and beyond. The "default" branch should be fairly solid, the other branches less so. For production use, see the pil-117 repository.

Clone this repository (size: 1.6 MB): HTTPS / SSH
hg clone https://bitbucket.org/effbot/pil-2009-raclette
hg clone ssh://hg@bitbucket.org/effbot/pil-2009-raclette

pil-2009-raclette / Tests / show_mcidas.py

import sys
sys.path.insert(0, ".")

from PIL import Image
from PIL import ImageMath

try:
    filename = sys.argv[1]
except IndexError:
    filename = "../pil-archive/goes12.2005.140.190925.BAND_01.mcidas"
    # filename = "../pil-archive/goes12.2005.140.190925.BAND_01.im"

im = Image.open(filename)

print im.format
print im.mode
print im.size
print im.tile

lo, hi = im.getextrema()

print "map", lo, hi, "->",
im = ImageMath.eval("convert(im*255/hi, 'L')", im=im, hi=hi)
print im.getextrema()

im.show()