From 6dc5773a4ee2e324f207a69ca044d52767331e48 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 18 Oct 2026 16:08:09 +0200 Subject: [PATCH] Drawing a page: name the decoders, as render's README does This page still said a JPEG is decoded by the standard library, which stopped being true when go-images/jpeg was forked; render's README had been corrected (#107) and this page had not. The README's decoder table is now here too, and the JPXDecode row says what the jpeg2000 fork does, including v0.13.7: a lossless decode 2.4x faster on amd64 (638 -> 269 ms for 1080p, jpeg2000#34). render v0.68.0 carries it. Co-Authored-By: Claude Opus 5.5 --- content/working-with-a-file/rendering.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/content/working-with-a-file/rendering.md b/content/working-with-a-file/rendering.md index 9b9e300..f5a30d7 100644 --- a/content/working-with-a-file/rendering.md +++ b/content/working-with-a-file/rendering.md @@ -27,8 +27,19 @@ XObjects with their own matrix, box and resources. Images at every bit depth and colour space, with a `/Decode` array, as one-bit stencils painted in the colour in force, and with either kind of -transparency. A JPEG is decoded by the standard library; a format nothing -here reads is left undrawn rather than drawn wrong. +transparency. A format nothing here reads is left undrawn rather than drawn +wrong. Which decoder runs is part of what is drawn, so it is named: + +| filter | decoder | +|---|---| +| `/DCTDecode` | [`go-images/jpeg`](https://github.com/go-images/jpeg), Go's own `image/jpeg` with one change: a four-component picture's chroma is upsampled the way libjpeg does, not by repeating each sample | +| `/JPXDecode` | [`go-images/jpeg2000`](https://github.com/go-images/jpeg2000), a fork that reads a CMYK file as ink, and decodes a lossless picture 2.4× faster on amd64 than it did before v0.13.7 | +| `/JBIG2Decode` | `go-gfx/gfx/codec`, where the fleet keeps its image decoders | +| `/CCITTFaxDecode`, `/FlateDecode`, `/LZWDecode`, `/RunLengthDecode` | `go-pdfkit/reader`, which runs them to samples | + +This page used to say that a JPEG is decoded by the standard library. That +stopped being true when the `jpeg` fork was taken, and render's README had +already been corrected. Text from an embedded **TrueType**, **OpenType**, **bare CFF** or **PostScript Type 1** program, from a composite font addressed by character