channels / decompose.py
Gerold Meisinger
init
e2e2760
raw
history blame contribute delete
322 Bytes
import numpy as np
import cv2
for basename in ["bird", "dog2", "house2"]:
img = cv2.imread(f"{basename}.png")
for c, suffix in enumerate(["b", "g", "r"]):
img_c = img.copy()
img_c[:,:,c] = 0
cv2.imwrite(f"missing/{basename}_{suffix}.webp", img_c, [cv2.IMWRITE_WEBP_QUALITY, 100])