selaux / node-sprite-generator

Generates image sprites and their spritesheets (css, stylus, sass or less) from sets of images. Supports retina sprites. Provides express middleware and grunt task.
MIT License
191 stars 39 forks source link

calculate quality from compression level #9

Closed selaux closed 11 years ago

selaux commented 11 years ago

This will calculate the quality parameter for graphicsmagick from the compression level.

Input: 0-9 Output: 10-100

johnyanarella commented 11 years ago

Looks like with that equation, the transformed result is flipped:

options.compressionLevel10 * (10 - options.compressionLevel)(options.compressionLevel * 10) + 10
010010
19020
28030
37040
46050
55060
64070
73080
82090
910100