# -*- coding: utf-8 -*- """ Importing this module installs support for 16-bit images in PIL. This works by patching objects in the PIL namespace; no files are modified. """ from PIL import Image if Image.VERSION == '1.1.7': Image._MODE_CONV["I;16"] = ('%su2' % Image._ENDIAN, None) Image._fromarray_typemap[((1, 1), " ndmax: raise ValueError("Too many dimensions.") size = shape[:2][::-1] if strides is not None: obj = obj.tostring() return frombuffer(mode, size, obj, "raw", mode, 0, 1) Image.fromarray=fromarray