PNG to PSD

One image in, a layered file out.

User uploads an image through a React frontend. The backend sends the image to SAM via Replicate to generate segmentation masks. Python processes these masks to reduce overlaps and extract layer candidates. The processed layers are then passed to a GIMP Script-Fu script, which assembles them into a PSD file and exports the result.

Segmentation handled by SAM through Replicate API. Post-processing done in Python to clean and merge masks. GIMP scripting (Script-Fu in Scheme) used to programmatically construct layered images and export PSDs. Lightweight React UI for interaction.

Produces PSD files with dozens of automatically generated layers from a single input image in ~1 minute. Demonstrates feasibility of automated image decomposition, but outputs are noisy, with overlapping and redundant layers requiring manual cleanup.

Prompt Versioning