Packbits
PackBits implementation in JavaScript.
Install / Use
/learn @fiahfy/PackbitsREADME
<!-- markdownlint-disable MD024 -->
packbits
PackBits implementation in JavaScript.
Installation
npm install @fiahfy/packbits
Usage
Default
Encoding
import { encode } from '@fiahfy/packbits'
console.log(buf) // <Buffer aa bb bb cc cc cc dd dd dd dd>
const encoded = encode(buf)
console.log(encoded) // <Buffer 00 aa ff bb fe cc fd dd>
Decoding
import { decode } from '@fiahfy/packbits'
console.log(buf) // <Buffer 00 aa ff bb fe cc fd dd>
const decoded = decode(buf)
console.log(decoded) // <Buffer aa bb bb cc cc cc dd dd dd dd>
ICNS format
In Apple Icon Image format, pixel data are often compressed (per channel) with a format similar to PackBits.
Encoding
import { encode } from '@fiahfy/packbits'
console.log(buf) // <Buffer aa bb bb cc cc cc dd dd dd dd>
const encoded = encode(buf, { format: 'icns' })
console.log(encoded) // <Buffer 02 aa bb bb 80 cc 81 dd>
Decoding
import { decode } from '@fiahfy/packbits'
console.log(buf) // <Buffer 02 aa bb bb 80 cc 81 dd>
const decoded = decode(buf, { format: 'icns' })
console.log(decoded) // <Buffer aa bb bb cc cc cc dd dd dd dd>
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
