Docs · Images
Images
TinyFiles (AT-1) is lossless: whatever image goes in comes back byte-for-byte identical. That single fact decides everything below — including the honest part, that AT-1 is not a replacement for JPEG.
.jpg, .png, .webp or .gif? It won't get much smaller — those are already compressed, and no lossless tool can re-shrink them meaningfully. Raw, scientific, or medical images(BMP, uncompressed TIFF, RAW, FITS, DICOM) — that's where AT-1 wins.What to expect, by image type
| Image | Result | Why |
|---|---|---|
| DICOM (medical) | Real win | Dedicated codec splits metadata from pixels and transforms the raw pixel plane (delta / byte-plane). Byte-exact on the .dcm file. |
| Raw / uncompressed (BMP, RAW, uncompressed TIFF, FITS) | Real win | Pixels are an untouched integer plane — reversible delta/byte-plane transforms expose structure a generic zip misses. |
| Screen captures, charts, synthetic / rendered | Often a win | Large flat regions and repetition compress well losslessly. |
| JPEG, PNG, WebP, GIF, HEIC | ~ ties (little/no size win) | Already entropy-coded. AT-1 stores them byte-exact in a verified, addressable container — value is integrity, not ratio. |
If you need a photo to be smaller than its JPEG, you need lossy re-encoding — that's a different tool. AT-1's job on a JPEG is to keep it exact, verified, and addressable, never to silently degrade it.
Are images searchable?
Not the pixels.AT-1's “query while compressed” works on structured rows and columns — the qcolumnar (tables) and qjson codecs. An image is opaque pixel data, so there's nothing to SELECT … WHERE on. Two practical ways to get search anyway:
- A queryable metadata sidecar. Keep a small table of image attributes (path, timestamp, label, bounding boxes…) as
qcolumnarand search that in place — it points at the stored images. - For video, find-the-moment is built in. The media container lets you locate a moment and pull that exact frame/clip out as a verified artifact.
# Images aren't query-searchable, but a metadata TABLE is. Keep a queryable # sidecar that points at the stored images, and search THAT in place. at1 compress qcolumnar images_index.csv images_index.at1 at1 sql images_index.at1 "SELECT path WHERE label = 7 AND ts > 1704067200"
Compress an image
# auto-detect and compress (lossless — exact bytes back) at1 compress auto scan.bmp scan.at1 at1 decompress scan.at1 scan.bmp # byte-for-byte identical # medical imaging has a dedicated, byte-exact codec at1 compress dicom study.dcm study.at1
Or drag-and-drop in the desktop app. Auto-detect picks the right codec; medical images use the dedicated dicom codec.
In a Python image pipeline
Working with pixels directly (masks, depth maps, scientific frames, sensor captures)? Compress the array losslessly — this is where raw images pay off:
# A raw image is just a pixel array. Compress the array losslessly
# (great for scientific / sensor / mask / depth images).
import numpy as np
from PIL import Image
import at1_optimize as opt # npm i -g @tinyfiles/cli
arr = np.asarray(Image.open("depth.png")) # H x W (x C) integers
blob = opt.compress_array(arr.ravel()) # lossless, never-worse
# ... store blob ...
back = opt.decompress_array(blob).reshape(arr.shape)
assert np.array_equal(back, arr) # exactUse the image in your app
Decoding is free, needs no account, and returns the exact original bytes — from Python, JS, Go, Rust, C, or the browser:
# Use the exact image bytes back in your app
from at1decode import decode
png_bytes = decode(open("logo.at1", "rb").read()) # identical to the original file
open("logo.png", "wb").write(png_bytes)