Code Monkey home page Code Monkey logo

texture-atlas's Introduction

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.

texture-atlas's People

Contributors

shaunkulesa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.