update logos, and image decoder settings in config
This commit is contained in:
@@ -41,6 +41,10 @@ function parseArgs(argv) {
|
||||
args.options.colors = parseInt(argv[++i], 10);
|
||||
} else if (a === '--quality') {
|
||||
args.options.quality = parseInt(argv[++i], 10);
|
||||
} else if (a === '--max-width') {
|
||||
args.options.maxWidth = parseInt(argv[++i], 10);
|
||||
} else if (a === '--max-height') {
|
||||
args.options.maxHeight = parseInt(argv[++i], 10);
|
||||
} else if (a === '--output' || a === '-o') {
|
||||
args.options.output = argv[++i];
|
||||
} else if (a.startsWith('--')) {
|
||||
@@ -76,6 +80,8 @@ Options:
|
||||
--type <ALP|ALF> Artemis variant for encoding/convert (default: ALF)
|
||||
--colors <n> Palette size for full-color quantization (default: 256)
|
||||
--quality <n> JPEG quality when output is JPEG (default: 85)
|
||||
--max-width <n> Maximum width to scale input before encoding
|
||||
--max-height <n> Maximum height to scale input before encoding
|
||||
--output, -o <file> Output file path
|
||||
--help, -h Show this help
|
||||
|
||||
@@ -106,9 +112,11 @@ function resolveOutput(inputFile, suggestedExt, override) {
|
||||
async function cmdConvert(inputFile, outputFile, opts) {
|
||||
const ImageBuf = fs.readFileSync(inputFile);
|
||||
const { data, mime } = await WTVImage.ImageToWebTV(ImageBuf, {
|
||||
type: opts.type || 'ALF',
|
||||
colors: opts.colors || 256,
|
||||
jpegQuality: opts.quality || 85
|
||||
type: opts.type || 'ALF',
|
||||
colors: opts.colors || 256,
|
||||
jpegQuality: opts.quality || 85,
|
||||
maxWidth: opts.maxWidth,
|
||||
maxHeight: opts.maxHeight
|
||||
});
|
||||
|
||||
const ext = mime === 'image/gif' ? '.gif' : '.jpg';
|
||||
|
||||
Reference in New Issue
Block a user