{'fraction_non_alphanumeric': 0.026434558349451968, 'fraction_numerical': 0.0019342359767891683, 'mean_word_length': 4.812734082397004, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Color quantization by hierarchical octa-partition in RGB color space

Digital color images are widely used in our daily life, especially for smart-phone users. However, the storage and processing of the digital images consume a lot of hardware resources. To reduce the data amount of a true-color image, the indexed image is one common solution. In transforming a true-color image into an indexed image, the true-color space should be quantized into 256 colors to meet the usual size of a color-map. In this paper, we propose a new method to analyze an image's color distribution and produce its color-map for transforming to an indexed image. In most natural images, the color distribution of the image pixels is highly concentrated in some restricted regions. Equally-spaced quantization, of course, does not produce satisfactory results. We propose a new method that iteratively partitions the color space cube into eight equally sized sub-cubes. However, in doing so, we apply a pre-defined criterion to decide whether each sub-cube will be further partitioned. The decision criterion is based on the population size of the sub-cube. In this way, the regions where the most pixels concentrate in will be partitioned into finer sub-cubes and thus increases their discrimination after quantization. We applied the new proposed method to several types of true-color images and analyzed the resulting numerical errors. In addition, we utilized the error diffusion dithering technique to improve their visual effect. Satisfactory results were obtained.