Spaces:
Runtime error
Runtime error
Download processor/AlphaProcessor.py from Superlang/ImageComposition: direct link, hf CLI and curl.
- Browser
- Download file 245 Bytes
-
https://huggingface.co/spaces/Superlang/ImageComposition/resolve/main/processor/AlphaProcessor.py
- Command line
-
hf download hf://spaces/Superlang/ImageComposition/processor/AlphaProcessor.py
-
curl -L -o AlphaProcessor.py https://huggingface.co/spaces/Superlang/ImageComposition/resolve/main/processor/AlphaProcessor.py
245 Bytes
| from PIL import Image | |
| class AlphaComposite: | |
| def __call__(self, im_rgb, bg_img): | |
| bg_img = bg_img.convert("RGBA") | |
| im_rgb = im_rgb.convert("RGBA") | |
| result = Image.alpha_composite(bg_img, im_rgb) | |
| return result | |