Skip to main content

SpriteSheet Detection package

Project description

Sprites Detection

Introduction

A sprite is a small raster graphic (a bitmap) that represents an object such as a character, a vehicle, a projectile, etc.

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 (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.
  • Present a 2D map of all the the sprites with their labels.

Usage Information

Prerequisites

  • Python 3.7 is required.

Usage

  • Use git to clone the link https://github.com/intek-training-jsc/sprite-sheet-hoaithu1.git to your local directory.
  • Change the your current working directory to where you git the project.
  • Open terminal and type pipenv install -e Pipfile to install virtual environment.
  • For example:
>>> 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.
    Email: hoai.le@f4.intek.edu.vn

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spritesheet_detect-0.0.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

spritesheet_detect-0.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file spritesheet_detect-0.0.1.tar.gz.

File metadata

  • Download URL: spritesheet_detect-0.0.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for spritesheet_detect-0.0.1.tar.gz
Algorithm Hash digest
SHA256 929040a55e1bc80777ce8a9efd58b509ac0cba30b972cdc1d2c5931601a00391
MD5 c07edeac28063c4549928c83326c3130
BLAKE2b-256 8f0efb71fe71aa6f1bc8537e7b6eea0ba16c002f65879ebb36cc28c3b82ebe30

See more details on using hashes here.

File details

Details for the file spritesheet_detect-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: spritesheet_detect-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for spritesheet_detect-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5a7bdf98d64fb416af21d59eb6d84846683690b0e058c16e89cbced177a9ae4
MD5 21c0587999d784f837b7e83c0fe00043
BLAKE2b-256 bb14d4f1ddf990924f36edd226e1268c1daf7e7e3bb1f5562d559b801d70b7c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page