A pixel is not a little square, revisited

How does the translation from point values in the file to blobs of colour on a screen covering a 2D area happen? I've never really thought about this before beyond just vaguely imagining that the area of the output medium is simply divided by the number of pixels, creating a grid of small squares each of which is simply filled with a constant colour representing the number in the file for that location. But if you did it this way, you would end up with a grid of little squares with sharp transitions between the value of one square and the value of neighbouring squares.

Is that really what happens or do the reconstruction algorithms somehow smoothly blend the edges of neighbouring squares into one another so there are no sharp edges?
Jim can explain the details; here are some broad strokes: when you see little squares (or big ones when you zoom in) it's because the software is using nearest-neighbor interpolation to turn the pixel data into an image. Most computer display engines use this. It's clunky and bad looking, but uses very little processing power. It can also help you by giving a visual cue that you've exceeded 100% magnification on screen.

When you care what things look like, you use a more sophisticated algorithm. Bicubic interpolation creates a smooth curve between values. It doesn't create new detail, but it gives smooth and natural transitions between tones. You will not see little boxes.

There are many other interpolation algorithms; I don't know which ones are relevant to photographers.
Do you have any examples of programs which can let you infinitely zoom in without revealing a grid pattern? Just been trying out big zoom ratios in my main editor, darktable. It allows zoom up to 1600%. At this scale, there are definitely signs of small coloured squares making up the image. Assuming this is an artefact of nearest neighbour, is there anything I can use that is readily available that doesn't degrade to squares?
No, but you can easily see the result just by upsampling the image in photoshop. Make an image 2X or 4X as big (in terms of linear pixel dimensions. Compare the different interpolation algorithms that are available. Nearest-neighbor is one; it will give the familiar boxes. The others won't.
ps

With respect to printing, the base level must be the smallest dots the print head can put on the paper. I know ink spread helps disguise the dottiness, as does partial overlapping of the dots. You never see square pixels on a print, just ink blobs, yet I often read that images enlarged beyond reason lead to "pixelated" prints. I've not seen that on one of my own prints, what does this actually mean?
Right, you won't see pixelated prints, because the print driver interpolates things differently. But don't mistake the ink dots for pixels; each pixel is represented by many dots. Lots of math and proprietary engineering goes into the quasi-stochastic arrangement of dots, in order to keep the tones smooth and the dot clusters as invisible as possible.
 
Right, you won't see pixelated prints, because the print driver interpolates things differently. But don't mistake the ink dots for pixels; each pixel is represented by many dots. Lots of math and proprietary engineering goes into the quasi-stochastic arrangement of dots, in order to keep the tones smooth and the dot clusters as invisible as possible.
The basics were laid out in the 80's:

Ulichney, Robert. Digital Halftoning. Cambridge, MA: MIT Press, 1987.
 
b12fbc3c457d4777bb5db17a3e6ceab8.jpg.png





acce11cf7306451fa15ff3465a822753.jpg.png

27ed3cadacca42f696e1d4d7530056a2.jpg.png

370592ccbe2e4aba858b100265b7ab39.jpg.png

cd2c80a0cb5148a2835b13017f016b74.jpg.png

726a861890024059aacdade6513a2b66.jpg.png

60241119ee7c4b228e9bfe07b2a23c29.jpg.png

8aa021420b554bac87b7d19104aad74e.jpg.png

d1f0a18187274aeea7f8be6571717df8.jpg.png

fa3abb93e1014b938549cdcf3c8e34c5.jpg.png

3eb9def038c94cf482f077a84fac2a7f.jpg.png

The reconstruction method is in the title to the mddle pane of the graphs.

--
https://blog.kasson.com
 
Last edited:
Hi,

We do that fairly often for T-shirt printing. Halftoned photographs. At 72 PPI. Yah, not hi res by any thinking. But it fits for large quantity printing. Such as hundreds of shirts for a memorial event.

We can print at 200 shirts an hour on the automatic press. Compare that to the Direct To Garment inkjet printer which is an Epson engine at 300 PPI. So more like what we are used to on paper. That does six shirts an hour. Higher res and a far nicer print. If you don't want a large quantity.

Plus the screenprinting ink holds up for hundreds of washings. The DTG maybe a dozen. The Epson engine puts almost no ink down by comparison. And T-shirts are a lousy substrate. I prefer using the DTG for quilting blocks. Which is what I bought the Pentax 645D to do back in 2020.

There is a lot more to the printing side above and beyond the capture and processing sides.

Oh, and one screen on the press for B&W. Four or Six for color (CYMK alone or add OG). And it is an eight head press. Each shirt revolves in a sequence and so gets all heads stroked at once. Once all pallets are loaded with shirts, it is one blank on, one fully done off, each index.



Screenprinting Shop
Screenprinting Shop

The blue thing is the automatic press. The red thing is the conveyor dryer to literally melt the ink into the fabric. The silver thing is the manual press for easier, simpler, jobs. Seen here with Beer Is My Friend. The back print for a local brewery. ;)

