They say that the painting of Las Meninas shows air, that Velázquez painted the same atmosphere. Velázquez was a master, there is no doubt that he caught the game of light at first sight and carried that game with great skill to the painting.
However, Velázquez did not paint the atmosphere, but because of the distance to which objects and people are. The nearby ones have great precision and contrast, while the distant ones are seen with light that has crossed a few meters of air, more diffuse and with less contrast. More or less so we see reality. One of Velázquez's greatest merits is his conscience.
The atmosphere seems transparent, but it is not. It is like glass, glass is not transparent, or glass lenses (ask astronomers). That is why we see what is far away, because it crosses an environment not totally transparent and on the way the light loses intensity.
After 196 years after Velázquez finished Las Meninas, the German August Beer explained this blurring of light and elaborated a mathematical formula to calculate the loss of light intensity in the atmosphere in figures.
Air absorbs and diverts light. Some components of the air absorb light, others divert it and others, both at once. Therefore, as the air passes, light loses intensity, to a greater or lesser degree, depending on the proportion of air components.
Beer started from the work of other previous scientists, especially the French Pierre Bouguer. Another scientist, the German Johann Heinrich Lambert, mentioned in a book the work of Bouguer, so today we call the law of Lambert-Beer to the formula of Beer.
The formula states that the light loses the intensity in a quadratic way, that is, it is lost according to the square of the distance it crosses. The loss is very fast: if a meter in the air loses a certain intensity, after two meters the loss is four times greater (because the square of the number two is four) and nine times greater (three to two) to three meters.
Thus, it seems a lie that the rays of the Sun reach the earth's surface, but they arrive. On the way from the Sun to the atmosphere of the Earth the light has no obstacles and comes with much intensity. It must be added that the upper part of the atmosphere is not as compact as the lower one. Absorbs and diverts much less light.
The human eye does not know the quadratic loss of light intensity. Do not use formulas. It detects the loss and sees more diffuse what is far than near. Velázquez's hand also did not know the formula and, however, was able to reflect this effect on the paintings.
But not all illustrators of today have the ability of Velázquez. For example, to simulate the effect with a computer is necessary the law of Lambert-Beer. In fact, three-dimensional imaging software uses formulas similar to those of Lambert-Beer to simulate reality. The color of each point of the image is calculated using the technique called raytracing (English term meaning continuity of the path of the rays).
The computer calculates the specific trajectories of the light rays, from the sources of light to the collision with other objects that appear in the image, and calculates the loss of intensity of them in the way by a quadratic formula.
The simulation of reality necessarily implies the calculation of the quadratic loss of intensity. Fortunately, beauty is not synonymous with realism; not all images that seem beautiful to us are a faithful simulation of reality (even if they seem real). Many times, intentionally, non-quadratic formulas are used to calculate the loss of light intensity: linear, quadratic, etc. (including according to a formula invented by the graphic artist himself).
Now we can ask ourselves about Velázquez's work. What loss of intensity did you use to get such a spectacular result in the Las Meninas painting?