GithubHelp home page GithubHelp logo

zhangjiangen / framepacker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paladin-t/framepacker

0.0 0.0 0.0 2.04 MB

An open source implementation of a texture bin packing algorithm. It's similar to texture tools like the TexturePacker.

License: MIT License

C++ 97.68% CMake 2.32%

framepacker's Introduction

framepacker

framepacker is a freeware which implements a texture bin packing algorithm. It's similar to texture tools like the TexturePacker. You are free to use, copy, modify or distribute it under the MIT license.

It implements a bin packer algorithm refer to the Binary Tree Bin Packing Algorithm.

Compile

A C++ 11 compiler is required to compile the source code. The framepacker::packer template class in framepacker.hpp is the algorithm implementation. And it offers a specialization in framepacker.cpp using stb image.

Usage

It works as a command line tool:

  • framepacker FILE_LIST [-o output_file] [OPTIONS] - Packs some images
  • FILE_LIST
    • := file * : Eg. file1.png file2.png
  • OPTIONS
    • := -p N : Padding, default to 1
    • := -s MxN : Expected texture size, eg. 256x512, may enlarge result
    • := -t : Disable rotation
    • := -w : Disable forcing texture to POT (Power of 2)
    • := -m : Disable alpha trim

Eg. "framepacker foo.png bar.png -o out", it generates a packed out.png image and another out.json meta data which includes packing information to look up slices from the image.

Performance

framepacker is fast, it packs 200 textures in less than 0.15s on common desktop machines at 2015.

framepacker's People

Contributors

paladin-t 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.