mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Merge pull request #5434 from radarhere/text_alpha
This commit is contained in:
		
						commit
						649eaae360
					
				
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Tests/images/transparent_background_text_L.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tests/images/transparent_background_text_L.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 350 B  | 
| 
						 | 
					@ -236,7 +236,7 @@ class TestImagingPaste:
 | 
				
			||||||
                [
 | 
					                [
 | 
				
			||||||
                    (127, 191, 254, 191),
 | 
					                    (127, 191, 254, 191),
 | 
				
			||||||
                    (111, 207, 206, 110),
 | 
					                    (111, 207, 206, 110),
 | 
				
			||||||
                    (255, 255, 255, 0) if mode == "RGBA" else (127, 254, 127, 0),
 | 
					                    (127, 254, 127, 0),
 | 
				
			||||||
                    (207, 207, 239, 239),
 | 
					                    (207, 207, 239, 239),
 | 
				
			||||||
                    (191, 191, 190, 191),
 | 
					                    (191, 191, 190, 191),
 | 
				
			||||||
                    (207, 206, 111, 112),
 | 
					                    (207, 206, 111, 112),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -131,6 +131,9 @@ class TestImageFont:
 | 
				
			||||||
        target = "Tests/images/transparent_background_text.png"
 | 
					        target = "Tests/images/transparent_background_text.png"
 | 
				
			||||||
        assert_image_similar_tofile(im, target, 4.09)
 | 
					        assert_image_similar_tofile(im, target, 4.09)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        target = "Tests/images/transparent_background_text_L.png"
 | 
				
			||||||
 | 
					        assert_image_similar_tofile(im.convert("L"), target, 0.01)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_textsize_equal(self):
 | 
					    def test_textsize_equal(self):
 | 
				
			||||||
        im = Image.new(mode="RGB", size=(300, 100))
 | 
					        im = Image.new(mode="RGB", size=(300, 100))
 | 
				
			||||||
        draw = ImageDraw.Draw(im)
 | 
					        draw = ImageDraw.Draw(im)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -436,7 +436,7 @@ fill_mask_L(
 | 
				
			||||||
                         strcmp(imOut->mode, "La") == 0 ||
 | 
					                         strcmp(imOut->mode, "La") == 0 ||
 | 
				
			||||||
                         strcmp(imOut->mode, "LA") == 0 ||
 | 
					                         strcmp(imOut->mode, "LA") == 0 ||
 | 
				
			||||||
                         strcmp(imOut->mode, "PA") == 0) &&
 | 
					                         strcmp(imOut->mode, "PA") == 0) &&
 | 
				
			||||||
                        i != 3) {
 | 
					                        i != 3 && channel_mask != 0) {
 | 
				
			||||||
                        channel_mask =
 | 
					                        channel_mask =
 | 
				
			||||||
                            255 - (255 - channel_mask) * (1 - (255 - out[3]) / 255);
 | 
					                            255 - (255 - channel_mask) * (1 - (255 - out[3]) / 255);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user