mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 16:07:30 +03:00 
			
		
		
		
	find * -type f "-(" -name "*.bdf" -o -name "*.c" -o -name "*.h" -o -name "*.py" -o -name "*.rst" -o -name "*.txt" "-)" -exec sed -e "s/[[:space:]]*$//" -i {} \;
		
	
			
		
			
				
	
	
		
			22 lines
		
	
	
		
			395 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			395 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 |