updating extraction scripts

This commit is contained in:
2021-03-21 00:11:52 +00:00
parent a399ca0e2b
commit 463d20999f
9 changed files with 266 additions and 53 deletions

View File

@@ -81,6 +81,9 @@ def extract_image(filename: str, output_path: str) -> None:
# convert back to an image
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
# crop
extracted_image = extracted_image.crop((490, 42, 803, 568))
# save the image
extracted_image.save(f"{output_path}/{filename.split('/')[-1].split('.')[-2]}.png")
@@ -88,7 +91,7 @@ def extract_image(filename: str, output_path: str) -> None:
if __name__ == "__main__":
for image in glob.glob(
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
"image-extraction/images/fields/in/*.*"
"image-extraction/images/fields/*.*"
):
print(image)
extract_image(