Skip to content

Commit

Permalink
Added conversion from RGB to RGBa and La
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored and Yay295 committed Mar 20, 2024
1 parent d30404f commit 75a206b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,7 @@ def hopper(mode: str | None = None, cache: dict[str, Image.Image] = {}) -> Image
# (for fast, isolated, repeatable tests).
im = cache.get(mode)
if im is None:
if mode == "RGBa":
im = hopper("RGBA").convert(mode)
elif mode == "La":
im = hopper("LA").convert(mode)
elif mode == "F":
if mode == "F":
im = hopper("L").convert(mode)
elif mode[:4] == "I;16":
im = hopper("I").convert(mode)
Expand Down
2 changes: 2 additions & 0 deletions src/libImaging/Convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,14 @@ static struct {
{"RGB", "1", rgb2bit},
{"RGB", "L", rgb2l},
{"RGB", "LA", rgb2la},
{"RGB", "La", rgb2la},
{"RGB", "I", rgb2i},
{"RGB", "F", rgb2f},
{"RGB", "BGR;15", rgb2bgr15},
{"RGB", "BGR;16", rgb2bgr16},
{"RGB", "BGR;24", rgb2bgr24},
{"RGB", "RGBA", rgb2rgba},
{"RGB", "RGBa", rgb2rgba},
{"RGB", "RGBX", rgb2rgba},
{"RGB", "CMYK", rgb2cmyk},
{"RGB", "YCbCr", ImagingConvertRGB2YCbCr},
Expand Down

0 comments on commit 75a206b

Please sign in to comment.