mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-01 00:17:27 +03:00 
			
		
		
		
	Test mirroring
This commit is contained in:
		
							parent
							
								
									01b2d5b0ab
								
							
						
					
					
						commit
						761081b1e3
					
				|  | @ -176,6 +176,24 @@ class MorphTests(PillowTestCase): | ||||||
|         self.assertEqual(len(coords), 4) |         self.assertEqual(len(coords), 4) | ||||||
|         self.assertEqual(tuple(coords), ((2, 2), (4, 2), (2, 4), (4, 4))) |         self.assertEqual(tuple(coords), ((2, 2), (4, 2), (2, 4), (4, 4))) | ||||||
| 
 | 
 | ||||||
|  |     def test_mirroring(self): | ||||||
|  |         # Test 'M' for mirroring | ||||||
|  |         mop = ImageMorph.MorphOp(patterns=['1:(... ... ...)->0', | ||||||
|  |                                            'M:(00. 01. ...)->1']) | ||||||
|  |         count, Aout = mop.apply(self.A) | ||||||
|  |         self.assertEqual(count, 7) | ||||||
|  |         self.assert_img_equal_img_string(Aout, | ||||||
|  |                                          """ | ||||||
|  | 
 | ||||||
|  |                                          ....... | ||||||
|  |                                          ....... | ||||||
|  |                                          ..1.1.. | ||||||
|  |                                          ....... | ||||||
|  |                                          ....... | ||||||
|  |                                          ....... | ||||||
|  |                                          ....... | ||||||
|  |                                          """) | ||||||
|  | 
 | ||||||
|     def test_non_binary_images(self): |     def test_non_binary_images(self): | ||||||
|         im = hopper('RGB') |         im = hopper('RGB') | ||||||
|         mop = ImageMorph.MorphOp(op_name="erosion8") |         mop = ImageMorph.MorphOp(op_name="erosion8") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user