Metadata-Version: 2.1
Name: sprite-pipeline
Version: 0.1.0
Summary: A pipeline for converting images into stylized game sprites with style transfer, enhancement, and sprite sheet generation.
Home-page: https://github.com/alexanderbrodko/sprite-pipeline
Author: Alexander Brodko
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: Pillow
Requires-Dist: psd-tools
Requires-Dist: rectpack
Requires-Dist: modelscope
Requires-Dist: basicsr
Requires-Dist: realesrgan
Requires-Dist: nst_vgg19
Requires-Dist: gdown

# sprite-pipeline

You download images to a folder

![image](https://github.com/user-attachments/assets/c9571d74-167c-444a-85c0-de09c9c78eb6)

⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️

`python group.py --style painting.png -H 100 downloaded/`

![image](https://github.com/user-attachments/assets/f78390a6-6737-4d33-bf24-3554721d5bdd)

⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️

You open PS, resize layers, fix perspective, patch.

⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️

`python spritesheet.py graphics.psd`

![image](https://github.com/user-attachments/assets/8f7ed3f2-b918-4268-a123-a919f21e2485)
![image](https://github.com/user-attachments/assets/8a650d62-fa07-426c-a2fa-600af78e0420)

Congrats! You get packed spritesheet and UV coordinates in .txt

## Details

1. [BiRefNet](https://huggingface.co/ZhengPeng7/BiRefNet) to extract foreground
2. [RetinexNet](https://github.com/weichen582/RetinexNet) to fix lights
3. [nst_vgg19](https://github.com/alexanderbrodko/nst_vgg19) for Neural Style Transfer
4. [RealESRGAN_MtG](https://huggingface.co/rullaf/RealESRGAN_MtG) to improve quality
5. OpenCV to other filters and algorithms


## Requirements
`pip install numpy opencv-python torch torchvision pillow psd-tools rectpack modelscope realesrgan nst_vgg19 gdown`



