node-sprite-generator icon indicating copy to clipboard operation
node-sprite-generator copied to clipboard

JPG support with quality option

Open l0co opened this issue 5 years ago • 0 comments

Why have you removed JPG support? I use jimp composer and in 0.10.2 I can still render image to JPG just by using filename with .jpg extension, but in master I can see there's forced PNG support only (even for .jpg extension a PNG-format file is rendered).

It's useful to have an option to choose the format. For example in my project the example sprite file sizes are:

  1. PNG = 4.7 MB
  2. JPG = 2.6 MB (quality: 100)
  3. JPG = 0.9 MB (quality: 90)

There's no visible quality decrease for these pictures (source images are anyway JPG-s with 90 quality) so I'd like to choose 3rd option with the smallest file.

Also, for 0.10.2 there's no option to provide JPG quality, which I've provided additionally here https://github.com/l0co/node-sprite-generator/commit/7fcd13f70bb7d35b56d112f629e600450d16ef8f

l0co avatar Jan 18 '19 13:01 l0co