INNER CODE UNIT · Python
old
ljvmiranda921/sprites-as-a-service · backend/sprites/sprites.py:187
old = old_max - old_min
new = new_max - new_min
return (((matrix - old_min) * new) / old) + new_min
sprite_with_gradient = _remap(map_range, grad)
return sprite_with_gradient
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