Skip to content

Instantly share code, notes, and snippets.

@esnosy
Last active April 20, 2021 22:04
Show Gist options
  • Save esnosy/5c6e3ae087036f6613720de5e38abd58 to your computer and use it in GitHub Desktop.
Save esnosy/5c6e3ae087036f6613720de5e38abd58 to your computer and use it in GitHub Desktop.
Batch convert psd files in current directory to png, requires psd-tools
from psd_tools import PSDImage
import os
for f in os.scandir():
if f.is_file():
if f.name.endswith(".psd"):
psd = PSDImage.open(f.name)
psd.composite().save(f.name[:-4]+".png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment