27 ms·
Even simpler: a 10x10 image is taken and displayed on a 10x10 screen. The upper right 3x3 pixels are zoomed in on to fill the 10x10 screen. Now each 3 pixels a
by thehappypm 5y ago
Even simpler: a 10x10 image is taken and displayed on a 10x10 screen. The upper right 3x3 pixels are zoomed in on to fill the 10x10 screen.
Now each 3 pixels are being shown on 10 pixels. Each pixel is being spread across 3 1/3 display pixels. How does that work?
- AnimalMuppet 5y agoFor each pixel on the display, you derive a (not necessarily integer) pixel coordinate on the original image. The top-left display pixel may be at (0, 0) on the image. The next pixel to the right is at (0, 0.333) on the image. So say you're dealing with the pixel at (0, 1.333). You take the pixels at (0, 0), (0, 1), (0, 2), and (0, 3), and you run a cubic interpolation to find the value at 1.333. (You do this three times, for red, green, and blue). If you're at non-integer coordinates in both directions, then you run an interpolation that is cubic in both directions (that is, a bi-cubic interpolation).
- thehappypm 5y agoTrue, but you’ve just introduced new colors!