re-implement equipment with masks

This commit is contained in:
2022-05-16 14:49:30 +02:00
parent 4ffd873578
commit 7feb318a99
2 changed files with 195 additions and 0 deletions

23
create_mask_from_png.py Normal file
View File

@@ -0,0 +1,23 @@
import cv2 as cv
import os
import numpy as np
from window_capture import WindowCapture
from config_file import UserConfigs
#uc = UserConfigs()
#wc = WindowCapture(None, None, uc)
#screen = wc.get_screenshot(False)
# load the original input image and display it to our screen
#filename = "equip/chests/chest_23_32"
path = "equip/wands/"
os.chdir(path)
for entry in os.listdir():
if entry.endswith('.png'):
nelk = entry[:len(entry)-4]
if nelk.find('-mask') == -1:
out = nelk + "-mask.png"
img = cv.imread(entry, cv.IMREAD_UNCHANGED)
cv.imwrite(out, img[:, :, 3])