Skip to main content

No project description provided

Project description

Intro:

  The project is generally used for detecting sprites inside an sprite sheets, providing bounding box of each sprite. It can also detect most used color. It can also draw and colorize a mask from the initial image.

Usage:

  Create a SpriteSheet object using:

   SpriteSheet(fd, background_color=None):
         @fd: the name and path (a string) that references an image file in the local file system;
         OR a pathlib.Path object that references an image file in the local file system ; a file object that MUST implement read(), seek(), and tell() methods, and be opened in binary mode;
         OR a Image object.

         @background_color: an integer if the mode is grayscale;
         OR a tuple (red, green, blue) of integers if the mode is RGB;
         OR a tuple (red, green, blue, alpha) of integers if the mode is RGBA. The alpha element is optional. If not defined, while the image mode is RGBA, the constructor considers the alpha element to be 255.

  Class SpriteSheet provides following methods:

   SpriteSheet.find_most_common_color(image):
Find most used color in an Image object
arg: image: MUST be an Image object
Return most used color in the image with the same format image's mode
   SpriteSheet_object.create_sprite_labels_image():
Draws the masks of the sprites at the exact same position that the sprites were in the original image.
    Returns an image of equal dimension (width and height) as the original image that was passed to the function
   SpriteSheet_object.find_sprites():
	Detect sprites inside the image
	Return a 2D label map and a dict that stores:
        key: sprite's label
        value: its Sprite's object

Installation:

The project require Python 3.8+ to run

  FOR USER:

  In Terminal, use command:
	 pip3 install spritessheet

  FOR DEVELOPMENT:

  Step 1: Clone or Downloads the project, using this command:
	 git clone http://
  Step 2: Install required libs and tools, using this command in Terminal:
	 pip3 install -r requirements.txt
  Step 3: Edit the source code as you wish.

Contact:

    During the usage of the project, if you have any question, please contact me personally at INTEK HCM City or via my Github page: https://github.com/tquang97

Contributors:

    tquang97 from INTEK Institute, HCM City

Project details


Release history Release notifications

Download files

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

Files for spritessheet-tquang97, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size spritessheet_tquang97-1.0.0-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size spritessheet_tquang97-1.0.0.tar.gz (6.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page