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

Release files for spriteutils-pkg 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spriteutils-pkg 2.0.1
File Size Uploaded
spriteutils-pkg-2.0.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spriteutils-pkg 2.0.1
File Interpreter ABI Platform
spriteutils_pkg-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / spriteutils-pkg-2.0.1.tar.gz

Download URL spriteutils-pkg-2.0.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
632643f65410a7ceda535005a227f726f3351e9a31aa85d1a44def16b310da38
BLAKE2b-256 checksum
How to use checksums
b687ec34fb8f8b6dc11de8155fc433d8b4af922b1ce03f669c041b740534eab8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / spriteutils_pkg-2.0.1-py3-none-any.whl

Download URL spriteutils_pkg-2.0.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39fb1de0669df825cacf5d27fbc4e4fd2346d354b3b56834387c07ed9baab644
BLAKE2b-256 checksum
How to use checksums
f38e538b526e3066b6ec6135b2b3326707c13b00d778fa66ee7f08f327c63e13
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release 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