A photodiode is the smallest element of a digital sensor, while a pixel is the smallest piece of information in a digital image. I wonder if the two terms can be used interchangeably or there are some steps in the middle before a photodiode becomes a pixel.
4 Answers
The pixels you get in a finished, camera-independent image file - a JPEG, TIFF, BMP, ...) file you get either from your camera or from your RAW processor software - are usually the results of multiple photodiode outputs (sensor pixels) combined, due to the way color filters arrays work.
The pixels in an image file, or in an image displayed on a monitor, are RGB pixels which each have 3 color channels to themselves, whereas a sensor pixel from a color digital camera will represent only one color channel - processing in camera or computer will interpolate the other color channels from adjacent sensor pixels following a so called demosaicing algorithm. You do get the same amount of output pixels as you have sensor pixels - the luminance (brightness) resolution of the camera will still be equivalent (unless limited by an AA filter, see below) to the nominal resolution of the sensor, whereas the color resolution is actually somewhat lower.
This does not affect the output as much as one would assume as long as one does not photograph extremely fine tartan-like patterns of contrasting colors, or subjects made of pure color noise. This could result in so called moire effects or other color artifacts.
The actual resolution of many sensors is actually optically limited by so-called antialiasing (AA) filters. This is because even a pure luminance sensor (black&white) can actually only resolve as high as its nominal resolution under optimal and very unreliable conditions: If you projected a checkerboard pattern with fields equivalent in size to sensor pixels on to a sensor, you could end up with a perfect reproduction of the pattern... or with a perfect uniform gray, if the sensor was misaligned 1/2 pixel wide with the checkerboard pattern. Conservatively (following Nyquist's sampling theorem) you would have to cut the resolution by half in each dimension (making a 6MP sensor of a 24MP sensor); in practice, compromises are made (The filter will attenuate contrast progressively the closer you get to theoretical resolution),or the AA filter is omitted, either leaving it to software to recognize such artifacts and correct them, or simply accepting the risk.
The basics of how a photosite is constructed are covered here: What is the structure of a photosite? — each photodiode has associated other electronics, and also (usually) a color filter (as well as other filters in a stack).
In order to produce a full-color image, information from each photosite is combined in a process called "demosaicing". Take a look at What does an unprocessed RAW file look like?, which shows image files constructed from each photosite directly in various states of processing.
In a "naïve" conversion, each photosite maps 1:1 to a pixel in the output image, although the actual data for each pixel is influenced by the surrounding pixels because of the demosaicing process. But, these days, it's typical to also convert for lens distortion, chromatic aberration, and similar, and those mappings stretch and move data around, such that there's not really a one-to-one correspondence between photosites and final image pixels. (It's still roughly true that the number of photosites is about the same as the number of pixels in the final image.)
-
\$\begingroup\$ While it is true that each pixel (photosite/photodiode) on the sensor does not record/contain the same information that is in the output pixel, it is always a 1:1 representation. Because each image pixel must be interpolated with surrounding pixels there is a border of pixels on the sensor that are not represented in the output; which complete the "surrounding" information for the image edge pixels. The difference between actual pixels and effective pixels is a requirement of the design (Bayer sensor). \$\endgroup\$ Commented Mar 6, 2019 at 22:29
-
1\$\begingroup\$ @StevenKersting This is not necessarily the case when images are produced which correct for lens distortion or artifacts, as noted. \$\endgroup\$– mattdmCommented Mar 6, 2019 at 22:39
-
\$\begingroup\$ Regardless of where the data comes from (sensor or computational) it is still mapped 1:1 to the effective pixels. At Least I'm not aware of any that outputs a cropped nor expanded image file when lens corrections are applied in body. cpn.canon-europe.com/content/education/infobank/… \$\endgroup\$ Commented Mar 6, 2019 at 22:51
-
\$\begingroup\$ @StevenKersting Yeah, as far as I know that's the case, give or take 16 or 24 pixels sometimes. That is, the number of pixels directly corresponds to the number of photosites in the imaging area. But I hesitate to say 1:1, because that implies one could draw a line from the photosite to the pixel and back again. In the case of distortion correction, the input from some of the edge photosites may entirely be cropped out, so of the remaining photosites their must be actually fewer than 1 photosite's worth of information per 1 pixel. \$\endgroup\$– mattdmCommented Mar 6, 2019 at 22:59
-
1\$\begingroup\$ @mattdm In such cases, the total resolution of the image files from at least some such cameras go up or down when lens correction is applied in camera. My Canon cameras do it. With in-camera lens correction applied to in-camera jpegs, the number of pixels in terms of WxH changes. It's even more pronounced if slight tilting is done in DPP (say, 1/3 of one degree). Depending on the exact angle, the total number of pixels can be slightly more or slightly less than the nominal WxH for that sensor. \$\endgroup\$ Commented Mar 7, 2019 at 20:13
The terms photodiode, photosite, and pixel are frequently used interchangeably; and of the three, pixel(s) is the most common. I.e. I have never heard/seen a camera referred to as having 36 million photodiodes.
-
1\$\begingroup\$ A 36MP camera is called a 36MP camera because the images it creates have 36 million pixels, not because the sensor that is used to create those images has 36 million photosites. The vast majority of digital cameras have more "pixel wells" on their imaging sensors than the files those cameras output. Even the raw files from such a camera will include information from each photosite on the sensor. For instance, the Canon EOS 5Ds has a sensor with approximately 53 million photosites. The processed image files from that camera have 8688x5792, or 50.6 million, pixels. \$\endgroup\$ Commented Mar 5, 2019 at 22:51
-
\$\begingroup\$ And Canon calls them pixels (effective vs actual/total)... not photosites/photodiodes. As does Nikon and every other manufacturer. drive.google.com/file/d/1EgV58HdFO34S94jbakHwgraI-KyTYM2c/… \$\endgroup\$ Commented Mar 6, 2019 at 22:04
-
\$\begingroup\$ Yes, and that is unfortunate. They probably should call them sensels, but then the marketing department would need to be more forthcoming and accurate (i.e. honest). \$\endgroup\$ Commented Mar 6, 2019 at 22:14
-
\$\begingroup\$ I'm not sure what is "dishonest" about the term... yes, there is a border of photosites that are not represented in the output. But they are necessary to provide/complete the information required for demosaicing of the effective photosites/pixels \$\endgroup\$ Commented Mar 6, 2019 at 22:32
-
\$\begingroup\$ The dishonest part is implying that each "pixel" on the sensor is independently sensitive to red, green, and blue light. \$\endgroup\$ Commented Mar 6, 2019 at 22:56
A lot of folks do use the term interchangeably. That's regrettable, though, because there are fundamental differences.
To start with, each photosite (a/k/a sensel or pixel well), only records a single brightness value, not three different values for a Red, Green, and Blue color channel. It is the case that each photosite has a color filter in front of it. However, none of them record only red, only green, or only blue light. There's overlap in what wavelengths of light get through each color filter of the Bayer mask. This mimics the way the three types of cones in our retinas respond to different wavelengths of light.
For a much more detailed discussion of this, please see: RAW files store 3 colors per pixel, or only one?
Secondly, the filters in front of each photosite on our camera's sensor are not the same exact colors as the three colors we use in our RGB reproduction systems. The "blue" and "green" filters are fairly close to the colors we call Blue and Green in the RGB system, but the "red" filters are nowhere near what we call Red in the RGB system. To get RGB values for each pixel in an image, we must interpolate colors from the monochromatic luminance values measured by photosites that are behind colored filters that do not correspond to the colors we use for 'RGB' reproduction systems. We do this interpolation using information from surrounding photosites as well as the photosite in question. We call this process demosaicing. This is very similar to the way our brains perceive color based on various wavelengths or combinations of wavelengths of light.
For a much more detailed look at this, please see: Why are Red, Green, and Blue the primary colors of light?
This answer to Why don't mainstream sensors use CYM filters instead of RGB? illustrates how the colors used in a Bayer mask differ from the colors we use for 'RGB'. The curves are measured responses of the "red", "green", and "blue" filtered photosites to light at various wavelengths by a specific camera sensor. The vertical lines are the approximate positions of "Red", "Green", and "Blue" used by RGB color reproductions systems. I've also included "Yellow" to show that the peak response of the "red" filtered photosites is much closer to what we call "Yellow" than to what we call "Red."
Notice that the peak response of the "blue" filtered photosites is around 455nm, while the "Blue" we use in 'RGB' is about 480nm. The peak response of the "green" filtered photosites is around 545nm, while the "Green" we use in 'RGB' is about 230nm. Most notably, the peak response of "red" filtered photosites is around 595nm, while the "Red" we use in 'RGB' is about 640nm. The "red" filters on our cameras' Bayer masks are more yellow-orange than they are "red"!
Finally, the monochromatic brightness values for each photosite from a camera's sensor are linear. That is, the response to light from total black to total white is a straight slope. Our human vision systems, as well as the reproduction systems that we use to display images, have a logarithmic response with an 'S-shaped' curve at the very darkest and brightest ends. The linear brightness values from a camera's sensor need to be converted to response curves that mimic how our brains process the information gathered by our retinas. We call this gamma correction. It is similar, but not the same, as the gamma correction that our graphics adapters use when sending an RGB signal to a monitor.
Here is a raw file that has been demosaiced and rendered linearly (no curve). It's a fairly extreme example of a scene with a very wide dynamic range (the difference between the brightest and darkest parts of the scene).
The reason the gamma correction line is curved (in the shape of a near perfect curve for y=(√2)^x when x is between -10 and +4) in the histogram is because the exposure stop scale is exponential - there is really twice as much distance between each set of two stops as you move to the right as there was between the previous two stops. If the exposure scale were rendered that way, then the response "curve" you see would be a straight diagonal line.
Here is the same RAW file rendered with a fairly standard set of gamma curves: the neutral picture style and no brightness adjustment.
Here it is when rendered with some highly customized light curves and +1.17 stops brightness adjustment to raise the shadows and then reign the highlights back in a little.
Here is the final edited image after some additional, fairly aggressive tone mapping has been applied using Canon's DPP HDR module to the single RAW file as originally edited with the customized light curves.
Put all of this together, and it is easy to see how the information contained in a raw image file must be processed before it resembles anything we would consider a viewable image. For more about what that information "looks" like at various stages in the conversion process from a raw file to an image, please see: What does an unprocessed RAW file look like?