Metadata-Version: 2.1
Name: krkr-sprite-synth
Version: 0.2.0
Summary: A library for synthesizing character sprites for galgame games using the krkr engine
Author-Email: zhaomaoniu <2667292003@qq.com>
License: MIT
Requires-Python: >=3.8
Requires-Dist: Pillow>=10.4.0
Description-Content-Type: text/markdown

# 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
    a_layers_info_path='a.txt',
    # Path to a layer info files, usually located at /fgimage/<character_name>/<character_name>a.txt
    b_layers_info_path='b.txt',
    # Path to b layer info files, usually located at /fgimage/<character_name>/<character_name>b.txt
    assets_path='assets',
    # Path to the assets folder, usually located at /fgimage/<character_name>
    character_name='character_name',
    # Name of the character, used to assist in locating the layer images
)

# 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.
