Data Engineering

JPEG at quality 92: the boring data engineering choice that made Photoroom's 7B model work

Photoroom releases the fourth part of its PRX model development series, detailing a data pipeline that prioritizes breadth and consistency over per-image perfection. The post reveals that JPEG compression at quality 92 is indistinguishable from PNG for training, and that the fastest captioner won over the most accurate one when scaling to hundreds of millions of images.

Emmanuel Fabrice Omgbwa Yasse

2026-07-06 · 4 min read

JPEG at quality 92: the boring data engineering choice that made Photoroom's 7B model work

Photoroom, the AI-powered photo editing startup, published the fourth installment of its PRX model development blog series, offering a deep, unvarnished look at how they assembled the training data for their open-source 7B diffusion model. The post, PRX Part 4: Our Data Strategy, is a masterclass in pragmatic engineering, where the authors systematically justify each decision against the constraints of scale, compute, and time.

The philosophy: breadth before beauty

The guiding principle for PRX's pre-training is deliberate and somewhat contrarian: avoid over-filtering for aesthetics. Photoroom argues that a broad, representative corpus teaches the model more about the structure of the visual world than a smaller, prettier one, even if many individual images are ordinary snapshots or slightly compressed. "Over-filtering for aesthetics at this stage would actually hurt, narrowing the distribution and costing the model concepts and compositional variety it cannot recover later," the team writes. Fine-tuning and preference alignment, applied on small, ruthlessly curated sets, are reserved for making generations look polished.

Data formats: Lance to build, MDS to stream

The pipeline leans on two complementary data formats. Lance, a columnar format with cheap predicate pushdown and vector search, is used for building and exploring the dataset. Mosaic Data Shards (MDS), from the Mosaic Streaming library, is used for distributed training. The team found MDS to be low-maintenance and performant for distributed training but rigid for feature engineering, hence the two-tier approach. A practical warning: "Don't over-fragment your Lance tables," they note, recounting how overly small fragments (100k rows each) made queries crawl until compaction was run.

JPEG at quality 92: the numbers justify the choice

A notable technical claim is that storing training images as JPEG at quality 92 is essentially imperceptible compared to lossless PNG, even after multiple re-encode cycles. Across repeated cycles on both high-resolution (1, 2 megapixels) and lower-resolution (0.25, 0.5 MP) images, the first re-encode at quality 92 achieved a PSNR of 48.7 dB and 45.1 dB respectively, with LPIPS scores of 0.004 and 0.005. Even after 10 cycles, the degradation remained within the imperceptible range (PSNR 45.4 and 42.2 dB). The team also trained two identical PRX models on the same images, one stored as PNG, one as JPEG, and found the generations "practically indistinguishable." Only about one generation in ten from either showed any detectable quantization structure, and the differences were small. The conclusion: high-quality JPEG storage adds nothing measurable on top of what the sources already carry, while PNG would be 3, 10x larger for no perceptual gain.

Re-captioning everything: speed over metrics

Photoroom re-captioned every image in the corpus using a vision-language model, rather than relying on inconsistent source captions. They shortlisted three candidates: Qwen2.5-VL-7B-Captioner-Relaxed, Qwen3-VL-8B, and Qwen3.5-9B. In benchmarks, Qwen3.5-9B was best on all three metrics (FID 10.51, CMMD 0.278, DINO-MMD 0.162), with Qwen3-VL-8B close behind on FID (10.98) and DINO-MMD (0.182). However, the team chose Qwen3-VL-8B because it was the fastest (20 images per second per H200 GPU) and had stable, release-grade vLLM support. Qwen3.5-9B, despite producing great captions, ran at only about 6.5 images per second and required unstable nightly dependency builds at the time. The post confesses that the Qwen2.5-VL "Relaxed" captioner actually reaches the same 20 img/s once a bug was fixed, but that came to light only later.

Filtering and deduplication: lightweight and reversible

The team built a lightweight classification pass using Qwen3-8B in text-only mode, which reads each caption to label samples as "visual," "text," or "nsfw." Classifying from the caption rather than the pixels is cheap, around 200 captions per second per GPU, and reused work already done. For deduplication, they used a standard DCT-based perceptual hash. Only exact pixel-level duplicates (Hamming distance zero) are removed. Genuinely different shots of the same subject are kept. Instead of rewriting the corpus, all filtered-out and duplicate samples are handled via per-shard skip lists, a flexible mechanism that also accommodates user opt-outs without rewriting the dataset. The one warning: once the skipped fraction exceeds roughly 10%, it becomes worth rewriting the dataset.

Outsider implications

Photoroom's data strategy is not the work of a giant lab. It is a measured, iterative approach by a startup that open-sourced a 7B text-to-image model under Apache 2.0. The decisions, JPEG over PNG, fastest captioner over best metrics, skip lists over rewrites, are all about trading perfection for velocity. The post is a rare glimpse into the real, unglamorous data engineering that underpins modern diffusion models. The series promises future posts on fine-tuning and preference alignment, where the trade will flip from breadth to quality.