npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cavif-bin

v0.3.0

Published

cavif bin-wrapper that makes it seamlessly available as a local dependency

Downloads

19

Readme

cavif-bin

cavif bin-wrapper that makes it seamlessly available as a local dependency

I hope that this package will be part of the imagemin plugins as an imagemin-avif WIP

About AVIF

AVIF offers significant compression gains vs. JPEG and WebP, with a recent Netflix study showing 50% savings vs. standard JPEG and > 60% savings on 4:4:4 content

Underhood

cavif-bin use cavif v0.6.6 with BSD 3-Clause License and Copyright (c) 2020, Kornel, as a AVIF coder.

Encoder options

| Option | Description | | ------ | ----------- | | --quality=n | Quality from 1 (worst) to 100 (best), the default value is 80. The numbers have different meaning than JPEG's quality scale. Beware when comparing codecs. | | --speed=n | Encoding speed between 1 (best, but slowest) and 10 (fastest, but a blurry mess), the default value is 1. Encoding of AVIF is pretty slow, so you need either a) beefy multicore machine b) avoid large images c) patience. | | --overwrite | Replace files if there's .avif already. By default existing files are left untouched. | -o path | Write output to this path instead of samefile.avif. If multiple input files are specified, it's interpreted as a directory. | | --quiet | Don't print anything during conversion. | | --premultiplied-alpha | Warning: currently incompatible with libavif. Improves compression of transparent images by clearing RGB of fully transparent pixels and lowering quality of semi-transparent colors. | | --dirty-alpha | Don't change RGB values of transparent pixels. By default irrelevant color of transparent pixels is cleared to avoid wasting space. | | --color=rgb | encode using RGB color space instead of YCbCr color space. Makes color closer to lossless, but makes files larger. |

Install

npm install cavif-bin

Usage

const {execFile} = require('child_process');
const cavif = require('cavif-bin');

execFile(cavif, ['input.png','--quality=74', '-o', 'output.avif'], err => {
  if (err) throw err;
  console.log('Image is converted!');
});

CLI

You can install cavif globally.

npm install --global cavif-bin

And use it as a CLI command.

cavif --help

AVIF browsers support

  • Chrome Desktop 85+
  • Firefox 63+ (with media.av1.enabled activated)
  • Firefox for Android 64+ (with media.av1.enabled and media.av1.use-dav1d activated)
  • Edge 18+ (with AV1 Video Extension installed)

License

MIT © nucliweb