1
0
Fork 0

add missing alpha channels when blending tiles

This commit is contained in:
Sean Sube 2024-03-02 13:36:29 -06:00
parent b8df5003b0
commit 8d71aed6b0
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 8 additions and 0 deletions

View File

@ -181,6 +181,14 @@ def blend_tiles(
equalized = np.array(tile_image).astype(np.float32)
mask = np.ones_like(equalized[:, :, 0])
# match channels by adding an alpha channel
if equalized.shape[-1] < value.shape[-1]:
logger.debug("adding alpha channel to tile")
alpha = np.ones_like(equalized[:, :, 0])
equalized = np.concatenate(
[equalized, np.expand_dims(alpha, axis=-1)], axis=-1
)
if adj_tile < tile:
# sort gradient points
p1 = (adj_tile * scale) - 1