from pathlib import Path

only_dir = Path("Only Images")
new_dir = Path("New Images")

only_stems = {f.stem for f in only_dir.iterdir() if f.is_file()}
new_stems = {f.stem for f in new_dir.glob("*.svg")}

missing = sorted(only_stems - new_stems)

with open("missing_images.txt", "w", encoding="utf-8") as f:
    for item in missing:
        f.write(item + "\n")

print(f"Only Images : {len(only_stems)}")
print(f"SVG Images  : {len(new_stems)}")
print(f"Missing     : {len(missing)}")
print("Written to missing_images.txt")
