NumPy Logic · Browser Execution

Compress images,
recursively.

A visual tool that shrinks images by averaging 2x2 pixel blocks, and reconstructs them using nearest-neighbor or bilinear interpolation.

Open Workspace ↓
Upload Image

Drag & Drop your image

Supports JPG, PNG, WEBP, and BMP

01 — Features

Four functions.
One pipeline.

🗜️

compress_one_level()

Shrinks image by half recursively. Averages every 2x2 block into 1 single pixel. Works natively with grayscale and RGB/RGBA images.

🔍

decompress_one_level_nearest()

Lightning-fast scaling. Copies each pixel into a 2x2 block, generating a highly stylized, blocky/pixelated retro result.

🖼️

decompress_one_level_bilinear()

Interpolates between neighboring pixels mathematically, returning a smoother, blended upscaled image resembling standard resize functions.

📊

psnr()

Measures reconstruction quality using Peak Signal-to-Noise Ratio (PSNR), allowing analytical comparison of quality loss.