That is my wife's business, BTW. My job is keeping that equipment percolating. And what we call Dryer B1tch on large jobs. That is catching the shirts off the far end, folding and boxing them. There is the game played by the loader and unloaded. Overrun Stan. :P

Stan

--
Amateur Photographer
Professional Electronics Development Engineer
 
I beg to differ. I created a 1-pixel image in Photoshop and then zoomed in with an electron microscope. This is what I see:

65d55818a6b04502b8227a9cacb0b0a8.jpg.png

;-)
 
One of the more misleading habits encouraged by modern image editors is the belief that the pixel-level view, the grid of colored squares you see when you zoom in to 100 percent or beyond, represents something physically meaningful or visually optimal. It does not. That view is a diagnostic aid, not an aesthetic or technical goal. The colored squares are artifacts of the display system’s nearest-neighbor reconstruction, not the actual structure of the image. Judging an image at that level tempts photographers to fix problems that do not exist in the continuous image and to pursue spurious sharpness that will not survive proper resampling or printing.

The most common result is oversharpening. When the viewer sees slightly soft or blended transitions between those squares, the natural impulse is to increase sharpening until each boundary looks crisp. But those boundaries are not features of the image. They are artifacts of the display. Sharpening adjusted to make the pixel grid look snappy exaggerates high-frequency components that lie above the sensor’s sampling limit, creating halos, false textures, and brittle-looking detail. These effects may look dramatic when magnified on screen, but they degrade the photograph when viewed at its intended size.

Another problem is that the pixel grid’s hard-edged representation exaggerates noise and demosaic artifacts, encouraging needless denoising or selective blur. The photographer ends up optimizing the image for the wrong domain, the screen’s grid of samples, rather than for the continuous image that will eventually be reconstructed, resized, and printed. The cure is to evaluate images at an appropriate viewing scale, ideally one that matches the intended print or display size and resolution. Only then do sharpening, noise reduction, and tonal adjustments correspond to what will be seen in the finished photograph, not to the misleading staircase pattern of a zoomed-in pixel view.
 
...
The cure is to evaluate images at an appropriate viewing scale, ideally one that matches the intended print or display size and resolution. Only then do sharpening, noise reduction, and tonal adjustments correspond to what will be seen in the finished photograph, not to the misleading staircase pattern of a zoomed-in pixel view.
Through some math and a lot of trial and error I found that 50% screen magnification helps me make the best the decisions. This is with a 109ppi monitor and 360ppi prints, viewed up close. I'm sure if you changed any of these variables, you'd want a different magnification.
 
That view is a diagnostic aid, not an aesthetic or technical goal. ...

... Judging an image at that level tempts photographers to fix problems that do not exist in the continuous image and to pursue spurious sharpness that will not survive proper resampling or printing.

the pixel grid’s hard-edged representation exaggerates noise and demosaic artifacts, encouraging needless denoising or selective blur.
This is why it matters, why we should care, and why shifting thinking will help. Opening with "How 'pixel peeping' causes photographers to ruin images" and working through "why they're not tesserae" would make the topic accessible to more people. ,
 
Last edited:
A pixel is not a little colored tile. It is a number ... that represents a sample taken from an underlying continuous image. [...]

