Skip to main content

Create a texture dynamic texture atlas you can constantly change.

Project description

Install

pip install Texture-Atlas

Example

from Texture_Atlas import Atlas

atlas = Atlas(1000, 1000)
atlas.add_textures([['image1.png', 100, 100], ['image2.png', 200, 200], ['image3.png', 100, 100]])
atlas.save_as("atlas.png")

Documentation

https://shaunkulesa.github.io/Texture-Atlas/

Atlas

  • add_texture(image_path, width, height)
    Adds a texture to the texture atlas.
    • image_path: string

    • width: integer

    • height: integer

  • add_textures(images)
    Adds multiple textures to the texture atlas.
    • images: [[path: string, width: integer, height: integer]]

  • remove_texture(image_path)
    Removes a specific texture from the texture atlas.
    • image_path: string

  • remove_textures(textures)
    Removes multiple specific textures from the texture atlas.
    • textures: [texture_name: string]

  • resize_texture(image_path, width, height)
    Resizes a specific texture in the texture atlas.
    • image_path: string

    • width: integer

    • height: integer

  • resize(width, height)
    Resizes the texture atlas.
    • width: integer

    • height: integer

  • get_texture_position(image_path)
    Returns a list of a texture’s x, y, width and height.
    • image_path: string

  • all_texture_positions()
    Returns a dictionary of all the textures and their positions.
  • save_as(output_name)
    Saves the texture atlas as an image file.
    • output_name: string

  • get_pillow_output()
    Returns the texture atlas in the form of PIL.Image.
  • get_size()
    Returns a list of the width and height of the texture atlas.
  • clear()
    Clears all textures from the texture atlas.

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

Texture_Atlas-0.3.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file Texture_Atlas-0.3.2.tar.gz.

File metadata

  • Download URL: Texture_Atlas-0.3.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for Texture_Atlas-0.3.2.tar.gz
Algorithm Hash digest
SHA256 498fac247444355e04cab9b555b8d5f0f93dfb6e039c7610bedd81681fcef19f
MD5 bdbd061e3af09ca1ccbc934bef6ec80b
BLAKE2b-256 744d081d13474017f1a251b169a5b2095efeb3b096fdf3f4ad51a6893a81d09d

See more details on using hashes here.

Supported by

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