Atlas packer

More a less generic python based atlas image packer. Collects individual sprite images and arranges them onto compact atlas texture. Then dumps the texture and atlas description.

Key differences from the other atlas packers:

  • Can use individual layers from the PSD images
  • Can grab sprites from the regular grid
  • More friendly to the content creation tools and artists

Input sprite layout file

        "name": "images",   // layer name
        // sprites are in the grid
        "sprite_grid": {    
            "grid_size": [7, 8],    // grid forms cells 
            "grid_ofs": [0, 0],     // grid origin offset
            "sprite_size": [64, 64],// sprite's regular size
            "sprite_org": [24, 52]  // sprite's origin (pivot)
        "name": "onebigsprite",
        // one sprite in a layer with auto bbox
        "sprite": {
            "sprite_org": [0, 0]
    // repeat as much as you like

Implemented features

  • PSD layeres support
  • JSON based sprite sheet descriptions
  • Regular grid sprite splicing
  • Starling compatible XML atlas export
  • MaxRects packing
  • Pow2 and Non-pow2 texture size support
  • Alpha threshoulding (cut out almost transparent sprite areas)
  • Sprite trimming (optimize packing)
  • Sprite names prefix
  • Per-layer sprite importer


  • Commands: pack (atlas), split (individual images), something else
  • Flexible sprite naming format with templates, sort of "{prefix}{base}{num}"
  • More robust error reporting
  • Fix options validation and output image format selection
  • Regular images as input (png and such)
  • Support for layer groups (merged layer group as a source)
  • Add dithering and other useful postprocessing (not so useful actually)
    • Pre-sort rects before packing (needs command line option)
  • Better packer algorithm (like offline best-fit and others)
  • Check and enable option for the flipped sprites placement (no use in starling)
    • Various sprite definition methods (individual, grid, single-bbox and such)
  • Border dilation filter

In the future I might extend it for multiatlas packaging or add bitmap font generator functionality. But not for now.

Installation and dependencies


  • PIL or Pillow
  • psd_tools
  • simplejson
  • docopt