Skip to main content

Spriteutils

Spriteutils is small project to determine Sprites (specified by there unique label mask and bounding box) in the given Sprite Sheet.

A Sprite is a small raster graphic (a bitmap) that represents an object

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

This project is a tool to determine sprites (specified by there unique mask and bounding box) in the given Sprite Sheet.

Installaltion:

Prequisites: Python 3.7

$ pip install spriteutils-pkg

Documentation

After install the package, open python (python version must be >= 3.7)

$ python

Import the package and using method help to read the document

>>> from spriteutils import SpriteSheet
>>> help(SpriteSheet)

Functional test

Replicate the following step in python

# Import the package
>>> from spriteutils import SpriteSheet
# Specified the image file path name or create a PIL image
>>> image = "path/to/your/image"
# Create sprite sheet object
>>> sprite_sheet = SpriteSheet(image)
# Find all the sprites of the sprite sheet
>>> sprites ,label_map = sprite_sheet.find_sprites()
# Draw sprite masks for each sprite in the sprite sheet
>>> image = sprite_sheet.create_sprite_labels_image()
# Show the sprite masks image
>>> image.show()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details

Download files

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

Source Distribution

spriteutils-pkg-1.1.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spriteutils_pkg-1.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file spriteutils-pkg-1.1.1.tar.gz.

File metadata

  • Download URL: spriteutils-pkg-1.1.1.tar.gz
  • Upload date:
  • Size: 7.5 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.42.1 CPython/3.7.4

File hashes

Hashes for spriteutils-pkg-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ec8e058038ca3ccee78f80394bc88a814a6d4cf8044ae971d75a10c6e13cf9be
MD5 8ee9e7b8a9d9ebc2373544a8d8111043
BLAKE2b-256 8ac3e74350a34224927560289ee93ba1223e8527d50669e000c89df07729cefa

See more details on using hashes here.

File details

Details for the file spriteutils_pkg-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: spriteutils_pkg-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.42.1 CPython/3.7.4

File hashes

Hashes for spriteutils_pkg-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 202d7a1ba05ae9f52df5a606f86a9c61541cdb87d8c8a76ae6686921a04f3403
MD5 77773b02f8a1403a6bd5d93747bf4c61
BLAKE2b-256 39047f6e26b8a6acaec513c4433435a30e2a129e637b819c7a5eea246428b1af

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.1

2 files

2.0.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

This release

1.1.1 This release

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page