Metadata-Version: 2.1
Name: spritesheet-detect
Version: 0.0.1
Summary: SpriteSheet Detection package
Home-page: UNKNOWN
Author: Thu Hoai
Author-email: hoai.le@f4.intek.edu.vn
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: bleach (==3.1.0)
Requires-Dist: certifi (==2019.11.28)
Requires-Dist: cffi (==1.13.2)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: cryptography (==2.8)
Requires-Dist: docutils (==0.16)
Requires-Dist: idna (==2.8)
Requires-Dist: keyring (==21.1.0)
Requires-Dist: more-itertools (==8.1.0)
Requires-Dist: numpy (==1.18.1)
Requires-Dist: pillow (==7.0.0)
Requires-Dist: pkginfo (==1.5.0.1)
Requires-Dist: pycparser (==2.19)
Requires-Dist: pygments (==2.5.2)
Requires-Dist: readme-renderer (==24.0)
Requires-Dist: requests (==2.22.0)
Requires-Dist: requests-toolbelt (==0.9.1)
Requires-Dist: six (==1.14.0)
Requires-Dist: tqdm (==4.41.1)
Requires-Dist: twine (==3.1.1)
Requires-Dist: urllib3 (==1.25.7)
Requires-Dist: webencodings (==0.5.1)
Requires-Dist: wheel (==0.33.6)
Requires-Dist: zipp (==2.0.0)
Requires-Dist: importlib-metadata (==1.4.0) ; python_version < "3.8"
Requires-Dist: jeepney (==0.4.2) ; sys_platform == "linux"
Requires-Dist: secretstorage (==3.1.2) ; sys_platform == "linux"

# Sprites Detection

## Introduction

A [**sprite**](<https://en.wikipedia.org/wiki/Sprite_(computer_graphics)>) is a small [**raster graphic**](https://en.wikipedia.org/wiki/Raster_graphics) (a **bitmap**) that represents an object such as a [character, a vehicle, a projectile, etc.](https://www.youtube.com/watch?v=a1yBP5t-fSA)

### Sprite Sheet

It is not uncommon for games to have tens to hundreds of sprites. Loading each of these as an individual image would consume a lot of memory and processing power. To help manage sprites and avoid using so many images, many games use [**sprite sheets**](https://www.youtube.com/watch?v=crrFUYabm6E) (also known as **image sprites**).

A sprite sheet consists of multiple sprites in one image. In other words, sprite sheets pack multiple sprites into a single picture. Using sprite sheet, video game developers create sprite sheet animation representing one or several animation sequences while only loading a single file:


### Sprite Bounding Box

A frame (**bounding box**) can be used to delimit the sprite in the sprite sheet. This bounding box is defined with two 2D points `top_left` and the `bottom_right`, which their respective coordinates `x` and `y` are relative to the top-left corner of the sprite sheet's image.


## What the project does
- Detect sprites packed in an image (sheet) and draw their masks and bounding boxes into a new image with the same size of the original image. <br/>
- Present a 2D map of all the the sprites with their labels. <br/>


## Usage Information
### Prerequisites
- Python 3.7 is required. <br/>
### Usage
- Use git to clone the link `https://github.com/intek-training-jsc/sprite-sheet-hoaithu1.git` to your local directory. <br/>
- Change the your current working directory to where you git the project. <br/>
- Open terminal and type `pipenv install -e Pipfile` to install virtual environment. <br/>
- For example: <br/>
```python
>>> from spritesheet_detect.spriteutil import SpriteSheet
>>> sprite_sheet = SpriteSheet('Barbarian.gif')
>>> sprites, labels = sprite_sheet.find_sprites()
>>> len(sprites)
39
>>> # Create the mask image with bounding boxes.
>>> image = sprite_sheet.create_sprite_labels_image()
>>> image.save('barbarian_bounding_boxes.png')
```

## Contact Information
- If you have any problems using this library, please use the contact below. <br/>
`Email: hoai.le@f4.intek.edu.vn`



