mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
ad784eb808
This is Christoph Gohlke's test suite from his personal PIL package found at http://www.lfd.uci.edu/~gohlke/pythonlibs/. This is just to bring it in as a separate commit. Future commits will align it with Pillow.
27 lines
522 B
Python
27 lines
522 B
Python
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, "->", end=' ')
|
|
im = ImageMath.eval("convert(im*255/hi, 'L')", im=im, hi=hi)
|
|
print(im.getextrema())
|
|
|
|
im.show()
|