Logo elodees  elodees

A caring AI for a better world













Only alphabetic characters accented or not as well as the space are accepted

Logo IA




Generate pixels from the photosites of a sensor





No account yet ?

Sign up to access all content




Grille de Bayer














The Bayer grid consists of 50% green filters, 25% red filters and 25% blue filters in order to represent the visual perception of the eye as faithfully as possible.

An eye is in fact twice as sensitive to green as to blue and red.

We use a Bayer grid to manage the color.

The Bayer grid covers the photosites.

This makes it possible to associate each photosite with one of the 3 elementary colors according to a filter (Red, Green and Blue).



Grille de Bayer




The Bayer Grid





A camera lens is an assembly of converging and diverging lenses that each have a particular role.

The sensor is photosensitive because it transforms the particles of light or photons into electrical signals thanks to the photosites.

Each photosite indicates the amount of light that strikes it.

Each photosite corresponds to a pixel of the photo.

When we assemble the information collected by all the photosites, it becomes possible to reconstruct the image.

Optical information becomes digital information.

The purpose of the camera is not to capture all the photons that enter the lens.

Its purpose is to recreate an image that resembles those that our eyes perceive.

It is therefore necessary to exclude rays that are imperceptible to humans, namely ultraviolet and infrared.

The photosites that collect light are not sensitive to the wavelength of the photons they receive, they are insensitive to color and see the world in black and white.

In order to create a color photo, a filter is placed in front of each photosite which allows photons of a particular color to pass, which are red, green or blue.

Knowing the location of each filter makes it possible to know which color each photosite corresponds to.

The set of these small filters is called a Bayer Matrix.

The human eye is more sensitive to green than to other colors.

This means that in a Bayer matrix there are twice as many green filters as red or blue filters.





Bayer filter patterns

Génération d'une grille de Bayer




How do photosites work ?

The sensor is made up of a large number of photosites which will receive light waves.

The light intensity will be converted into electrical voltage using photoelectric converters.

How to calculate the number of photosites ?

The surface of the sensor divided by the number of megapixels gives the number of photosites.

Why are there twice as many green photosites as red or blue photosites?

We note that there are twice as many green photosites as red or blue.

This compensates for a characteristic of human sight that is more sensitive to green than to red and blue.

For each pixel, a single red, green or blue channel is recorded.

What is the right grouping of photosites to choose ?

The group of photosites must work regardless of its position in the image, it must be as small as possible and must contain one or more R photosites, one or more G photosites, one or more B photosites.

What is the difference between a pixel and a photosite ?

The photosite captures the light while the pixel is the element of the digital image.

With a Bayer matrix sensor, 4 photosites are needed (2 dedicated to green, 1 to blue and 1 to red) to constitute 1 pixel.

What is image resolution ?

The resolution of an image is the number of pixels per inch it contains (1 inch = 2.54 centimeters) as well as its width and height.

It is measured in pixels per inch (PPI).

The more pixels per inch, the higher quality the image.

What is the role of the Bayer filter ?

The array of microlenses focuses the light on each of the photodiodes.

The Bayer filter (CFA for Color Filter Array) allows each pixel to receive only one colored information.





The sensor here consists of 12 photosites in width by 18 photosites in length with its associated Bayer grid.



Grille de Bayer


Generation of a pixel from 9 photosites, i.e. the central photosite and its 8 neighbors



Grille de Bayer




What is a pixel ?

The pixel (px) is the element that makes up a digital image that is raster.





R = Average of red photosites values

G = Average of the values of the green photosites

B = Average of blue photosites values



Grille de Bayer


The Swedish flag is made up of two colors, blue and yellow which is obtained by mixing red and green.



Génération d'une grille de Bayer




Grille de Bayer
Grille de Bayer


You can see that the yellow - blue front is not clean.





Diffraction and dimensions of photosites

Diffraction is a physical phenomenon that affects image sharpness.

It is more or less visible on the image depending on the size of the photosites which make it possible to calculate the value of each pixel.

Principle of diffraction

When light passes through a small orifice such as a camera lens diaphragm, it spreads out.

From the diaphragm, the light flares out into a cone.

The light will print very precise points on the camera sensor which will then form more or less circular spots on the image.

As a result, when you close the diaphragm of the camera, the image becomes more blurred and each point becomes a spot.

Diffraction limits the maximum resolution of the image, that is to say the size of the smallest detail that can be distinguished.

Diffraction can be completely invisible, for that, it is enough that the difference between two photosites is much larger than the diameter of the smallest spot that the objective is capable of producing.

This results in blurry areas on the image.



Here the stain is negligible.

Diffraction - Grille de Bayer


Here the stain becomes noticeable.

In the latter case, it does not matter whether or not one has a lot of pixels because the detail that they must record does not exist.

Diffraction - Grille de Bayer














Other matrix types

Instead of blue, red and green, cyan, magenta and yellow can be used to produce a subtractive synthetic image.



Grille de Bayer




Grille de Bayer


RAW Images 35 RAW formats including RAF, 3FR, RAW, MOS, MRW, RAF, PEF, ORF, NEF, ERF, RWL, EXR, SGI, DNG, CR2, CRW, ARW, SRF, X3F, KDC, SR2, ARI, R3D, MDC, FFF, MEF, RW2, RWZ, PEF, etc.

.CR2 pour Canon
.NEF pour Nikon
.RW2 pour Panasonic Lumix
.ARW pour Sony
.RAF pour Fujifilm
.PEF chez Pentax
.DNG pour d’autres marques
etc…

Digikam - Open source digital photo manager

Raw therapee is a free, cross-platform raw image processing program



Demosaicing

White balance

Tone Curve

Geometric corrections

jpeg compression





The so-called AA or Anti-Aliasing filter is necessary to avoid the appearance of artifacts which are elements that do not exist in the image and yet seen by the lens.

artifacts may appear if the resolution of the objective is greater than that of the sensor.

To avoid this, the filter does not register details smaller than two pixels and applies blurring.

If there were no filter, these details would be recorded incorrectly.

This filter also makes it possible to avoid the effect of aliasing or staircase effect on the image.



Diffraction - Grille de Bayer


You can see that the blur created in the case of a front is not clean.



Aliasing and Anti-aliasing



Remove anti-aliasing from an image





Bryce Edward Bayer

Light Vs Colors












Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !

Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License