snaps = list()
for q in quadrants:
crop = image.crop(q)
alpha = crop.getchannel('A')
mask = Image.eval(alpha, lambda a: 255 if a <= 128 else 0)
crop.paste(0, mask)
crop.info['transparency'] = 255
snaps.append(crop)
snaps[0].save('build/sprite.gif', transparency=0, save_all=True, append_images=snaps[1:], loop=0)
from PIL import Image
image = Image.open('walking-sprite.png')
snaps = []
for i in range(0, 8):
crop = image.crop((i * 28, 111-28, (i+1)*28, 111))
alpha = crop.getchannel('A')
mask = Image.eval(alpha, lambda a: 255 if a <= 128 else 0)
crop.paste(0, mask)
crop.info['transparency'] = 255
snaps.append(crop)
snaps[0].save('sprite.gif', transparency=0, save_all=True, append_images=snaps[1:], loop=0, disposal=2)
Pillow currently works with both Python 2 and 3. However, at the start of 2020, Pillow 7.0.0 will drop support for Python 2. See https://pythonclock.org/ and https://python3statement.org/
It does not seam that Autodesk switched their Python SDK to Python 3.x. At least - not for their current releases of their products
zlib-dev and jpeg-dev
before doing pip install pillow
Or are you just asking how to install Ghostscript at all? If so, what operating system are you using?