A better way to think of pixels is as infinitesimal points on a smooth landscape.
Good post Jim, true of both the input and output chains. When the continuous image on the sensing plane is digitized we can envision pixels as infinitesimal points, as opposed to little squares, on a smooth(er) landscape.

'Smoother' because the effective pixel active area (its aperture) acts like a smoothing filter on the image projected by the lens on the sensing plane. Pixel aperture can be any shape but in the recent past it could often be considered to be in the shape of a pillow.

Sampling then corresponds to picking the intensity of the smoothed image at an infinitesimally small spot in the very center of the pixel aperture. Here is an example showing two imaged points of light on the sensing plane before capture by the sensor (left) and after (right):

Left: image projected by lens on focal plane, highly magnified. Right: same image smoothed by pixel aperture with 100% Fill Factor; the infinitesimal red dots indicate the intensity that will be written as Data Numbers to the raw file, up to some gain.
Left: image projected by lens on focal plane, highly magnified. Right: same image smoothed by pixel aperture with 100% Fill Factor; the infinitesimal red dots indicate the intensity that will be written as Data Numbers to the raw file, up to some gain.

It is easy to show that summing all the photons that fall on an effective pixel active area is the same as convolving their intensity on the sensing plane before the sensor with pixel aperture, then picking the value of the intensity of the smoothed image at the very center of the respective pixel aperture.

So captured values indeed correspond to a grid of infinitesimal points picked off the continuous image projected by the lens after smoothing by pixel aperture. The larger the pixel aperture, the more the smoothing, and vice versa.

Jack
 
Last edited:
One of the more misleading habits encouraged by modern image editors is the belief that the pixel-level view, the grid of colored squares you see when you zoom in to 100 percent or beyond, represents something physically meaningful or visually optimal. It does not. That view is a diagnostic aid, not an aesthetic or technical goal. The colored squares are artifacts of the display system’s nearest-neighbor reconstruction, not the actual structure of the image. Judging an image at that level tempts photographers to fix problems that do not exist in the continuous image and to pursue spurious sharpness that will not survive proper resampling or printing.

The most common result is oversharpening. When the viewer sees slightly soft or blended transitions between those squares, the natural impulse is to increase sharpening until each boundary looks crisp. But those boundaries are not features of the image. They are artifacts of the display. Sharpening adjusted to make the pixel grid look snappy exaggerates high-frequency components that lie above the sensor’s sampling limit, creating halos, false textures, and brittle-looking detail. These effects may look dramatic when magnified on screen, but they degrade the photograph when viewed at its intended size.

Another problem is that the pixel grid’s hard-edged representation exaggerates noise and demosaic artifacts, encouraging needless denoising or selective blur. The photographer ends up optimizing the image for the wrong domain, the screen’s grid of samples, rather than for the continuous image that will eventually be reconstructed, resized, and printed. The cure is to evaluate images at an appropriate viewing scale, ideally one that matches the intended print or display size and resolution. Only then do sharpening, noise reduction, and tonal adjustments correspond to what will be seen in the finished photograph, not to the misleading staircase pattern of a zoomed-in pixel view.
 
Hi,

Exactly. Spot on.

This goes back to earlier threads regarding Hi Res monitors. Where my PoV has always been to do very little work based on the computer display and then print an 8X10 and go from there with any additional processing.

Of course there are folks who never print and always view their photos on screen.

Stan
 
A pixel is not a little colored tile. It is a number ... that represents a sample taken from an underlying continuous image. [...]

A better way to think of pixels is as infinitesimal points on a smooth landscape.
Good post Jim, true of both the input and output chains. When the continuous image on the sensing plane is digitized we can envision pixels as infinitesimal points, as opposed to little squares,
TBH this discussion of how we envisage it is a lot less helpful than Jim's post "consequences of this confusion"

As I said above there is the "rain falling into buckets" analogy. The bucket has an area - like a photoreceptor - in which raindrops (photons) land. We are interested in the amount of water (charge) resulting from the rainfall (light). We can pour the water into a measuring vessel or we could use a dipstick - it doesn't much which but we get one number per bucket. Ditto we get one number per receptor.

