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 hashes)

Uploaded Source

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