{'fraction_non_alphanumeric': 0.013590844062947067, 'fraction_numerical': 0.000715307582260372, 'mean_word_length': 5.0562770562770565, '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}}
Method for variable quantization in JPEG for improved perceptual quality

One of the main limitations of the ubiquitous JPEG standard is the fact that visible artifacts can often appear in the decompressed image at moderate to high compression ratios. This is especially true for parts of the image containing graphics, text, or some other such synthesized component. Artifacts are also common in smooth regions and in image blocks containing a single dominant edge. One approach to deal with this problem is to change the 'coarseness' of quantization as a function of image characteristics in the block being compressed. The latest extension of the JPEG standard, called JPEG Part-3, provides the necessary syntax for supporting this process by means of scale factors that can be used to uniformly vary the quantization step sizes on a block by block basis. However, the standard does not recommend any specific technique or algorithm for determining scale factors. This paper proposes a simple algorithm for computing scale factors for the quantization tables used in the JPEG compression standard. The algorithm classifies each image block according to its activity and type which index into look-up tables that provide the scale factor to be used for the block. The look-up tables are designed experimentally to yield perceptually lossless compression for the target device under consideration.