JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q19296F
  • License MIT

A simple node utility to resize images including sprite sheets and spine animations.

Package Exports

  • resource-scaler

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resource-scaler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

resource-scaler npm version

A simple node utility to resize images including sprite sheets and spine animations.

Beta Features:

  • Sprite sheet scaling by manipulating the data in JSON files.
  • Spine scaling by manipulating the data in atlas files. JSON data is not manipulated so users need to rely on runtime scaling. More info in the below links.

Image resizing can be done using Jimp or Sharp.

Installation

npm install -g resource-scaler

Usage

resource-scaler -i resources/scale-8 -o resources/scale-4 -s 0.5

Option Description Default
-t, --tool jimp or sharp sharp
-i, --input input folder
-o, --output output folder
-s, --scale scale factor 1
-sa, --sharp_algorithm 1-41
-ja, --jimp_algorithm 1-52
-n, --normalize normalize the channels in the image
-q, --quality quality (0-100, PNG and JPEG only) 100
-v, --verbose verbose
-h, --help help

1Sharp Algorithms

  • 1 - nearest
  • 2 - cubic
  • 3 - lanczos2
  • 4 - lanczos3

2Jimp Algorithms

  • 1 - bilinear
  • 2 - nearest
  • 3 - bicubic
  • 4 - hermite
  • 5 - bezier

Formats

  • jpg
  • png
  • webp (sharp only)
  • tiff (sharp only)
  • bmp (jimp only)
  • json (texture packer and spine)
  • atlas (spine)

Any issues please report.

Licensing Information

MIT license

This content is released under the MIT license.

Jimp is licensed under the MIT license.

Sharp is licensed under the Apache License, Version 2.0 (the "License").

Contributor Code of Conduct

Code of Conduct is adapted from Contributor Covenant, version 1.4