Simple image processing and modifying library with limited functionality
npm install qrimznEtymology: qr (QR code) + im (image) + zn (resize) = qrimzn 🎨
!GitHub release (latest by date)
!GitHub
!GitHub issues
!GitHub pull requests
!GitHub contributors
!GitHub stars
!GitHub forks
!GitHub watchers
!GitHub last commit
!GitHub commit activity

A fast image processing library that provides QR code generation with custom labels and image resizing capabilities. The library uses a Go binary under the hood for high performance without requiring native dependencies. 🚀
The go library is called by spawning a child process. After the process is spawned, the child process is killed.
Currently, the library supports very limited functionality. Any contributions are welcome.
- QR Code Generation: Create QR codes with custom content and labels
- Image Resizing: Resize images with aspect ratio preservation
- No Native Dependencies: Unlike Sharp, no additional packages needed for Alpine Linux
- Cross-platform Support: Linux, macOS, Windows
- Multiple Architectures: amd64, arm64
- High Performance: Go binary with optimized image processing
- Memory Efficient: Processes images as streams
- Format Support: Supports JPEG, PNG input; outputs PNG
``bash`
npm install qrimzn
The installation will automatically download the appropriate binary for your platform.
`typescript
import { createQrCode } from "qrimzn";
// Generate a QR code
const buffer = await createQrCode("https://example.com", "ABC12345678");
// Save to file
import fs from "fs";
fs.writeFileSync("qr.png", buffer);
// Or upload to cloud storage, etc.
`
`typescript
import { resizeImage } from "qrimzn";
import fs from "fs";
// Read an image file
const imageBuffer = fs.readFileSync("input.jpg");
// Resize to 400px width (height calculated automatically to maintain aspect ratio)
const resized400 = await resizeImage(imageBuffer, 400);
fs.writeFileSync("output-400.png", resized400);
// Multiple sizes
const sizes = [400, 800, 1200];
const resizedImages = await Promise.all(
sizes.map((width) => resizeImage(imageBuffer, width))
);
// Works with any image format (JPEG, PNG, etc.) - outputs PNG
`
`typescript
// Before (with Sharp - requires native dependencies)
import sharp from "sharp";
const resized = await sharp(buffer)
.resize({ width: 400, withoutEnlargement: true, fit: sharp.fit.inside })
.toBuffer();
// After (with qrimzn - no native dependencies)
import { resizeImage } from "qrimzn";
const resized = await resizeImage(buffer, 400);
`
Generate a QR code with a custom label.
- content: The content to encode in the QR code (typically a URL)code
- : The label text to display below the QR code
- Returns: A Promise that resolves to a Buffer containing the PNG image data
Resize an image while maintaining aspect ratio.
- buffer: Image data as Buffer or Uint8Array (supports JPEG, PNG, and other formats)width
- : Target width in pixels (height is calculated automatically)
- Returns: A Promise that resolves to a Buffer containing the resized PNG image data
Features:
- Maintains aspect ratio automatically
- Never enlarges images (withoutEnlargement: true behavior)
- Uses high-quality BiLinear interpolation
- Memory efficient streaming processing
- No native dependencies required
The Go binary is built automatically using GitHub Actions. To build manually:
`bash`
cd go
go mod tidy
go build -o qrimzn main.go
1. Update version in package.json`
2. Run the build and release script:
bash`
./scripts/release.sh v1.0.0
3. The script will:
- Build binaries for all supported platforms
- Create compressed archives
- Upload to GitHub releases
To test the installation script without publishing:
`bash`
node scripts/install.js
Note: This requires a corresponding GitHub release to exist.
`bash
yarn buildthis will create a tar.gz file in the root folder
npm pack
- Linux: amd64, arm64
- macOS: amd64, arm64
- Windows: amd64
MIT