Pillow

http://pillow.readthedocs.io/en/latest/

Table of Contents

Installation

pip install Pillow

Save a clipboard image howto

from PIL import ImageGrab
im = ImageGrab.grabclipboard()  # None if the clipboard does not contain image
im.save('somefile.png','PNG')

Convert an image to bytes howto

import io
b = io.BytesIO()
img.save(b, 'png')
b.getvalue()

Scale image howto

w, h = img.size
scaled = img.resize((w*s, h*s))