mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
6537ba19c3
- add new FASTOCTREE quantizer with alpha support
- make ZIP compress level and type configurable
- support reading/writing PNGs with paletted alpha
source 3637439d51
22 lines
399 B
Python
22 lines
399 B
Python
from tester import *
|
|
|
|
from PIL import Image
|
|
|
|
def test_sanity():
|
|
|
|
im = lena()
|
|
|
|
im = im.quantize()
|
|
assert_image(im, "P", im.size)
|
|
|
|
im = lena()
|
|
im = im.quantize(palette=lena("P"))
|
|
assert_image(im, "P", im.size)
|
|
|
|
def test_octree_quantize():
|
|
im = lena()
|
|
|
|
im = im.quantize(100, Image.FASTOCTREE)
|
|
assert_image(im, "P", im.size)
|
|
|
|
assert len(im.getcolors()) == 100 |