# Kirikiri Sprite Synth

This is a simple tool to generate a sprite sheet from a set of images. It provides exactly the same sprite sheet as the one generated by the Kirikiri engine, which is used in many visual novels.

## Usage

```python
from PIL import Image
from kirikiri_sprite_synth import SpriteSynth


# Create a SpriteSynth object
synth = SpriteSynth(
    a_info_path='a_info.txt',
    # Path to a_info file, usually located at /fgimage/<character_name>a_info.txt
    b_info_path='b_info.txt',
    # Path to b_info file, usually located at /fgimage/<character_name>b_info.txt
    layers_info_path_template='{info_type}.txt',
    # Path to layer info files, usually located at /fgimage/<character_name>/<character_name>{info_type}.txt
    assets_path='assets',
    # Path to the assets folder, usually located at /fgimage/<character_name>
)

# Generate the sprite sheet
sprite: Image.Image = synth.draw(
    dress="私服",
    face="01",
    pose="1",
)

# Save the sprite sheet
sprite.save('sprite.png')
```

## Installation

<details open>
<summary>pip</summary>

    pip install kirikiri-sprite-synth

</details>


<details>
<summary>pdm</summary>

    pdm add kirikiri-sprite-synth
</details>
<details>
<summary>poetry</summary>

    poetry add kirikiri-sprite-synth
</details>
<details>
<summary>conda</summary>

    conda install kiri-kiri-sprite-synth -c conda-forge
</details>

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- [Senren * Banka](https://senren.nekonyansoft.com/): Great visual novel that inspired me to create this tool.
