Why does color boundary collapse if "blur" is added to the image?



When "blurring" is added to the image, the boundary between color and color may be displayed in a different hue which is not an intermediate color between the two colors, which may cause discomfort. Even when "blurring" is put in image editing software specialized in image processing, it can happen depending on software, and it is because the blurring algorithm implemented in software is fundamentally wrong. We publish many physical-related movies on YouTubeminutephysicsIn the movie of the channel, it is easy to understand how it is wrong.

Computer Color is Broken - YouTube


When you add "blurring" processing to colorful images, weird shadows may appear at the boundary between color and color, which can not happen in the real world.



This problem is not limited to "blurring" of an image, but even when drawing a translucent line, a strange shadow appears between color and color.


There is a reason for this ugly shadow to happen.


To understand this problem, you first need to know "how the eyes feel the brightness".


Suppose, for example, there is one light in the dark.


If it becomes two, you notice change, but ...


Even if 101 pieces of light becomes 102 pieces, it is not easy to notice change. In other words, people are good at discriminating the relative brightness difference of dark scenes, but we are not good at finding the same difference in bright scenes.



Meanwhile, the computer can measure the increase in luminance regardless of the surrounding condition ...


When saving an image, record the red, green, and blue luminance values ​​at all the coordinates in the image.


Basically "0" indicates 0% luminance and "1" indicates 100% luminance.


Is the luminance "0.5" half the brightness?


It may seem to be intermediate brightness for the human eye, but it can only be seen as "it so" in contrast to the brightness. Actually, it has only about 22% brightness.


Although it may be crazy, the brightness '0.25' has only 5% brightness.


The reason for this is that when a digital camera takes an image, it does not store the luminance value in the image as it is but saves it as the value of the route.


This is because when saving the image, by taking the route, the luminance is low, the data amount is mainly used for the change of the dark portion of the image, the data amount is reduced for the bright portion It is. By doing so, disk space can be saved while mimicking human visual characteristics, which is strong against changes in brightness of dark areas, so it is two stone killed one stone.


Then, when displaying the image on the monitor, only squaring the luminance value in the image.


If you do not edit the image, there is no problem with this. However, when "blurring" the image, it is necessary to replace it with the average color of each pixel and its surrounding pixels.


The algorithm is not difficult, but the result will change depending on when you get the average. For example, if you shoot with a digital camera and put "blur" just before saving as an image, there is no problem with this method.


However, if you do it at the timing of editing the image file, the brightness of each pixel is saved as the value of the route, so if you take an average based on this value the result will change. Unfortunately, the vast majority of software has done this.


For example, when blurring the red and green boundaries, the center should be "half red" and "half green."


However, since the image file preserves the luminance by the route, if it is simply calculated by this formula, a value of low luminance comes out and becomes dark.


To avoid ugly shadows, it is only necessary to return to the original value by squaring the route in advance, and averaging it.


However, the majority of software from OS to image editing software is "blurring" with ugly means.


In addition, some image editing software is criticized that it can not understand this handling though it can not use default error setting even though mathematically no error-free algorithm can be used.

in Software,   Science,   Video, Posted by darkhorse_log