Pekka Väänänen
banner
pekkavaa.bsky.social
Pekka Väänänen
@pekkavaa.bsky.social
Avid reader, computer graphics fan and atmospheric jungle beats enjoyer. Demoscene: cce/Peisik.

Blog at https://30fps.net/
Pinned
Some of you might know that I've been working on a book. Today I'm happy to announce

Palette Programming: A Modern Guide to Color Quantization
paletteprogramming.com

It's a textbook on how to design palettes and represent images using them. Will be out this year. Code in Python & NumPy.
Surprisingly, my result looks better than the GIMP's original (attached) even though I used the same palette. The biggest difference is that I do closest color lookups in linear sRGB and they in CIELAB. Perhaps that works better for this image?
February 4, 2026 at 8:32 AM
I tried imitating GIMP's "reduced color bleed" addition to Floyd-Steinberg dithering and it works! Maximum error offset allowed for a pixel gets clamped with a tanh-like function, hiding individual high-contrast pixels in solid regions. The clamping function is shown in green in the attached plot.
February 4, 2026 at 8:32 AM
My first Floyd-Steinberg dithering routine! Still looks a bit broken. I've understood dithering should be done in the linear color space of the display device but with big pixels maybe that's not the best idea. At least the first bird Really Pops. The third was the first 2x2 matrix test.
February 2, 2026 at 8:32 AM
...Molez 2?!
February 1, 2026 at 9:23 PM
I've resorted to using VLC's iOS app's network share feature for this (on Linux). It's finicky but works in my home wifi.
February 1, 2026 at 9:22 PM
Reposted by Pekka Väänänen
I discovered something interesting in the MSX2 version of Pac-Mania. The game has an isometric perspective just like the arcade original, but it first loads the background with an orthogonal perspective and then applies a shear effect to it in VRAM. The original simply loads pre-sheared tiles. #msx
February 1, 2026 at 6:41 PM
Sure, color perception is too complex for a viewer's subjective experience to be losslessly compressed to a 3D point. Perhaps Oklab's usefulness comes from the fact it's optimized for gradients on a neutral solid-color backgrounds which often occur in graphic design.

I'll read the paper. Thanks!
January 31, 2026 at 8:06 PM
Reposted by Pekka Väänänen
Awesome writeup on the power of pre-splitting for producing high-quality BVHs:
github.com/BoyBaykiller...
One interesting quote: "You may notice PreSplitting improves performance but increases the SAH cost. SAH is not a perfect predictor of performance."
GitHub - BoyBaykiller/IDKEngine: OpenGL Toy-"Engine" with Wavefront Path Tracer and Rasterizer with Voxel Cone Tracing/Global Illumination
OpenGL Toy-"Engine" with Wavefront Path Tracer and Rasterizer with Voxel Cone Tracing/Global Illumination - BoyBaykiller/IDKEngine
github.com
January 29, 2026 at 12:40 PM
Hey thanks for this recommendation. I really loved Vermis and had managed missed this release! Looks sick.
January 23, 2026 at 5:20 PM
I'm starting to get attached to these fast & loose diagram sketches I'm doing for my book. But redrawing them as clean vector art allows easier editing so it's worth the trouble.
January 22, 2026 at 8:32 AM
Interesting how aliasing and dithering combine for a coherent look without any visible banding or patterns.
January 21, 2026 at 8:03 PM
Why is that?
January 19, 2026 at 9:29 AM
And it plays well on the controller too! We had an arcade cabinet with Liero on it in uni (of course), so I knew it would work.
January 18, 2026 at 11:37 AM
Glad to hear that:) There's still a ton of work left but I plan to put it on early access when there's enough material ready.
January 18, 2026 at 11:20 AM
Here's a little project I've been working on: Liero64 - a port of the 1998 MS-DOS game for the Nintendo 64.

Gameplay video: youtu.be/aemLngAjEi8
ROM: codeberg.org/pekkavaa/Lie...
[N64] Liero64 Gameplay
The classic 1998 MS-DOS game Liero is now on the Nintendo 64! This video shows me (left) playing against the CPU opponent (right). Download the ROM at…
youtu.be
January 18, 2026 at 11:17 AM
Super clean!
January 14, 2026 at 8:52 PM
Reposted by Pekka Väänänen
screenshots of the startmap I built for qbj3 or Quake Brutalist Jam III
some fancy bits in here will be in the coming update, like the paintings and plaques
January 11, 2026 at 9:52 PM
A comparison of the Pillow library's Maximum Coverage color quantizer settings. A palette that works well for dithering may not look great on its own. Here the top result has garish colors but when it's used when dithering (second from top), it's actually quite OK.
January 12, 2026 at 8:32 AM
Reposted by Pekka Väänänen
Built a palette extractor that thinks like a curator, not a pixel counter.

– Physics-based color repulsion
– Auto-detects muted vs vibrant bias
– Adaptive spacing to hit target count
– OKLCh color space (perceptually uniform)

Early Access: please break it!

chipper-otter-d6c600.netlify.app
January 8, 2026 at 7:51 PM
Or like this😀

curl 'https://buttondown.com/api/emails/embed-subscribe/pekkavaa' \
-X POST \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
-H 'Referer: bsky' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw 'email=hack%40thepentagon.biz'
January 7, 2026 at 3:16 PM
I put a NumPy guide sample chapter online: paletteprogramming.com/files/palett...
It shows the style I'm after and is a nice standalone read too :)

Interested? You can join the waiting list on the website or at buttondown.com/pekkavaa?tag...
paletteprogramming.com
January 7, 2026 at 3:13 PM
The palette design theme is a good excuse to talk about algorithms, numerical programming, clustering, and color science. Some related articles on my website:

30fps.net/pages/better...
30fps.net/pages/approx...
30fps.net/pages/hyab-k...
Better sRGB to greyscale conversion
30fps.net
January 7, 2026 at 3:13 PM
Some of you might know that I've been working on a book. Today I'm happy to announce

Palette Programming: A Modern Guide to Color Quantization
paletteprogramming.com

It's a textbook on how to design palettes and represent images using them. Will be out this year. Code in Python & NumPy.
January 7, 2026 at 3:13 PM
I was interested in how the figures are presented but now I found a free PDF :) Thanks for the offer!
December 27, 2025 at 2:47 PM
Reposted by Pekka Väänänen
a couple 3D aabb tricks:

gpfault.net/posts/aabb-t...
A Couple 3D AABB Tricks
gpfault.net
December 24, 2025 at 7:55 AM