Better random avatars quality.

This commit is contained in:
John Livingston
2022-01-07 11:29:20 +01:00
parent 377c842c23
commit 1e27debb7d
2 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,6 @@ for (let i = 1; i <= count; i++) {
for (let j = 0; j < backgrounds.length; j++) {
const out = i + (count * j)
const background = backgrounds[j]
sharp(inputFile).flatten({background}).resize(120, 120).jpeg().toFile(path.join(outputDir, out.toString() + '.jpg'))
sharp(inputFile).flatten({background}).resize(120, 120).jpeg({quality: 95, mozjpeg: true}).toFile(path.join(outputDir, out.toString() + '.jpg'))
}
}