Image Compression Method, Device, Smart Terminal, and Computer-Readable Storage Medium
By using the pixel difference between the target pixel point and the reference pixel point in image compression to generate point compression data, the problem of sacrificing resolution and bit depth during image compression in the prior art is solved, and efficient image compression and complete restoration are achieved.
Patent Information
- Application Number
- CN202011229822.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2040-11-06
AI Technical Summary
The prior art is difficult to maintain image resolution and bit depth during image compression, resulting in the need to sacrifice image quality during transmission to reduce bandwidth pressure.
By acquiring the target image, the pixel difference value of each target pixel point and its corresponding reference pixel point is determined, and point compression data is generated based on these differences, and the target image is compressed.
It realizes that without losing image resolution and bit depth, significantly reduces the amount of image transmission data, improves compression rate, and completely restores the original image.
Smart Images

Figure CN114531598B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image compression method, device, intelligent terminal and computer-readable storage medium. Background Art
[0002] As the image bit depth and resolution increase, the requirements for image transmission bandwidth are constantly rising. Taking 4K@60hz (30-bit depth) as an example, its transmission bandwidth has reached 14 Gb / s. Therefore, to ensure the complete transmission of images, high bandwidth requirements are imposed on the transmission end. Due to the large amount of original image data, images are usually compressed by certain compression means during transmission to relieve the bandwidth pressure.
[0003] However, most of the image compression methods used in the prior art to relieve the bandwidth pressure compress by sacrificing the image resolution or bit depth. Although the transmission efficiency is improved, the original image is damaged, and it is not a truly lossless compression.
[0004] Therefore, the prior art still needs to be developed and improved. Summary of the Invention
[0005] Based on this, in view of the technical problem that the existing image compression technology cannot relieve the bandwidth pressure without sacrificing the image resolution and bit depth, the present invention provides an image compression method, device, intelligent terminal and computer-readable storage medium.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides an image compression method, including:
[0008] Obtain a target image, and determine reference pixel points corresponding to each target pixel point in the target image;
[0009] For each target pixel point, determine the pixel difference between the target pixel point and its corresponding reference pixel point;
[0010] Determine point compression data corresponding to each target pixel point according to the pixel differences corresponding to each target pixel point;
[0011] Compress each target pixel point according to the point compression data corresponding to each target pixel point to obtain image compression data of the target image.
[0012] In a second aspect, an embodiment of the present invention provides an image compression device, including:
[0013] A selection module, configured to obtain a target image and determine reference pixel points corresponding to each target pixel point in the target image;
[0014] A difference calculation module, configured to determine, for each target pixel point, a pixel difference between the target pixel point and its corresponding reference pixel point;
[0015] A compression determination module, configured to determine point compression data corresponding to each target pixel point according to the pixel differences corresponding to the target pixel points;
[0016] A generation module, configured to compress each target pixel point according to the point compression data corresponding to each target pixel point to obtain image compression data of the target image.
[0017] In a third aspect, an embodiment of the present invention further provides an intelligent terminal. The intelligent terminal includes a memory, a processor, and an image compression program stored in the memory and executable on the processor. When the processor executes the image compression program, the steps of the image compression method are implemented.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores an image compression program. When the image compression program is executed by a processor, the steps of the image compression method are implemented.
[0019] Advantageous effects:
[0020] The present invention discloses an image compression method, apparatus, intelligent terminal, and computer-readable storage medium. The method includes obtaining a target image and determining reference pixel points corresponding to each target pixel point in the target image; for each target pixel point, determining a pixel difference between the target pixel point and its corresponding reference pixel point; determining point compression data corresponding to each target pixel point according to the pixel differences corresponding to the target pixel points; and compressing each target pixel point according to the point compression data corresponding to each target pixel point to obtain image compression data of the target image. The present invention aims to transmit only the difference compression data when the pixel difference between the pixel value of the target pixel point and the reference value belongs to a preset compression threshold range, greatly reducing the amount of data transmitted, improving the compression ratio, without losing the image resolution and bit depth, and completely restoring the original image, which is convenient for users. Description of the Drawings
[0021] Figure 1 is a flowchart of an image compression method provided by the present invention;
[0022] Figure 2 is a schematic diagram of the functional modules of an image compression apparatus provided by the present invention;
[0023] Figure 3 is a flowchart of an image decoding method provided by the present invention;
[0024] Figure 4 is a block diagram of the structure of an intelligent terminal provided by the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions and effects of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0026] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for compressing an image provided by the present invention. It should be noted that the method for compressing an image in the embodiments of the present invention is not limited to Figure 1 the steps and sequences in the flowchart shown. According to different requirements, the steps in the flowchart can be added, removed or the sequence can be changed.
[0027] As Figure 1 shown, the method for compressing an image provided by the present invention includes the following steps:
[0028] S10. The intelligent terminal acquires a target image and determines reference pixel points corresponding to each target pixel point in the target image.
[0029] Specifically, the target image can be a complete image, or a single frame image in an image, or multiple frame images. For example: the target image is a single frame image in a video. If the target image is a single image, and a single image is an image composed of multiple frame images, the method for compressing the target image can be regarded as being compressed by summarizing a single frame image. The target image is acquired through an image acquisition module, and the image acquisition module can be a camera or its components. After the target image is acquired, it is cached for subsequent image compression and image decoding. In this embodiment, the target image is taken as an example of a single frame image to illustrate the technical solution of the present application. Therefore, the target image includes a number of target pixel points, and each target pixel point has a pixel value and corresponding coordinate information. Taking the target image to establish a coordinate system, the coordinate information of any target pixel point is represented by a two-dimensional matrix (Xm, Yn) in this embodiment. For example: (X1, Y2) represents the abscissa and ordinate of the target pixel point in the first row and the second column of the target image.
[0030] The reference pixel point is a certain target pixel point in the target image, and the reference pixel point can be one or multiple. The reference pixel point is used to determine in what transmission manner all the target pixel points in the target image are transmitted during the image transmission process. That is to say, all the target pixel points except the reference pixel point are compared with the reference pixel point as a reference to determine whether to transmit in a compressed manner or in an original, i.e., uncompressed manner, so as to reduce the amount of data transmitted for the target image by adopting compressed transmission.
[0031] In this embodiment, the selection of reference pixel points can be divided into three categories, namely row pixel points, column pixel points, and mixed pixel points. Row reference pixel points refer to the target pixel points that have the same row as the reference pixel points, that is, the ordinates of the target pixel points are equal; column reference pixel points refer to the target pixel points that have the same column as the reference pixel points, that is, the abscissas of the target pixel points are equal; the mixed reference pixel point is a target pixel point.
[0032] It should be noted that the reference pixel points are used as the starting points in the image compression method for the target image, and then the image is compressed and transmitted sequentially according to certain rules.
[0033] For example: If the selected reference pixel points belong to row reference pixel points, the image is compressed row by row. When transmitting the image, the compression starts from the first row. After the first row is completed, the compression continues with the second row until the compression of the last row is completed.
[0034] If the selected reference pixel points belong to column reference pixel points, the image is compressed column by column. When transmitting the image, the compression starts from the first column. After the first column is completed, the compression continues with the second column until the compression of the last column is completed.
[0035] If the selected reference pixel points belong to mixed reference pixel points, the image is compressed for each target pixel point one by one. When transmitting the image, the transmission method needs to be predefined in advance, and then according to the predefined transmission method, the compression method for each target pixel point is determined to facilitate storage and restoration.
[0036] For example: It is determined that the transmission method is to transmit from odd and even rows (first transmit odd rows and then even rows). The compression of the image starts from the first row and the first column. After the last column of the first row is completed, the compression continues with the first column of the third row. After the last column of the third row is completed, the compression continues until the first column of the last odd row is compressed. After the last column is completed, the compression continues with the first column of the second row. After the last column of the second row is completed, the compression continues with the first column of the fourth row. After the last column of the fourth row is completed, the compression continues until the first column of the last even row is compressed. After the last column is completed, the image compression is completed.
[0037] Exemplarily, the intelligent terminal determines the reference pixel points corresponding to each target pixel point in the target image, including:
[0038] The intelligent terminal selects the target pixel points in the first column of each row in the target image as the reference pixel points corresponding to the remaining target pixel points in each row; or,
[0039] selects the target pixel points in the first row of each column in the target image as the reference pixel points corresponding to the remaining target pixel points in each column; or,
[0040] Select any target pixel point from the target image as the reference pixel point corresponding to each of the remaining target pixel points.
[0041] S20. For each target pixel point, the smart terminal determines the pixel difference between the target pixel point and its corresponding reference pixel point.
[0042] Based on step S10, the reference pixel points are divided into three types, and there are also three types of corresponding pixel difference calculations, which are
[0043] 1. The reference pixel points include row reference pixel points. For each target pixel point, the smart terminal determines the pixel difference between the target pixel point and its corresponding reference pixel point, including:
[0044] The smart terminal takes the target pixel points in the first column of each row in the target image as the row reference pixel points and obtains the first pixel value of the row reference pixel points;
[0045] For the same row where the row reference pixel point is located, obtain the second pixel values of all the remaining target pixel points in the column;
[0046] Subtract the first pixel value from the second pixel value to obtain the row pixel differences between the remaining target pixel points in the column and the row reference pixel point.
[0047] That is to say, take the target pixel points in the first column of each row in the target image as the row reference pixel points, and calculate the difference between the second pixel values of the remaining target pixel points in the row and the first pixel value of the row reference pixel point in the same row. Specifically, it is: row pixel difference = second pixel value - first pixel value.
[0048] Similarly:
[0049] 2. The reference pixel points include column reference pixel points. For each target pixel point, the smart terminal determines the pixel difference between the target pixel point and its corresponding reference pixel point, including:
[0050] The smart terminal takes the target pixel points in the first row of each column in the target image as the column reference pixel points and obtains the third pixel value of the column reference pixel points;
[0051] For the same column where the column reference pixel point is located, obtain the fourth pixel values of all the remaining target pixel points in the row;
[0052] Subtract the third pixel value from the fourth pixel value to obtain the column pixel differences between the remaining target pixel points in the row and the column reference pixel point.
[0053] That is to say, taking the target pixel at the first row of each column in the target image as the column reference pixel, the fourth pixel value of the remaining target pixels in this column is calculated by taking the difference from the third pixel value of the row reference pixel in the same column. Specifically, it is expressed as: column pixel difference = fourth pixel value - third pixel value.
[0054] Similarly:
[0055] 3. The reference pixels include mixed reference pixels. For each target pixel, determining the pixel difference between the target pixel and its corresponding reference pixel includes:
[0056] Taking any target pixel in the target image as the mixed reference pixel and obtaining the fifth pixel value of the mixed reference pixel;
[0057] Obtaining the sixth pixel values of all the remaining target pixels in the target image;
[0058] Taking the difference between the sixth pixel value and the fifth pixel value to obtain the mixed pixel difference between each remaining target pixel and the mixed reference pixel.
[0059] That is to say, mixed pixel difference = sixth pixel value - fifth pixel value.
[0060] Whether it is the row pixel difference, column pixel difference, or mixed pixel difference, they have positive and negative values, which does not affect the compression of the image.
[0061] S30. The intelligent terminal determines the point compression data corresponding to each target pixel according to the pixel difference corresponding to each target pixel.
[0062] Specifically, the preset compression threshold range is an interval such as (-16, 16). The preset compression threshold range is used to indicate in what way the pixel value of the target pixel is transmitted. Further, judging whether the pixel difference of each target pixel belongs to the preset compression threshold range can further determine whether the target pixel starts compression or not.
[0063] In this embodiment, if the comparison result shows that the pixel difference of a target pixel exceeds the preset compression threshold range, then this target pixel is not compressed, and the original value is used as the first point compression data of this target pixel; if the comparison result shows that the pixel difference of a target pixel belongs to the preset compression threshold range, then this target pixel is compressed, and the pixel difference is used as the second point compression data of this target pixel. The target pixel serving as the reference pixel is not compressed, and the original value is used as the third point compression data.
[0064] Among them, the number of bits of the second point compression data is less than the number of bits of the first point compression data or the third point compression data.
[0065] Further, the highest bit of the compressed data of any point is used as a compression flag bit for whether compression is enabled. That is to say, in the data structure of the point compressed data, the highest bit is the compression standard bit, and the remaining several lower bits are used to represent pixel values, namely R, G, and B values.
[0066] If the image transmission is 32 bits, it means that the number of bits of the pixel value of each target pixel point is 32 bits. That is to say, the number of bits of the original value of each target pixel point is 32 bits. Therefore, if no compression is performed, that is, compression is not enabled, using the original value as the point compressed data specifically means transmitting and caching the 32-bit data of each target pixel point. In this embodiment, the point compressed data is usually binary data.
[0067] Further, the highest bit is the compression flag bit. If the compression flag bit is 1, it means that compression is enabled for this target pixel point, and the difference value is used as the point compressed data. If the compression flag bit is 0, it means that compression is not enabled for this target pixel point, and the original value is used as the point compressed data.
[0068] Furthermore, the target pixel point serving as the reference pixel point uses the original value as the point compressed data, which is convenient for providing a reference for the subsequent decoding and restoration of the image.
[0069] Further, the target pixel point uses the difference value as the second point compressed data. In this embodiment, the data structure of this second point compressed data also uses the highest bit as the compression flag bit, but the compression flag bit is set to 1, that is, compression is enabled. The number of bits of this second point compressed data is preferably 16 bits in this embodiment. Since the number of bits of the second point compressed data, 16, is much smaller than the corresponding number of bits of the original value, 32, during the image compression process, the amount of data is greatly reduced, the compression rate is provided, the bandwidth pressure is reduced, and the transmission efficiency is improved.
[0070] To further understand step S30, a specific embodiment is used to illustrate it as follows:
[0071] Original values corresponding to the first row of the original image:
[0072]
[0073]
[0074] Table 1
[0075] Compressed values after compression corresponding to the first row of the original image:
[0076]
[0077] Table 2
[0078] In Tables 1 and 2, the first column of each row of the target image is used as the row reference value, and the remaining columns are respectively compared with this row reference value. In Table 1, taking the original target pixel points with 10 bits for each of R, G, and B as an example, each pixel occupies a 32-bit width. Before compression, the 32nd bit and the 16th bit in each original target pixel point are reserved unused (set to 0). Then, the encoding module, such as the encoder, reads one row of the target image, and uses the 32nd bit and the 16th bit positions of the pixel location as the compression flag bits for this pixel. As shown in Table 2, if compression is enabled, that is, the flag bit is set to 1, then every 16 bits represent one pixel point, where R, G, and B each occupy 5 bits. The highest bit of R, G, and B represents whether the difference is positive or negative. If compression is not enabled, it is the same as the original pixel, and 32 bits represent one pixel point.
[0079] Then, the pixels in the first column of this row are transmitted as the original pixels to be used as the row reference value. The image size is 32 bits. Compare the difference between the images of the remaining columns and the image of the first column. If the difference is within 16 (positive or negative), then the difference is transmitted. The occupied image size of this target pixel point is 16 bits.
[0080] S40. The intelligent terminal compresses each target pixel point according to the point compression data corresponding to each target pixel point to obtain the image compression data of the target image.
[0081] Specifically, obtain the third point compression data of the reference pixel point and the first point compression data and / or the second point compression data of the remaining target pixel points; summarize the third point compression data, the first point compression data and / or the second point compression data to obtain the image compression data of the target image.
[0082] That is to say, according to the transmission convention, the summary of the point compression data of each target pixel point is the image compression data of the target image. This image compression data is also binary data.
[0083] Based on the above method, the present application also provides an image compression device, as Figure 2 shown, including:
[0084] A selection module 100, configured to obtain a target image and determine the reference pixel points corresponding to each target pixel point in the target image;
[0085] A difference calculation module 200, configured to determine the pixel difference between a target pixel point and its corresponding reference pixel point for each target pixel point;
[0086] A compression determination module 300, configured to determine the point compression data corresponding to each target pixel point according to the pixel differences corresponding to each target pixel point;
[0087] A generation module 400 is configured to compress each target pixel point according to the point compression data corresponding to each target pixel point to obtain image compression data of the target image.
[0088] Based on the above image compression method, the present application further provides an image decoding method. Please refer to Figure 3 , it should be noted that the image decoding method of the embodiments of the present invention is not limited to Figure 3 the steps and order in the flowchart shown. According to different requirements, the steps in the flowchart can be added, removed or the order can be changed. As Figure 3 shown, the image decoding method includes the following steps:
[0089] M10, Obtain the image compression data, parse the image compression data to obtain each point compression data;
[0090] M20, Determine the reference compression data for reconstructing the target image in each point compression data;
[0091] M30, Reconstruct the target image based on the reference compression data and its remaining point compression data to obtain a decoded image of the target image.
[0092] Specifically, the highest bit in the data structure of the point compression data is used to indicate whether compression is started. If its value is 0, it means compression is in the original way; if its value is 1, it means compression is in the pixel difference way. During the process of parsing the image compression data, the compression standard bit is used to determine whether the number of data bits transmitted is the number of data bits corresponding to the original value or the number of data bits corresponding to the difference, and then based on the reference value of the reference pixel point, the original pixel values of each target pixel point are restored. Of course, the reference pixel points are also divided into 3 categories correspondingly based on the image compression method. So it will not be elaborated here. Thus, the decompressed image is re-cached into a lossless compression image packet, that is, restored to the original image.
[0093] For example: The first column of each row of the image is the reference value of that row. The remaining columns are judged according to the agreed compression flag bit. If the compression flag is valid, on the basis of the reference value, restoration is performed to obtain the original pixel point value. The decoded image obtained after decompression is re-cached to form a lossless compression image packet.
[0094] In one embodiment, the present invention further provides an intelligent terminal. As Figure 4 shown, the intelligent terminal includes a processor 10, a memory 20 and a display 30. Figure 4 Only some components of the intelligent terminal are shown. However, it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0095] The memory 20 may be an internal storage unit of the smart terminal in some embodiments, such as the hard disk or memory of the smart terminal. The memory 20 may also be an external storage device of the smart terminal in some other embodiments, such as a plug-in hard disk equipped on the smart terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 20 may also include both the internal storage unit of the smart terminal and the external storage device. The memory 20 is used to store the application software installed on the smart terminal and various types of data, such as the program code installed on the smart terminal. The memory 20 may also be used to temporarily store the data that has been output or will be output. In one embodiment, an image compression program or an image decoding program 40 is stored on the memory 20, and the image compression program or the image decoding program 40 can be executed by the processor 10, so as to implement the image compression method or the image decoding method in this application.
[0096] The processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chips in some embodiments, and is used to run the program code stored in the memory 20 or process data, such as executing the image compression method or the image decoding method, etc.
[0097] The display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. in some embodiments. The display 30 is used to display the information on the smart terminal and to display the visual user interface. The components 10-30 of the smart terminal communicate with each other through the system bus.
[0098] In one embodiment, when the processor 10 executes the image compression program 40 in the memory 20, the following steps are implemented:
[0099] Obtain a target image, and determine the reference pixel points corresponding to each target pixel point in the target image;
[0100] For each target pixel point, determine the pixel difference between the target pixel point and its corresponding reference pixel point;
[0101] According to the pixel differences corresponding to each target pixel point, determine the point compression data corresponding to each target pixel point;
[0102] Compress each target pixel point according to the point compression data corresponding to each target pixel point to obtain the image compression data of the target image, specifically as the above image compression method.
[0103] Alternatively, in another embodiment, when the processor 10 executes the image decoding program 40 in the memory 20, the following steps are implemented:
[0104] Obtain the image compression data, parse the image compression data, and obtain the compressed data of each point;
[0105] Determine the reference compression data for reconstructing the target image in the compressed data of each point;
[0106] Based on the reference compression data and the remaining compressed data of each point, reconstruct the target image to obtain the decoded image of the target image, specifically as in the above image decoding method.
[0107] The present invention also provides a computer-readable storage medium. The computer-readable storage medium stores an image compression program, and the image compression program is executed by a processor (in this embodiment, the processor 10) to implement the steps in the image compression method of the present invention, or the computer-readable storage medium stores an image decoding program, and the image decoding program is executed by one or more processors (in this embodiment, the processor 10) to implement the steps in the image decoding method of the present invention, specifically as in the above method.
[0108] Those skilled in the art can understand that Figure 4 The block diagram shown only shows the block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific intelligent terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. When the processor executes the computer program, the steps of the above image compression method are implemented, specifically as above.
[0109] In summary, the present invention discloses an image compression method, device, intelligent terminal, and computer-readable storage medium. The method includes obtaining a target image and determining reference pixel points corresponding to each target pixel point in the target image; for each target pixel point, determining the pixel difference between the target pixel point and its corresponding reference pixel point; according to the pixel differences corresponding to each target pixel point, determining the point compression data corresponding to each target pixel point; and compressing each target pixel point according to the point compression data corresponding to each target pixel point to obtain the image compression data of the target image. The present invention aims to use the pixel difference between the pixel value of the target pixel point and the reference value within the preset compression threshold range to transmit only the difference as compressed data, greatly reducing the amount of data transmitted, improving the compression rate, and at the same time not losing the image resolution and bit depth, completely restoring the original image, which is convenient for users.
[0110] Of course, those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program. The computer program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the above method embodiments. The storage medium can be a memory, a magnetic disk, an optical disc, etc.
[0111] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for compressing an image, characterized in that, comprising: obtaining a target image and determining reference pixel points corresponding to respective target pixel points in the target image; for each target pixel point, determining a pixel difference between the target pixel point and its corresponding reference pixel point; determining point compression data corresponding to respective target pixel points according to the pixel differences corresponding to the respective target pixel points; compressing respective target pixel points according to the point compression data corresponding to the respective target pixel points to obtain image compression data of the target image; The compressing respective target pixel points according to the point compression data corresponding to the respective target pixel points to obtain image compression data of the target image includes: obtaining third point compression data of reference pixel points corresponding to respective target pixel points and first point compression data or second point compression data corresponding to the respective target pixel points; compressing respective target pixel points and their corresponding reference pixel points according to the third point compression data, the second point compression data, and the first point compression data to obtain image compression data of the target image; if the pixel difference of the target pixel point exceeds a preset compression threshold range, the target pixel point is not compressed and the original value is used as the first point compression data of the target pixel point; if the pixel difference of the target pixel point belongs to the preset compression threshold range, the target pixel point is compressed and the pixel difference is used as the second point compression data of the target pixel point; a target pixel point serving as a reference pixel point is not compressed and the original value is used as the third point compression data.
2. The method according to claim 1, characterized in that, the determining reference pixel points corresponding to respective target pixel points in the target image includes: selecting target pixel points of the first column of each row from the target image as reference pixel points corresponding to the remaining target pixel points of the row; or, selecting target pixel points of the first row of each column from the target image as reference pixel points corresponding to the remaining target pixel points of the column; or, selecting any target pixel point from the target image as a reference pixel point corresponding to the remaining target pixel points.
3. The method according to claim 2, characterized in that, the for each target pixel point, determining a pixel difference between the target pixel point and its corresponding reference pixel point includes: for each target pixel point, respectively obtaining pixel values of the target pixel point and its corresponding reference pixel point; subtracting the pixel value of the reference pixel point corresponding to the target pixel point from the pixel value of the target pixel point to obtain the pixel difference corresponding to the target pixel point.
4. The method according to claim 1, characterized in that, the data lengths of respective second point compression data are all smaller than the data lengths of respective first point compression data.
5. The method according to any one of claims 1-4, characterized in that, the highest bit of any of the point compression data serves as a compression flag bit for whether to enable compression.
6. An image compression apparatus, characterized in that, comprising: a selection module, configured to obtain a target image and determine reference pixel points corresponding to respective target pixel points in the target image; A difference calculation module, configured to determine, for each target pixel point, a pixel difference between the target pixel point and its corresponding reference pixel point; A compression determination module, configured to determine point compression data corresponding to each target pixel point according to the pixel differences corresponding to the target pixel points; A generation module, configured to compress each target pixel point according to the point compression data corresponding to each target pixel point to obtain image compression data of the target image; The generation module is further configured to obtain third point compression data corresponding to the reference pixel points corresponding to the target pixel points and first point compression data or second point compression data corresponding to the target pixel points; According to the third point compression data, the second point compression data, and the first point compression data, compress each target pixel point and its corresponding reference pixel point to obtain image compression data of the target image; If the pixel difference of the target pixel point exceeds a preset compression threshold range, the target pixel point is not compressed, and the original value is used as the first point compression data of the target pixel point; If the pixel difference of the target pixel point belongs to the preset compression threshold range, the target pixel point is compressed, and the pixel difference is used as the second point compression data of the target pixel point; The target pixel point serving as the reference pixel point is not compressed, and the original value is used as the third point compression data.
7. An intelligent terminal, characterized in that, the intelligent terminal includes a memory, a processor, and an image compression program stored in the memory and executable on the processor, and when the processor executes the image compression program, the steps of the image compression method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores an image compression program, and when the image compression program is executed by a processor, the steps of the image compression method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image decompression method and device for executing same
CN107659815A
Image compression control method
CN110971904A
Cited By
Image compression method and apparatus, and intelligent terminal and computer-readable storage medium
WO2022095797A1