|
|
@@ -5,7 +5,7 @@ const path = require('path')
|
|
|
|
|
|
async function main() {
|
|
|
const tiffPath = path.resolve(__dirname, '../de99928f1689454084d1af33ec3cc155.tif')
|
|
|
- const outPath = path.resolve(__dirname, '../public/de99928f-preview.png')
|
|
|
+ const outPath = path.resolve(__dirname, '../public/de99928f-preview.webp')
|
|
|
|
|
|
if (!fs.existsSync(tiffPath)) {
|
|
|
console.error('TIFF not found:', tiffPath)
|
|
|
@@ -46,7 +46,7 @@ async function main() {
|
|
|
console.log('Black pixels masked:', blackCount)
|
|
|
|
|
|
await sharp(rgba, { raw: { width: targetW, height: targetH, channels: 4 } })
|
|
|
- .png({ compressionLevel: 9, adaptiveFiltering: true })
|
|
|
+ .webp({ quality: 85, alphaQuality: 100, effort: 6 })
|
|
|
.toFile(outPath)
|
|
|
|
|
|
console.log('Saved:', outPath)
|