This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import cv2 | |
| def overlay_alpha_image_lazy(background_rgb, overlay_rgba, alpha): | |
| # cf https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending | |
| # If the destination background is opaque, then | |
| # out_rgb = overlay_rgb * overlay_alpha + background_rgb * (1 - overlay_alpha) | |
| overlay_alpha = overlay_rgba[: , : , 3].astype(np.float) / 255. * alpha | |
| overlay_alpha_3 = np.dstack((overlay_alpha, overlay_alpha, overlay_alpha)) | |
| overlay_rgb = overlay_rgba[: , : , : 3].astype(np.float) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Steam installer for Debian wheezy (32- and 64-bit) | |
| # | |
| # Place into empty directory and run. | |
| # | |
| download() { | |
| local url="$1" | |
| local filename="$(basename "$url")" |