<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns" -->

---
title: Richard Geldreich's Blog: Neural JPEG artifact reduction...
description: A small neural network reduces JPEG compression artifacts and drops into any C++ program as a filter for decoded 32bpp RGBA images. The model is a 7x7-window...
canonical: https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Richard Geldreich's Blog: Neural JPEG artifact reduction in C++ | daily.dev
og:description: A small neural network reduces JPEG compression artifacts and drops into any C++ program as a filter for decoded 32bpp RGBA images. The model is a 7x7-window...
og:url: https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns
og:image: https://api.daily.dev/og/posts/rhh9QX8Ns.png
og:image:alt: Richard Geldreich's Blog: Neural JPEG artifact reduction in C++
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Richard Geldreich's Blog: Neural JPEG artifact reduction in C++

**[Richard Geldreich's Blog](https://daily.dev/sources/richg42)** · 1 min read · 0 upvotes · 0 comments

## Summary

A small neural network reduces JPEG compression artifacts and drops into any C++ program as a filter for decoded 32bpp RGBA images. The model is a 7x7-window MLP with 52 inputs, including a luma window, block phase and quality factor, with hidden layers of 32 and 16 and leaky ReLU. It has about 2.2k weights stored in a single header file and was trained on an RTX 5090 using libjpeg with a custom training engine. Trained by finite differences on 514 PNGs round-tripped through JPEG at qualities 30 to 95, it gains about 0.95 dB luma PSNR at quality 30, 0.9 dB at 40, and 0.7 dB at 80 on held-out images. It runs about 20 Mpx/s on 32 threads and 1.6 Mpx/s on a single thread.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://richg42.blogspot.com/2026/10/neural-jpeg-artifact-reduction-in-c.html>

## Questions this post answers

### How much PSNR improvement can a small neural network give for JPEG deblocking?

A 7x7-window MLP with 52 inputs gains about 0.95 dB luma PSNR at JPEG quality 30, 0.9 dB at quality 40, and 0.7 dB at quality 80 on held-out images. The model has roughly 2.2k weights, hidden layers of 32 and 16 neurons with leaky ReLU, and was trained by finite differences on 514 PNGs round-tripped through baseline JPEG.

_Evaluating lightweight deblocking models? daily.dev surfaces benchmarks like this for image processing work._

### How fast does a small MLP run for per-pixel JPEG artifact correction in C++?

The MLP-based JPEG deblocking filter processes about 20 megapixels per second across 32 threads, or 1.6 megapixels per second on a single thread. It operates on already decoded 32bpp RGBA JPEG images, using a 7x7 luma window plus the block phase and quality factor as inputs to predict a luma correction.

_Checking throughput numbers like this helps when picking an image filter for a C++ pipeline on daily.dev._

## Similar posts on daily.dev

- [Richard Geldreich's Blog: Neural block texture compression with CUDA](https://daily.dev/posts/richard-geldreich-s-blog-neural-block-texture-compression-with-cuda-9ng8tfvtk) · Richard Geldreich's Blog · 0 upvotes · 0 comments
- [Richard Geldreich's Blog: Mirror of neural texture compression trained with Evolution Strategies](https://daily.dev/posts/richard-geldreich-s-blog-mirror-of-neural-texture-compression-trained-with-evolution-strategies-htyl7imxo) · Richard Geldreich's Blog · 0 upvotes · 0 comments
- [Richard Geldreich's Blog: Fitting a neural texture decoder with ES \(no backprop\)](https://daily.dev/posts/richard-geldreich-s-blog-fitting-a-neural-texture-decoder-with-es-no-backprop--wvfyfjz5v) · Richard Geldreich's Blog · 0 upvotes · 0 comments
- [From Pixels to DNA: Why the Future of Compression Is About Every Kind of Data](https://daily.dev/posts/from-pixels-to-dna-why-the-future-of-compression-is-about-every-kind-of-data-wkpxbpskn) · Towards Data Science · 0 upvotes · 0 comments
- [I built a Python utility using Claude to automate my image editing workflow, and it saves me hours every week](https://daily.dev/posts/i-built-a-python-utility-using-claude-to-automate-my-image-editing-workflow-and-it-saves-me-hours-e-bxb77ra5k) · XDA Developers · 1 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#c++](https://daily.dev/tags/c++), [#neural-networks](https://daily.dev/tags/neural-networks), [#image-processing](https://daily.dev/tags/image-processing)

[View this post on daily.dev](https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Richard Geldreich's Blog: Neural JPEG artifact reduction in C++","url":"https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns"},"datePublished":"2026-10-28T04:46:40.103Z","dateModified":"2026-10-28T05:46:03.058Z","description":"A small neural network reduces JPEG compression artifacts and drops into any C++ program as a filter for decoded 32bpp RGBA images. The model is a 7x7-window...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"Richard Geldreich's Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Richard Geldreich's Blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/c17544cee7eb4611a3d752231aaceeb1","url":"https://daily.dev/sources/richg42"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,c++,neural-networks,image-processing","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Richard Geldreich's Blog","item":"https://daily.dev/sources/richg42"},{"@type":"ListItem","position":3,"name":"Richard Geldreich's Blog: Neural JPEG artifact reduction in C++"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/richard-geldreich-s-blog-neural-jpeg-artifact-reduction-in-c--rhh9qx8ns#faq","mainEntity":[{"@type":"Question","name":"How much PSNR improvement can a small neural network give for JPEG deblocking?","acceptedAnswer":{"@type":"Answer","text":"A 7x7-window MLP with 52 inputs gains about 0.95 dB luma PSNR at JPEG quality 30, 0.9 dB at quality 40, and 0.7 dB at quality 80 on held-out images. The model has roughly 2.2k weights, hidden layers of 32 and 16 neurons with leaky ReLU, and was trained by finite differences on 514 PNGs round-tripped through baseline JPEG. Evaluating lightweight deblocking models? daily.dev surfaces benchmarks like this for image processing work."}},{"@type":"Question","name":"How fast does a small MLP run for per-pixel JPEG artifact correction in C++?","acceptedAnswer":{"@type":"Answer","text":"The MLP-based JPEG deblocking filter processes about 20 megapixels per second across 32 threads, or 1.6 megapixels per second on a single thread. It operates on already decoded 32bpp RGBA JPEG images, using a 7x7 luma window plus the block phase and quality factor as inputs to predict a luma correction. Checking throughput numbers like this helps when picking an image filter for a C++ pipeline on daily.dev."}}]}
```

