SShortSingh.
Back to feed

Adaptive PNG filtering backfired, inflating 7 of 8 test animations by up to 2.4x

0
·1 views

A developer adding adaptive per-scanline filtering to an APNG encoder discovered the feature made seven out of eight test animations larger, with one cicada-molting clip ballooning to 2.41 times its original size. Testing all five PNG filters applied uniformly across every scanline showed that each fixed filter also performed worse than no filtering on the same seven files. The root cause lies in a conflict between how the minimum-sum-of-absolute-differences heuristic selects filters and how DEFLATE compression actually rewards byte repetition. Because the heuristic optimises for low byte magnitude rather than compressibility, it routinely picks filters that break up long runs of identical bytes, hurting DEFLATE. The author concluded that untested optimisation assumptions are effectively guesses, and that a single controlled experiment — forcing one filter constant — revealed what three correlational metrics had failed to show.

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 ·

How Particle Effects Make HTML5 Games Feel More Responsive and Polished

Particle effects are a low-cost technique that can significantly improve how actions feel in HTML5 games, even when the underlying mechanics remain unchanged. Rather than adding more particles, developers are advised to focus on precise timing, with short bursts tied directly to player input proving more effective than prolonged animations. VFX can also serve a functional role by communicating game states such as healing, damage, active objects, or ability cooldowns without relying on extra UI labels. Breaking effects into small, single-purpose components — like impact flashes, sparks, and screen shake — makes tuning easier and keeps the visual language consistent across a game. As particle use scales up, dedicated visual editors that allow real-time adjustments to curves, velocity, and lifetime can help keep effect authoring separate from core gameplay code.

0
ProgrammingDEV Community ·

How Web Forms Evolved: From Plain HTML to AJAX Explained

A developer-focused article traces the historical evolution of web forms, starting from basic HTML structures before JavaScript or React existed. It explains how core HTML attributes like action, method, and name work together to collect and submit form data via HTTP requests. The piece distinguishes between GET and POST methods, noting that GET appends data to URLs while POST sends it in the request body, each suited to different use cases. It also highlights the importance of the name attribute for form submission and the label element for accessibility. This first part of a multi-part series sets the foundation for understanding why modern form libraries like React Hook Form and Zod eventually became necessary.

0
ProgrammingDEV Community ·

A 2006 ICPC Debut: How One Programmer's Embarrassing Contest Became a Lasting Lesson

Nearly 20 years ago, in 2006, a CSE undergraduate at North South University joined his first and only International Collegiate Programming Contest (ICPC) after two friends invited him to form a team. Despite preferring a slow, methodical approach to coding over competitive programming, he agreed to participate as a learning opportunity. Before the main event, all three teammates individually solved two out of three problems in a Topcoder Single Round Match, which they considered a promising warm-up result. The author, who had previously placed third in an intra-university contest during his second semester, had shifted his focus toward math, robotics, and software development rather than competitive programming. He is now sharing the story publicly for the first time, describing a memorable and embarrassing experience from that contest that he believes holds valuable lessons for other programmers.

0
ProgrammingDEV Community ·

DeepSeek Releases Open-Source AI Agent Runtime Built on a Plugin-First Architecture

DeepSeek AI has released DeepSeek Harness (dsh), an open-source agent runtime currently in developer preview under the MIT license. The project provides a ready-to-use environment for building and running coding and automation agents, offering file editing, shell access, web search, sub-agent support, and a web UI out of the box. Built on a plugin framework called Cordis, developed with researchers from Peking University, the system treats every component — including the model adapter, tool registry, and agent loop — as a swappable plugin with no privileged core. The harness is model-agnostic, supporting providers such as Anthropic, OpenAI, AWS Bedrock, Azure, and Google Gemini, alongside DeepSeek's own models. The release highlights a broader industry shift toward treating the agent runtime itself — not just the underlying model — as the primary architectural product.

Adaptive PNG filtering backfired, inflating 7 of 8 test animations by up to 2.4x · ShortSingh