NOW: some people will think of "Pixel" as the bucket, a little square (or circle or any shape we like) we say a sensor is "50 megapixels because" it is divided into 50 million little squares. IF we stop there, we only have instructions for building a mosaic when we come to turn those readings back into something we can see.
On the other hand IF we say 50 million pixels is 50 million samples ... it opens the door to more intelligent processing into ink dots or screen dots. If we only ever think of them of instructions for placing 50Million tesserae it leads to doing daft things during processing.
So captured values indeed correspond to a grid of infinitesimal points
If people find that correspondence helpful, all well and good. I'm of the view that force fitting things into mental models doesn't always help.
 
Last edited:
A pixel is not a little colored tile. It is a number ... that represents a sample taken from an underlying continuous image. [...]

A better way to think of pixels is as infinitesimal points on a smooth landscape.
Good post Jim, true of both the input and output chains. When the continuous image on the sensing plane is digitized we can envision pixels as infinitesimal points, as opposed to little squares,
TBH this discussion of how we envisage it is a lot less helpful than Jim's post "consequences of this confusion"
I suppose that now would not be a good time to bring up the z transform.
 
Alvy Ray Smith wrote a wonderful white paper when he was working for Microsoft. The title was “A pixel is not a little square.” I have referred people to it many times over the years, but for some it just doesn’t click. I think that’s because Smith’s audience was graphics engineers, not photographers. So here is my crack at the same subject matter, but aimed at photographers. I'm doing this because it has been apparent to me over the last couple of weeks that some people on this forum are having a hard time with the concept.

When many people think of pixels, they imagine a grid of tiny colored squares that make up a digital photograph. That mental picture is popular but wrong. A pixel is not a little colored tile. It is a number -- or a set of numbers for red, green, and blue -- that represents a sample taken from an underlying continuous image. The subject is a smooth scene in the world. The sensor samples that scene at discrete points, just as a microphone samples a sound wave. The grid of pixels is like graph paper on which those samples are recorded.

Pixels are measurements, not rectangles. In audio, when you record sound sampling at 44.1 kilohertz, you are not capturing forty-four thousand one hundred boxes of sound per second. You are taking samples of a continuous waveform. When you play the sound back, those samples are used to reconstruct a smooth wave. In the same way, each pixel in a photograph is a sample of brightness and color at a position on the sensor. The picture is continuous, but we have only sparse data points from which we must reconstruct it.

The image you see on your monitor when you zoom in, with little colored squares, is a processing convenience, not the underlying reality. It is as if a music player drew a staircase instead of a smooth sine wave. The software must draw something, and the computationally cheapest thing to draw is a rectangle of uniform color for each sample. That gives people the wrong idea about what an image really is. A better way to think of pixels is as infinitesimal points on a smooth landscape. The display software has to paint the spaces between them, and squares are simply the easiest way to do it. More sophisticated resampling methods use smoother transitions, much as a high-quality audio converter uses filters to turn discrete samples into continuous sound.

This distinction matters to photographers. The number of pixels in a sensor is not the same as the amount of detail in an image. Detail depends on how well the sampling grid captures the variations in the scene. A sensor that samples too coarsely will miss fine detail and produce aliasing -- the visual equivalent of distortion in sound. That is what causes jagged edges, moiré patterns, and false color. Sharpening and scaling operations are forms of reconstruction, and if the data is undersampled, no amount of processing can restore what was never captured. Conversely, when a lens and sensor combination samples the scene finely enough, the reconstruction can be faithful and smooth.

Every time software enlarges, sharpens, or demosaics an image, it is performing mathematical reconstruction, filling in missing values between samples. The quality of that process depends on how well the original sampling captured the information in the first place, and on the algorithm used for reconstruction. The image becomes visible only when those discrete samples are reconstructed into a continuous picture, just as a sequence of audio samples becomes music when it is turned back into a smooth waveform.

