Content-based encoding of digital images
An example method may include identifying a first block of a first image, the first block comprising a plurality of pixel values, generating a frequency-based representation of the first block, where the frequency-based representation comprises a transformation matrix having a plurality of coefficients, where each coefficient specifies a weight of a respective frequency in the frequency-based representation of the first block, generating at least one frequency domain parameter of the first block in view of a sum of a plurality of the coefficients of the transformation matrix, generating a visual content classification value in view of the at least one frequency domain parameter of the first block, selecting, in view of a determination of whether the visual content classification value satisfies a visual content-specific threshold, an encoding, and generating, using the selected encoding, an encoded block in view of the first block.
1. A system comprising:
a memory device comprising a group of memory units; and
a processing device, operatively coupled to the memory device, to perform operations comprising:
identifying a first block of a first image, the first block comprising a plurality of pixel values;
generating a frequency-based representation of the first block, wherein the frequency-based representation comprises a transformation matrix having a plurality of coefficients, wherein each coefficient specifies a weight of a respective frequency in the frequency-based representation of the first block;
generating at least one frequency domain parameter of the first block comprising a horizontal frequency domain parameter generated in view of a sum of absolute values of horizontal coefficients divided by a predetermined value, wherein the horizontal coefficients are selected from two or more first sub-matrices of the transformation matrix;
generating a visual content classification value in view of the at least one frequency domain parameter of the first block;
selecting, in view of a determination of whether the visual content classification value satisfies a visual content-specific threshold, an encoding;
generating, using the selected encoding, an encoded block in view of the first block; and
causing an image comprising the encoded block to be a rendered via an image rendering device.
2. The system of claim 1 , wherein generating the frequency-based representation comprises performing a discrete cosine transformation on the first block.
3. The system of claim 1 , wherein the at least one frequency domain parameter reflects an amount of fine detail present in the first block.
4. The system of claim 1 , wherein the two sub-matrices are of equal size and are separated by one or more columns.
5. The system of claim 1 , wherein the at least one frequency domain parameter further comprises a vertical frequency domain parameter generated in view of a sum of absolute values of vertical coefficients divided by the predetermined value, wherein the vertical coefficients are selected from two or more second sub-matrices of the transformation matrix,
wherein the visual content classification value is generated in view of a sum of the horizontal frequency domain parameter and the vertical frequency domain parameter, and
wherein the second sub-matrices are transpositions of the first sub-matrices.
6. The system of claim 1 , wherein the operations further comprise:
identifying one or more changed blocks of the first image, wherein each of the one or more changed blocks is different from a corresponding block of a second image, wherein the second image is received prior to the first image, and wherein the first block is one of the one or more changed blocks.
7. The system of claim 1 , wherein the operations further comprise:
generating at least one mean frequency domain parameter of the first block, wherein each mean frequency domain parameter of the first block comprises a mean value of the frequency domain parameter determined for the first block and at least one second frequency domain parameter, wherein each second frequency domain parameter is determined for a respective second block that is adjacent to the first block,
wherein the visual content classification value is generated in view of the at least one mean frequency domain parameter of the first block.
8. The system of claim 7 , wherein the at least one mean frequency domain parameter of the first block comprises the horizontal frequency domain parameter and a mean vertical frequency domain parameter, and the visual content classification value is generated in view of a sum of the horizontal frequency domain parameter and the mean vertical frequency domain parameter.
9. The system of claim 7 , wherein the at least one mean frequency domain parameter of the first block comprises the horizontal frequency domain parameter of the first block, wherein the respective second block comprises at least one horizontally-adjacent block that is horizontally-adjacent to the first block, and wherein the second frequency domain parameter comprises at least one second horizontal frequency domain parameter, wherein each second horizontal frequency domain parameter is of a respective horizontally-adjacent block.
10. The system of claim 7 , wherein the at least one mean frequency domain parameter of the first block comprises a mean vertical frequency domain parameter of the first block, wherein the at least one second block comprises at least one vertically-adjacent block that is vertically-adjacent to the first block, and wherein the second frequency domain parameter comprises at least one second vertical frequency domain parameter, wherein each second vertical frequency domain parameter is of a respective vertically-adjacent block.
11. The system of claim 1 , wherein the visual content classification value satisfies the visual content-specific threshold if the visual content classification value is greater than a predetermined threshold value.
12. The system of claim 1 , wherein the selected encoding is a text-oriented encoding if the visual content classification value satisfies the visual content-specific threshold.
13. The system of claim 12 , wherein the selected encoding is a graphics-oriented encoding if the visual content classification value does not satisfy the visual content-specific threshold, wherein the graphics-oriented encoding produces images having lower sharpness than the text-oriented encoding.
14. The system of claim 1 , wherein the first image comprises a screen image of a computer system.
15. The system of claim 1 , wherein at least two pixel values of the first block specify different colors.
16. The system of claim 1 , wherein the first image comprises a desktop screen image.
17. A method comprising:
identifying a first block of a first image, the first block comprising a plurality of pixel values;
generating, by a processing device, a frequency-based representation of the first block, wherein the frequency-based representation comprises a transformation matrix having a plurality of coefficients, wherein each coefficient specifies a weight of a respective frequency in the frequency-based representation of the first block;
generating at least one frequency domain parameter of the first block comprising a horizontal frequency domain parameter generated in view of a sum of absolute values of horizontal coefficients divided by a predetermined value, wherein the horizontal coefficients are selected from two or more first sub-matrices of the transformation matrix;
generating a visual content classification value in view of the at least one frequency domain parameter of the first block;
selecting, in view of a determination of whether the visual content classification value satisfies a visual content-specific threshold, an encoding;
generating, using the selected encoding, an encoded block in view of the first block; and
causing an image comprising the encoded block to be a rendered via an image rendering device.
18. A non-transitory machine-readable storage medium storing instructions that cause a processing device to:
identify a first block of a first image, the first block comprising a plurality of pixel values;
generate, by the processing device, a frequency-based representation of the first block, wherein the frequency-based representation comprises a transformation matrix having a plurality of coefficients, wherein each coefficient specifies a weight of a respective frequency in the frequency-based representation of the first block;
generate at least one frequency domain parameter of the first block comprising a horizontal frequency domain parameter generated in view of a sum of absolute values of horizontal coefficients divided by a predetermined value, wherein the horizontal coefficients are selected from two or more first sub-matrices of the transformation matrix;
generate a visual content classification value in view of the at least one frequency domain parameter of the first block;
select, in view of a determination of whether the visual content classification value satisfies a visual content-specific threshold, an encoding;
generate, using the selected encoding, an encoded block in view of the first block; and
cause an image comprising the encoded block to be a rendered via an image rendering device.