"""Helper functions for Image object.""" from ctypes import * from ctypes.wintypes import * gdi = windll.gdi32 def todib(image): """Image.tostring('raw', rawmode, stride=0, ystep=1) "rawmode" is a pixel format. (ex. RGB, GBR...) "stride" is a line buffer size includes padding data. "ystep" indicates a vertical direction. If ystep is 1, then top to bottom. If ystep is -1, then bottom to top. """ if