There are pernicious effects of using nearest-neighbor resampling -- the method that produces those little squares of uniform color. It is far from the best way to reconstruct an image. In fact, it is hard to think of a worse one. Yet presenting pixels as little squares in image editing software invites photographers to judge image quality by the sharpness of those squares, and to take the pseudo-logical next step of trying to make them look crisp. In a well-sampled image, that is the last thing you want. Sharp-looking nearest-neighbor squares almost always mean that the image was sampled too coarsely, has been brutally sharpened, or that something else has gone wrong.

To get a realistic print or display of an image, it’s important to get the right reconstruction. Some printer software is good at that. QImage is an exemplar here. Other software is moderately good at resampling for print or display, like Photoshop and Lightroom. There is specialized software that is even better, but it’s somewhat difficult to use. If you want to get the right amount of sharpening for an image, it’s important to look at the image after it has been resampled for the output device.
forgive me my ignorance - I kind of understand your view like I do with our FAEs explain to customers the groundbreaking achievements of our products - but the purchasing guy and the CFO are interested in what's in for me?

What is the intellectual benefit of thinking in waveforms instead of pixels? Do I get a different result by thinking that way or do I inherently gain more insight in the processing of an image from my camera aka sensor?

Do I have a better understanding of resolution or sensor selection?

What I am missing here or it a theoretical better description of what's happening?
 
As I said above there is the "rain falling into buckets" analogy. The bucket has an area - like a photoreceptor - in which raindrops (photons) land. We are interested in the amount of water (charge) resulting from the rainfall (light). We can pour the water into a measuring vessel or we could use a dipstick - it doesn't much which but we get one number per bucket. Ditto we get one number per receptor.

NOW: some people will think of "Pixel" as the bucket, a little square (or circle or any shape we like) we say a sensor is "50 megapixels because" it is divided into 50 million little squares. IF we stop there, we only have instructions for building a mosaic when we come to turn those readings back into something we can see.
On the other hand IF we say 50 million pixels is 50 million samples ... it opens the door to more intelligent processing into ink dots or screen dots. If we only ever think of them of instructions for placing 50Million tesserae it leads to doing daft things during processing.
The "pixel is just a value, NO, REALLY, DON'T YOU UNDERSTAND THAT THE PIXEL IS JUST A VALUE???" thing feels a bit like an elaborate piece of sophistry whose purpose is to demonstrate that photodiodes - physical "pixels" - don't actually exist.

*Of course* that's not the intent, which rather is to show that even though you have photodiodes on the front end, once the values are extracted from them one is better off thinking in terms of the abstract, dimensionless pixel. We are then obliged to engage with the physical domain once again when doing final processing to optimize for output to specfic devices/media, each of which has distinctive attributes.
TBH this discussion of how we envisage it is a lot less helpful than Jim's post "consequences of this confusion"
The implication of that whole discussion is that the observer literally cannot see what is in front of his own eyes, that he is oblivious to the way the final physical output actually looks. Only if one perceives that something isn't right with the output does the question arise of how best to tune the on-screen processing analog to facilitate achieving optimal output in the chosen physical medium at the desired scale.
 
Last edited:
Hi,

Or the part where the actual working part is less like a bucket and more like a very small antenna. Attached to a detector diode. Which converts the electromagnetic energy into a direct current voltage. Which the analog to digital converter turns into a number. And then we are back to the original post where this is really a point.

Edit: I kind of got beat by 7 minutes. ;)

Stan

--
Amateur Photographer
Professional Electronics Development Engineer
 
Last edited:
Alvy Ray Smith wrote a wonderful white paper when he was working for Microsoft. The title was “A pixel is not a little square.” I have referred people to it many times over the years, but for some it just doesn’t click. I think that’s because Smith’s audience was graphics engineers, not photographers. So here is my crack at the same subject matter, but aimed at photographers. I'm doing this because it has been apparent to me over the last couple of weeks that some people on this forum are having a hard time with the concept.

When many people think of pixels, they imagine a grid of tiny colored squares that make up a digital photograph. That mental picture is popular but wrong. A pixel is not a little colored tile. It is a number -- or a set of numbers for red, green, and blue -- that represents a sample taken from an underlying continuous image. The subject is a smooth scene in the world. The sensor samples that scene at discrete points, just as a microphone samples a sound wave. The grid of pixels is like graph paper on which those samples are recorded.

