File size: 322 Bytes
e2e2760
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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])