resource-scaler

2.2.0 • Public • Published

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

Package Sidebar

Install

npm i resource-scaler

Weekly Downloads

0

Version

2.2.0

License

MIT

Unpacked Size

17.7 kB

Total Files

8

Last publish

Collaborators

  • adireddy