INNER CODE UNIT · Python
_combine
ljvmiranda921/sprites-as-a-service · backend/sprites/sprites.py:195
def _combine(mat_outline: np.ndarray, mat_gradient: np.ndarray) -> np.ndarray:
"""Combine the sprite with outline and the one with gradients
Parameters
----------
mat_outline: np.ndarray
The sprite with outline
mat_gradient: np.ndarray
The sprite with gradient
Returns
-------
np.ndarray
The final black-and-white sprite image before coloring
"""
mat_final = np.copy(mat_outline)
mask = mat_outline == 0
mat_final[mask] = mat_gradient[mask]