SShortSingh.
Back to feed

Mozjpeg Gives Smaller White-Background JPEGs With Fewer Off-White Pixels Than Pillow or Sharp

0
·14 views

A developer compared Pillow, sharp, and sharp with its mozjpeg option for saving white-background product photos as JPEG. Pillow and default sharp produced identical pixels, while the mozjpeg flag yielded smaller files with fewer stray non-white background pixels at the same quality. None of the encoders kept the background at a pure 255 value across every pixel. The tests were run on three Wikimedia Commons photos using an Apple M4 Mac with Pillow 11.3.0 and sharp 0.34.5. The author found mozjpeg at quality 85 with 4:4:4 sampling roughly matched Pillow at quality 95 in stray-pixel share while using less than half the bytes.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Cross-Border Search Needs More Than Query Translation

Translating a search query once does not make retrieval work across languages, because tokenization, morphology, character normalization and word order all change what documents get matched. Languages such as Chinese, Japanese and Thai are written without spaces, so whitespace splitting turns whole sentences into single unmatched terms. Inflected languages like German, Russian and Arabic need stemming, or plural and case forms will never match each other. The article proposes a three-layer architecture of language-specific analysis, vector alignment and localized ranking, noting that omitting any layer leaves recall gaps in some languages. It also recommends keeping filters such as currency, dates and compliance rules separate from relevance scoring and measuring effectiveness per language rather than in blended averages.

0
ProgrammingDEV Community ·

UUIDv7 Offers Database Speed but Its Embedded Timestamp Is Not a Reliable Clock

UUIDv7 identifiers are gaining favor because they keep database indexes efficient while staying unique without central coordination. Each ID embeds a millisecond timestamp, which means anyone who sees an ID can roughly infer when it was created. A reproduction described in an October 19, 2026 post showed that the embedded time can drift from the real clock, running about an hour ahead after the system clock was set back. The RFC allows implementations to adjust the timestamp, so it should be treated as a hint rather than an accurate record. Developers debate whether exposing this metadata matters, with the author recommending UUIDv7 internally while avoiding exposing it in sensitive public-facing contexts.

0
ProgrammingDEV Community ·

Pre-commit hook fixed to check staged translation files, not working tree

The author's Locale Guard tool, a GitHub Action and CLI for translation files, added a pre-commit hook in version 1.3.0. The first version of that hook checked files on disk, so it approved a commit that held an English key but lacked matching entries in other language files. The fix makes the check read staged content directly from git, so incomplete commits are now blocked. A pre-push hook and the pull request check were also added to catch anything skipped with --no-verify. Demo repositories for Husky and Lefthook are available for testing.

0
ProgrammingDEV Community ·

What spec-driven development is and why AI coding tools are splitting into competing camps

The article explains spec-driven development (SDD), where requirements are written as a clear document that AI agents work from rather than from chat memory. It describes three traits of SDD: specs are version-controlled files, humans approve them before code is written, and every implementation step can be traced back to the spec. The author notes that the real differences between SDD tools lie in how specs relate to verification, not in feature counts. Three maturity levels are outlined: spec-first, spec-anchored, and spec-as-source, each answering differently who judges whether code is correct. The piece is the first part of a series comparing these tools.