Pixels are measurements, not rectangles. In audio, when you record sound sampling at 44.1 kilohertz, you are not capturing forty-four thousand one hundred boxes of sound per second. You are taking samples of a continuous waveform. When you play the sound back, those samples are used to reconstruct a smooth wave. In the same way, each pixel in a photograph is a sample of brightness and color at a position on the sensor. The picture is continuous, but we have only sparse data points from which we must reconstruct it.

The image you see on your monitor when you zoom in, with little colored squares, is a processing convenience, not the underlying reality. It is as if a music player drew a staircase instead of a smooth sine wave. The software must draw something, and the computationally cheapest thing to draw is a rectangle of uniform color for each sample. That gives people the wrong idea about what an image really is. A better way to think of pixels is as infinitesimal points on a smooth landscape. The display software has to paint the spaces between them, and squares are simply the easiest way to do it. More sophisticated resampling methods use smoother transitions, much as a high-quality audio converter uses filters to turn discrete samples into continuous sound.

This distinction matters to photographers. The number of pixels in a sensor is not the same as the amount of detail in an image. Detail depends on how well the sampling grid captures the variations in the scene. A sensor that samples too coarsely will miss fine detail and produce aliasing -- the visual equivalent of distortion in sound. That is what causes jagged edges, moiré patterns, and false color. Sharpening and scaling operations are forms of reconstruction, and if the data is undersampled, no amount of processing can restore what was never captured. Conversely, when a lens and sensor combination samples the scene finely enough, the reconstruction can be faithful and smooth.

Every time software enlarges, sharpens, or demosaics an image, it is performing mathematical reconstruction, filling in missing values between samples. The quality of that process depends on how well the original sampling captured the information in the first place, and on the algorithm used for reconstruction. The image becomes visible only when those discrete samples are reconstructed into a continuous picture, just as a sequence of audio samples becomes music when it is turned back into a smooth waveform.

There are pernicious effects of using nearest-neighbor resampling -- the method that produces those little squares of uniform color. It is far from the best way to reconstruct an image. In fact, it is hard to think of a worse one. Yet presenting pixels as little squares in image editing software invites photographers to judge image quality by the sharpness of those squares, and to take the pseudo-logical next step of trying to make them look crisp. In a well-sampled image, that is the last thing you want. Sharp-looking nearest-neighbor squares almost always mean that the image was sampled too coarsely, has been brutally sharpened, or that something else has gone wrong.

To get a realistic print or display of an image, it’s important to get the right reconstruction. Some printer software is good at that. QImage is an exemplar here. Other software is moderately good at resampling for print or display, like Photoshop and Lightroom. There is specialized software that is even better, but it’s somewhat difficult to use. If you want to get the right amount of sharpening for an image, it’s important to look at the image after it has been resampled for the output device.
forgive me my ignorance - I kind of understand your view like I do with our FAEs explain to customers the groundbreaking achievements of our products - but the purchasing guy and the CFO are interested in what's in for me?

What is the intellectual benefit of thinking in waveforms instead of pixels?
You can still think in terms of pixels. Just not the way you're used to doing so.

As I said in another post, the downsides of the little square mental image is imprecise control of sharpening and noise reduction, with the result that images are likely to end up oversharpened and over smoothed at the same time. If you're trying to make the little squares look good, you're probably not doing what it takes to get the final image looking its best.

I see way too many oversharpened images on DPR, and this may be one of the reasons.
Do I get a different result by thinking that way or do I inherently gain more insight in the processing of an image from my camera aka sensor?

Do I have a better understanding of resolution or sensor selection?

What I am missing here or it a theoretical better description of what's happening?
 
Hi,

I have had some suggestions that I dont use enough sharpening in shots I have posted from time to time. And I suspect that comes from folks looking at images on a screen at 100% or more.

These are images quartered (to reduce the file.size) and then saved as a low compression (to reduce artifacts) Jpeg, but otherwise what I had processed for printing. So, yes, low on sharpening.

Stan
 

Keyboard shortcuts

Back
Top