Skip to content

Commit

Permalink
feat: anime-girl.svg output avif
Browse files Browse the repository at this point in the history
  • Loading branch information
yisibl committed Oct 25, 2021
1 parent 407d1d1 commit 04d401a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Binary file added example/anime-girl.avif
Binary file not shown.
9 changes: 7 additions & 2 deletions example/anime-girl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ async function main() {

const pngData = await canvas.encode('png')
await fs.writeFile(join(__dirname, 'anime-girl.png'), pngData)

const t1 = performance.now()

console.log('✨ Done in', t1 - t0, 'ms')
const avifData = await canvas.encode('avif')
await fs.writeFile(join(__dirname, 'anime-girl.avif'), avifData)

const t2 = performance.now()

console.log('✨ png done in', t1 - t0, 'ms')
console.log('✨ avif done in', t2 - t0, 'ms')
}

main()

0 comments on commit 04d401a

Please sign in to comment.