https://github.com/imb11/plixel
fork of a pretty illegal project, archive purposes
https://github.com/imb11/plixel
Last synced: 3 months ago
JSON representation
fork of a pretty illegal project, archive purposes
- Host: GitHub
- URL: https://github.com/imb11/plixel
- Owner: IMB11
- Created: 2023-06-03T18:25:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-03T18:25:59.000Z (about 3 years ago)
- Last Synced: 2025-10-20T01:58:02.687Z (9 months ago)
- Size: 12.5 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadmeGenerator.py
Awesome Lists containing this project
README
import os
from PIL import Image
# Path to the directory
path = "./Dataset/"
TotalCount = 0
# Open readme.md file for writing
with open("readme.md", "w") as file:
# Write the header for the table
file.write("| Mod | Data |\n")
file.write("| --- | --- |\n")
# Loop through all the directories in the main directory
for dirpath, dirnames, filenames in os.walk(path):
dirpath=dirpath.split("/")[-1]
# Count the number of png files in each directory with dimensions of 16x16 pixels
png_count = 0
for filename in filenames:
if filename.endswith(".png"):
filepath = os.path.join(dirpath, filename)
im = Image.open(path+filepath)
if im.size == (16, 16):
png_count += 1
TotalCount += 1
if(png_count>=1):
file.write(f"| {dirpath} | {png_count} |\n")
file.write(f"Total: {TotalCount}")