mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 07:57:27 +03:00 
			
		
		
		
	Added conversion from RGB to RGBa and La
This commit is contained in:
		
							parent
							
								
									d30404fede
								
							
						
					
					
						commit
						75a206bf58
					
				|  | @ -261,11 +261,7 @@ def hopper(mode: str | None = None, cache: dict[str, Image.Image] = {}) -> Image | ||||||
|     # (for fast, isolated, repeatable tests). |     # (for fast, isolated, repeatable tests). | ||||||
|     im = cache.get(mode) |     im = cache.get(mode) | ||||||
|     if im is None: |     if im is None: | ||||||
|         if mode == "RGBa": |         if mode == "F": | ||||||
|             im = hopper("RGBA").convert(mode) |  | ||||||
|         elif mode == "La": |  | ||||||
|             im = hopper("LA").convert(mode) |  | ||||||
|         elif mode == "F": |  | ||||||
|             im = hopper("L").convert(mode) |             im = hopper("L").convert(mode) | ||||||
|         elif mode[:4] == "I;16": |         elif mode[:4] == "I;16": | ||||||
|             im = hopper("I").convert(mode) |             im = hopper("I").convert(mode) | ||||||
|  |  | ||||||
|  | @ -941,12 +941,14 @@ static struct { | ||||||
|     {"RGB", "1", rgb2bit}, |     {"RGB", "1", rgb2bit}, | ||||||
|     {"RGB", "L", rgb2l}, |     {"RGB", "L", rgb2l}, | ||||||
|     {"RGB", "LA", rgb2la}, |     {"RGB", "LA", rgb2la}, | ||||||
|  |     {"RGB", "La", rgb2la}, | ||||||
|     {"RGB", "I", rgb2i}, |     {"RGB", "I", rgb2i}, | ||||||
|     {"RGB", "F", rgb2f}, |     {"RGB", "F", rgb2f}, | ||||||
|     {"RGB", "BGR;15", rgb2bgr15}, |     {"RGB", "BGR;15", rgb2bgr15}, | ||||||
|     {"RGB", "BGR;16", rgb2bgr16}, |     {"RGB", "BGR;16", rgb2bgr16}, | ||||||
|     {"RGB", "BGR;24", rgb2bgr24}, |     {"RGB", "BGR;24", rgb2bgr24}, | ||||||
|     {"RGB", "RGBA", rgb2rgba}, |     {"RGB", "RGBA", rgb2rgba}, | ||||||
|  |     {"RGB", "RGBa", rgb2rgba}, | ||||||
|     {"RGB", "RGBX", rgb2rgba}, |     {"RGB", "RGBX", rgb2rgba}, | ||||||
|     {"RGB", "CMYK", rgb2cmyk}, |     {"RGB", "CMYK", rgb2cmyk}, | ||||||
|     {"RGB", "YCbCr", ImagingConvertRGB2YCbCr}, |     {"RGB", "YCbCr", ImagingConvertRGB2YCbCr}, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user