odrick/free-tex-packer

Free texture packer

JavaScript

1,285

326 commits

updated Jul 14, 2024

See the code

README

Free texture packer

logo

IMPORTANT: I don't have time to imporove this app anymore. Only critical bugs will be fixed.

Free texture packer creates sprite sheets for you game or site. Rotation, trimming, multipacking, various export formats (json, xml, css, pixi.js, godot, phaser, cocos2d). Zip support. TinyPNG support. Split sheet tool.

screenshot

Homepage: https://free-tex-packer.com

Web version: https://free-tex-packer.com/app

Desktop versions for win, mac, linux: https://github.com/odrick/free-tex-packer/releases

Gulp module: https://github.com/odrick/gulp-free-tex-packer

Grunt plugin: https://github.com/odrick/grunt-free-tex-packer

Webpack plugin: https://github.com/odrick/webpack-free-tex-packer

CLI: https://github.com/odrick/free-tex-packer-cli

Custom templates

Free texture packer uses mustache template engine.

There are 3 objects passed to template:

rects (Array) list of sprites for export

proptypedescription
nameStringsprite name
frameObjectframe info (x, y, w, h, hw, hh)
rotatedBooleansprite rotation flag
trimmedBooleansprite trimmed flag
spriteSourceSizeObjectsprite source size (x, y, w, h)
sourceSizeObjectoriginal size (w, h)
firstBooleanfirst element in array flag
lastBooleanlast element in array flag

config (Object) current export config

proptypedescription
imageWidthNumbertexture width
imageHeightNumbertexture height
scaleNumbertexture scale
formatStringtexture format
imageNameStringtexture name
imageFileStringtexture file (name with extension)
base64ExportBooleanbase64 export flag
base64PrefixStringprefix for base64 string
imageDataStringbase64 image data

appInfo (Object) application info

proptypedescription
displayNameStringApp name
versionStringApp version
urlStringApp url

Example:

{
  "frames": {
    {{#rects}}
    "{{{name}}}": {
      "frame": {
        "x": {{frame.x}},
        "y": {{frame.y}},
        "w": {{frame.w}},
        "h": {{frame.h}}
      },
      "rotated": {{rotated}},
      "trimmed": {{trimmed}},
      "spriteSourceSize": {
        "x": {{spriteSourceSize.x}},
        "y": {{spriteSourceSize.y}},
        "w": {{spriteSourceSize.w}},
        "h": {{spriteSourceSize.h}}
      },
      "sourceSize": {
        "w": {{sourceSize.w}},
        "h": {{sourceSize.h}}
      },
      "pivot": {
        "x": 0.5,
        "y": 0.5
      }
    }{{^last}},{{/last}}
    {{/rects}}
  },
  "meta": {
    "app": "{{{appInfo.url}}}",
    "version": "{{appInfo.version}}",
    "image": "{{config.imageFile}}",
    "format": "{{config.format}}",
    "size": {
      "w": {{config.imageWidth}},
      "h": {{config.imageHeight}}
    },
    "scale": {{config.scale}}
  }
}
atlas
phaser
pixi
sprites
spritesheet
texture-packer
texturepacker

odrick/free-tex-packer

Free texture packer

JavaScript

1,285

326 commits

updated Jul 14, 2024

See the code

README

Free texture packer

logo

IMPORTANT: I don't have time to imporove this app anymore. Only critical bugs will be fixed.

Free texture packer creates sprite sheets for you game or site. Rotation, trimming, multipacking, various export formats (json, xml, css, pixi.js, godot, phaser, cocos2d). Zip support. TinyPNG support. Split sheet tool.

screenshot

Homepage: https://free-tex-packer.com

Web version: https://free-tex-packer.com/app

Desktop versions for win, mac, linux: https://github.com/odrick/free-tex-packer/releases

Gulp module: https://github.com/odrick/gulp-free-tex-packer

Grunt plugin: https://github.com/odrick/grunt-free-tex-packer

Webpack plugin: https://github.com/odrick/webpack-free-tex-packer

CLI: https://github.com/odrick/free-tex-packer-cli

Custom templates

Free texture packer uses mustache template engine.

There are 3 objects passed to template:

rects (Array) list of sprites for export

proptypedescription
nameStringsprite name
frameObjectframe info (x, y, w, h, hw, hh)
rotatedBooleansprite rotation flag
trimmedBooleansprite trimmed flag
spriteSourceSizeObjectsprite source size (x, y, w, h)
sourceSizeObjectoriginal size (w, h)
firstBooleanfirst element in array flag
lastBooleanlast element in array flag

config (Object) current export config

proptypedescription
imageWidthNumbertexture width
imageHeightNumbertexture height
scaleNumbertexture scale
formatStringtexture format
imageNameStringtexture name
imageFileStringtexture file (name with extension)
base64ExportBooleanbase64 export flag
base64PrefixStringprefix for base64 string
imageDataStringbase64 image data

appInfo (Object) application info

proptypedescription
displayNameStringApp name
versionStringApp version
urlStringApp url

Example:

{
  "frames": {
    {{#rects}}
    "{{{name}}}": {
      "frame": {
        "x": {{frame.x}},
        "y": {{frame.y}},
        "w": {{frame.w}},
        "h": {{frame.h}}
      },
      "rotated": {{rotated}},
      "trimmed": {{trimmed}},
      "spriteSourceSize": {
        "x": {{spriteSourceSize.x}},
        "y": {{spriteSourceSize.y}},
        "w": {{spriteSourceSize.w}},
        "h": {{spriteSourceSize.h}}
      },
      "sourceSize": {
        "w": {{sourceSize.w}},
        "h": {{sourceSize.h}}
      },
      "pivot": {
        "x": 0.5,
        "y": 0.5
      }
    }{{^last}},{{/last}}
    {{/rects}}
  },
  "meta": {
    "app": "{{{appInfo.url}}}",
    "version": "{{appInfo.version}}",
    "image": "{{config.imageFile}}",
    "format": "{{config.format}}",
    "size": {
      "w": {{config.imageWidth}},
      "h": {{config.imageHeight}}
    },
    "scale": {{config.scale}}
  }
}
atlas
phaser
pixi
sprites
spritesheet
texture-packer
texturepacker

Significant stargazers

CanisMinor

892 followers · starred Feb 2026

Michael Hadley

257 followers · starred Dec 2019

Yuri Rubinsky

257 followers · starred Aug 2024

Shen Yiming

67 followers · starred Mar 2019