Get the latest tech news

Bilinear down/upsampling, aligning pixel grids, and that infamous GPU half pixel (2021)


See this ugly pixel shift when upsampling a downsampled image? My post describes where it can come from and how to avoid those! It’s been more than two decades of me using bilinear texture filterin…

Some parts of it like phase shifting are so tricky that a famous blog post of “magic kernel” comes up every few years and again, experts re(read) it a few times to figure out what’s going on there, while the author simply rediscovered the bilinear! I’ll have a look at the second interpretation of this filter – it’s [0.125 0.375 0.375 0.125] in disguise 🕵️‍♀️, but first with this intro, I think it’s time to make the main claim / statement: we need to be careful to use same reference coordinate frames when discussing images of different resolutions. Which is a double edge sword – both great for an easy entry point for beginners, but also a source of confusion once you start getting deeper into it and analyzing what’s going on or do things like fractional or nearest neighbor downsampling (or e.g. create a non-interpolable depth map pyramid…).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of GPU

GPU

Photo of upsampling

upsampling

Photo of pixel grids

pixel grids

Related news:

News photo

Samsung Galaxy S25 Ultra outperforms iPhone 16 Pro Max in a GPU-intensive benchmark with around 36% lead

News photo

NVIDIA GeForce RTX 5090 Linux GPU Compute Performance Benchmarks

News photo

Pipeshift cuts GPU usage for AI inferences 75% with modular interface engine