Java simple implementation of octree image processing code example

I've been working for a while. I don't know how to write a blog for the first time. Let's make do with it. Please correct what's wrong.

A function of image compression is used in recent work. I found some tools and didn't have a good choice. Finally, I chose one called jdeli, but efficiency became a problem again. I was forced to study its source code, but found that I was interested in a subtractive color quantization algorithm, but I was embarrassed that I didn't understand what it wrote, so I had the idea of implementing a quantization color algorithm myself.

I found some information and found three commonly used color processing algorithms:

Popular color algorithm:

The specific algorithm is to count the occurrence times of all colors of an image, select the 256 colors with the most occurrence times as the colors of the picture palette, and then traverse all pixels of the picture again, Find the closest color in the palette for each pixel (I use the variance method here) and write it back to the picture. The implementation of this algorithm is relatively simple, but the distortion is serious. Some information in the image with low frequency but obvious visual effect on human eyes will be lost. For example, high brightness spots in the image may not be selected by the algorithm because they appear less times and will be lost.

Median segmentation algorithm:

I haven't studied this algorithm. Students who want to know can see this article, which introduces three algorithms.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>