diff --git a/image.py b/image.py index 206a37f..b1947c6 100644 --- a/image.py +++ b/image.py @@ -18,8 +18,8 @@ def srgb_to_linear(im: np.ndarray) -> np.ndarray: return (np.clip(rgb_linear, 0.0, 1.0) * 255).astype(np.float32) -def linear_to_srgb(im: np.ndarray) -> np.ndarray: - srgb = linear_to_srgb_array(im / 255.0, gamma=2.4) +def linear_to_srgb(im: np.ndarray, gamma=2.4) -> np.ndarray: + srgb = linear_to_srgb_array(im / 255.0, gamma=gamma) return (np.clip(srgb, 0.0, 1.0) * 255).astype(np.float32) @@ -41,4 +41,4 @@ def resize(image: Image, x_res, y_res, srgb_output: bool = False) -> Image: return Image.fromarray( linear_to_srgb(np.array(res, dtype=np.float32)).astype(np.uint8)) else: - return res \ No newline at end of file + return res