Skip to content

Implement command line interface

Compare
Choose a tag to compare
@haroldo-ok haroldo-ok released this 09 Aug 23:50
· 31 commits to master since this release
eb056b2

Implemented command line interface; now, the application can be called either from command line, from browser or as a node.js module.

Help message:

rgbquant-sms convert <src> <dest>

Converts an image into a png with the tile count reduced

Positionals:
  src   The source image, the one that will be converted     [string] [required]
  dest  The destination image that will be generated         [string] [required]

Options:
  --version           Show version number                              [boolean]
  --help              Show help                                        [boolean]
  --colors            Desired palette size                         [default: 16]
  --max-tiles         Maximum number of tiles to use              [default: 256]
  --min-hue-cols      Number of colors per hue group to evaluate regardless of
                      counts, to retain low-count hues            [default: 512]
  --dithKern          Dithering kernel name; can one of these:
                      FloydSteinberg, Stucki, Atkinson, Jarvis, Burkes, Sierra,
                      TwoSierra, SierraLite, FalseFloydSteinberg, Ordered2,
                      Ordered2x1, Ordered3, Ordered4 or Ordered8
                                                          [string] [default: ""]
  --dith-serp         Enable serpentine pattern dithering
                                                      [boolean] [default: false]
  --weigh-popularity  Weigh by popularity when reducing tile count
                                                       [boolean] [default: true]
  --weigh-entropy     Weigh by entropy when reducing tile count
                                                      [boolean] [default: false]