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 🙏

© 2025 – Pkg Stats / Ryan Hefner

webp-encoder-wasm

v0.1.1

Published

WebP encoder compiled to WebAssembly

Readme

webp-encoder-wasm

Ref: https://github.com/GoogleChromeLabs/squoosh/tree/dev/codecs/webp/enc

Install:

npm i webp-encoder-wasm

Usage:

(async () => {
  webpModule = await moduleFactory({
    locateFile: () => 'https://unpkg.com/webp-encoder-wasm/webp_enc.wasm',
  });
  
  // image Uint8Array, width number, height number

  webpModule.encode(image, width, height, {
    quality: 75, // 0~100: 인코딩 품질. 값이 높을수록 품질은 좋으나 파일 크기는 커짐.
    target_size: 0, // 목표 파일 크기(바이트 단위). 0이면 목표 크기를 적용하지 않음.
    target_PSNR: 0, // 목표 PSNR(Peak Signal-to-Noise Ratio). 0이면 PSNR 기준을 무시함.
    method: 0, // 0(최속)부터 6(최고 품질)까지: 인코딩 알고리즘의 탐색 깊이와 최적화 정도. 값이 높을수록 느리지만 최적화가 더 잘됨.
    sns_strength: 50, // Spatial Noise Shaping 강도. 값이 높을수록 노이즈 셰이핑을 강하게 적용하여 품질을 개선하지만, 연산량 증가.
    filter_strength: 60, // 디블럭(아티팩트 제거) 필터 강도. 높을수록 강한 필터링을 적용하지만 처리 시간이 늘어남.
    filter_sharpness: 0, // 필터의 날카로움(Edge Preservation) 조절. 값이 높으면 가장자리 보존 효과가 강해짐.
    filter_type: 1, // 사용되는 필터의 타입(예: 0 또는 1). 각각 속도와 품질에 미세한 차이를 줄 수 있음.
    partitions: 0, // 이미지 파티션 분할 정도. 값이 높을수록 이미지가 세분화되어 최적화되지만 속도가 느려질 수 있음.
    segments: 4, // 이미지 세그먼트 수. 각 세그먼트에 대해 서로 다른 압축 파라미터를 적용할 수 있음.
    pass: 1, // 인코딩 최적화를 위한 반복 횟수. 여러 번의 패스는 결과를 개선하지만 인코딩 시간이 늘어남.
    show_compressed: 0, // 인코딩 과정 중 압축 결과를 출력하거나 디버깅 정보를 표시할지 여부.
    preprocessing: 0, // 인코딩 전 이미지에 전처리(예: 노이즈 제거, 스무딩) 필터를 적용할지 여부.
    autofilter: 0, // 필터 강도를 자동으로 조정하는 기능 활성화 여부. 0이면 수동 설정 사용.
    partition_limit: 0, // 파티션 수의 상한 제한. 0이면 제한 없이 기본값 사용.
    alpha_compression: 0, // 알파(투명도) 채널에 대해서도 압축을 적용할지 여부.
    alpha_filtering: 0, // 알파 채널에 대해 디블럭 필터링(또는 유사 필터링)을 적용할지 여부.
    alpha_quality: 100, // 알파 채널 압축 품질 (0~100). 100은 최대 품질을 의미함.
    lossless: 0, // 손실 없는(lossless) 압축 여부. 0이면 손실 압축을 사용.
    exact: 0, // lossless 모드에서 원본과 정확히 일치하도록 압축할지 여부.
    image_hint: 0, // 이미지의 유형(예: 사진, 그림, 텍스트 등)에 대한 힌트를 제공. 0은 기본값.
    emulate_jpeg_size: 0, // 인코딩 시 JPEG와 유사한 파일 크기 특성을 흉내내도록 할지 여부.
    thread_level: 1, // 멀티스레딩 사용 수준. 0이면 단일 스레드, 1 이상의 값은 병렬 처리(단, 환경에 따라 지원 필요).
    low_memory: 1, // 저메모리 모드 활성화 여부. 1이면 메모리 사용량을 줄이기 위한 최적화 적용(속도 저하 가능).
    near_lossless: 100, // near-lossless 압축 정도. 값이 높을수록 원본에 가까운 압축을 수행.
    use_delta_palette: 0, // 델타 팔레트 기능 사용 여부(색상 최적화). 0이면 사용하지 않음.
    use_sharp_yuv: 0, // YUV 변환 시 더 선명하게 처리할지 여부. 0이면 기본 처리 방식 사용.
  });
})();