Image compression method and device, computer equipment and storage medium

By determining the appropriate compression scheme and adjusting the image content, the distortion problem caused by traditional image compression algorithms is solved, and more accurate image compression is achieved, and the compression effect and efficiency that meets different needs are met.

CN119011737APending Publication Date: 2024-11-22TIANJIN YINENG TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411053407.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Traditional image compression algorithms cause compressed images to be distorted and cannot meet the image compression requirements under different needs.

Method used

By acquiring the original image, a suitable compression scheme is determined, including image compression methods and evaluation criteria, the image is compressed according to the scheme, and the image content is adjusted when the evaluation criteria is met, such as text area processing, non-text area cropping, image subtraction or Size compression to ensure that the evaluation data of the compressed image meets the standards.

Benefits of technology

It reduces the distortion of the compressed image, retains important information, meets the image compression effect under different needs, and improves the compression efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011737A_ABST
    Figure CN119011737A_ABST
Patent Text Reader

Abstract

The invention relates to an image compression method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring an original image; for each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme comprises an image compression mode and an image evaluation standard corresponding to the image compression mode; performing compression processing on the to-be-compressed image according to an image compression mode in the current compression scheme to obtain a compressed image corresponding to the compression process; wherein the to-be-compressed image is an original image or a compressed image corresponding to a previous image compression process; and under the condition that the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, taking the compressed image corresponding to the current image compression process as a target compressed image of the to-be-compressed image. By adopting the method, important information in the image can be reserved, and the problem of serious distortion of the target compressed image is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image compression method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of the Internet era, people are increasingly relying on the Internet to obtain information. Among this information, pictures and videos account for the majority. The transmission of some pictures is also indispensable in some system interactions. There are different compression methods for different pictures, and different compression and compression of pictures for different needs. For example: there are requirements for picture color, picture size, and text in pictures.

[0003] In the conventional technology, although the image compression algorithm can be used to compress the image, there is a problem that the compressed image is distorted. Summary of the invention

[0004] Based on this, it is necessary to provide an image compression method, device, computer equipment and storage medium that can reduce the distortion of compressed images in response to the above technical problems.

[0005] In a first aspect, the present application provides an image compression method, comprising:

[0006] Get the original image;

[0007] For each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0008] According to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0009] When the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0010] In one embodiment, if the image compression method includes a text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to the current compression process, including:

[0011] Performing region division processing on the image to be compressed to obtain the text region of the image to be compressed;

[0012] Performing text adjustment processing on the text area of ​​the image to be compressed to obtain a compressed image corresponding to this compression process;

[0013] The text adjustment process includes at least one of text size adjustment process, text color adjustment process and text shape adjustment process.

[0014] In one embodiment, if the image compression method includes a non-text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to the current compression process, including:

[0015] Performing region division processing on the image to be compressed to obtain a non-text region of the image to be compressed;

[0016] The non-text area of ​​the image to be compressed is cropped to obtain a compressed image corresponding to this compression process.

[0017] In one embodiment, if the image compression method includes an image color processing method; performing image compression processing on the image to be compressed according to the image compression processing method in the current compression scheme to obtain an initial compressed image includes:

[0018] Perform image color reduction processing on each pixel value in the image to be compressed to obtain the compressed image corresponding to this compression process.

[0019] In one embodiment, if the image compression processing method includes an image size processing method; performing image compression processing on the image to be compressed according to the image compression processing method in the current compression scheme to obtain an initial compressed image includes:

[0020] The image width and image height in the image to be compressed are compressed to obtain a compressed image corresponding to this compression process.

[0021] In one embodiment, if the current compression scheme includes at least one image compression processing method, the execution order of each image compression processing method and the standard image parameters corresponding to each image compression processing method; then according to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process, including:

[0022] Based on the execution order of each image compression method in the current compression scheme, the image to be compressed is compressed in turn according to each image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process.

[0023] In a second aspect, the present application also provides an image compression device, comprising:

[0024] An image acquisition module, used for acquiring original images;

[0025] A scheme determination module is used to determine the current compression scheme corresponding to each image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0026] An image compression module is used to compress the image to be compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0027] The image evaluation module is used to use the compressed image corresponding to the current image compression process as the target compressed image of the image to be compressed when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme.

[0028] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0029] Get the original image;

[0030] For each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0031] According to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0032] When the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0034] Get the original image;

[0035] For each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0036] According to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0037] When the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0038] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0039] Get the original image;

[0040] For each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0041] According to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0042] When the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0043] The above-mentioned image compression method, device, computer equipment and storage medium obtain an original image; for each image compression process, determine the current compression scheme corresponding to this image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method; according to the image compression method in the current compression scheme, compress the image to be compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process; when the image evaluation data of the compressed image corresponding to this image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to this image compression process is used as the target compressed image of the image to be compressed. This embodiment completes the compression processing of the original image through the current compression scheme corresponding to the original image, and obtains the target compressed image when the image evaluation data of the compressed image is the same as the image evaluation standard corresponding to the current compression scheme, so that the determined target compressed image is more accurate and can retain important information in the image, thereby avoiding the problem of serious distortion of the target compressed image. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 An application environment diagram of an image compression method provided by this embodiment;

[0046] Figure 2 A schematic diagram of the flow of the first image compression method provided in this embodiment;

[0047] Figure 3 A schematic diagram of a flow chart of a second image compression method provided in this embodiment;

[0048] Figure 4 A structural block diagram of an image compression device provided in this embodiment;

[0049] Figure 5 An internal structure diagram of a computer device provided in this embodiment;

[0050] Figure 6 This is a diagram of the internal structure of a computer device provided in this embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] The image compression method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. The computer device obtains the original image; for each image compression process, the current compression scheme corresponding to the current image compression process is determined; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method; according to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to the current compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process; when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed. Among them, the computer device can be either a terminal or a server. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster consisting of multiple servers.

[0053] In an exemplary embodiment, Figure 2 As shown, an image compression method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps S201 to S20X. Among them:

[0054] Step 201, obtaining an original image, wherein the original image may be an image requiring image compression processing.

[0055] Step 202: for each image compression process, determine the current compression scheme corresponding to the current image compression process.

[0056] The current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method.

[0057] Specifically, for the first image compression process, it is necessary to determine the current compression scheme corresponding to the original image based on the preset image compression requirements; for the Nth image compression process, it is necessary to determine the current compression scheme of this image compression process based on the compression results corresponding to the N-1th image compression process, that is, select the image evaluation data that does not meet the image evaluation standard, determine the image compression methods corresponding to the image evaluation data, and generate the current compression scheme based on the image compression methods.

[0058] For example, for the Nth image compression process, the compression result corresponding to the N-1th image compression process is determined as follows: there is image evaluation data for image size (80%) that does not meet the image evaluation standard for image size (75%); there is image evaluation data for image color (75%) that does not meet the image evaluation standard for image color (50%). Therefore, in order to make the image evaluation data of the compressed image meet the image evaluation standard, it is necessary to continue to compress the image size and image color. Therefore, it is determined that the current compression scheme corresponding to the Nth image compression process includes compression processing for image size and color reduction processing for image color.

[0059] Step 203: compress the image to be compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process.

[0060] The image to be compressed is the original image or a compressed image corresponding to the previous image compression process.

[0061] Specifically, according to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image after the compression process, and the compressed image is used as the compressed image corresponding to the current compression process.

[0062] In some embodiments, if the current compression scheme includes at least one image compression processing method, the execution order of each image compression processing method and the standard image parameters corresponding to each image compression processing method; then the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process, including: based on the execution order of each image compression method in the current compression scheme, the image to be compressed is compressed according to each image compression method in the current compression scheme in turn to obtain a compressed image corresponding to this compression process.

[0063] Step 204 , when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0064] Specifically, it is determined whether the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme. If they are not the same, the image evaluation data that does not meet the image evaluation standard is selected, and the image compression method corresponding to the image evaluation data is used as the current compression scheme corresponding to the next image compression process, and the process returns to step 202. If they are the same, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0065] It should be noted that the present application can also store and process the target compressed image through base64 encoding, so as to facilitate the subsequent use for result analysis when testing the image compression method.

[0066] The above-mentioned image compression method obtains the original image; for each image compression process, determines the current compression scheme corresponding to this image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method; according to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process; when the image evaluation data of the compressed image corresponding to this image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to this image compression process is used as the target compressed image of the image to be compressed. This embodiment completes the compression processing of the original image through the current compression scheme corresponding to the original image, and obtains the target compressed image when the image evaluation data of the compressed image is the same as the image evaluation standard corresponding to the current compression scheme, so that the determined target compressed image is more accurate, can retain important information in the image, and thus avoid the problem of serious distortion of the target compressed image. At the same time, the image is compressed in a targeted manner, which not only focuses on the compression direction to meet the needs, but also improves the compression efficiency.

[0067] In some embodiments, if the image compression method includes a text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process, including: performing region division processing on the image to be compressed to obtain a text region of the image to be compressed; performing text adjustment processing on the text region of the image to be compressed to obtain a compressed image corresponding to this compression process.

[0068] The text adjustment process includes at least one of text size adjustment process, text color adjustment process and text shape adjustment process.

[0069] Specifically, the image to be compressed is scanned to identify the text part and non-text part in the image to be compressed, and the image to be compressed is divided into regions. The text part in the image to be compressed is used as the text region, and the text region of the image to be compressed is subjected to text adjustment to obtain a compressed image corresponding to this compression process.

[0070] It should be noted that, after the text adjustment process is performed on the text area of ​​the compressed image, more other adjustment processes can be added to the text area as needed, and this application does not limit this.

[0071] This embodiment can process the text portion in the image to be compressed, thereby determining a more accurate compressed image and reducing the possibility of distortion of the text area in the compressed image.

[0072] In some embodiments, if the image compression method includes a non-text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process, including: dividing the image to be compressed into regions to obtain a non-text region of the image to be compressed; and cropping the non-text region of the image to be compressed to obtain a compressed image corresponding to this compression process.

[0073] Specifically, the image to be compressed is scanned to identify the text part and non-text part in the image to be compressed, and the image to be compressed is divided into regions. The non-text part in the image to be compressed is used as the non-text area, and the non-text area of ​​the image to be compressed is cropped, that is, the image area of ​​the non-text area is removed to obtain the compressed image corresponding to this compression process.

[0074] It should be noted that this embodiment can also determine whether the non-text area of ​​the image to be compressed is a blank area, and / or determine whether the non-text area of ​​the image to be compressed is a necessary area, and then determine whether to crop the non-text area of ​​the image to be compressed.

[0075] Exemplarily, the non-text area that belongs to the blank area and / or does not belong to the necessary area is cropped, and the non-text area that does not belong to the blank area and / or does not belong to the necessary area is retained.

[0076] This embodiment can process the non-text part of the image to be compressed, thereby determining a more accurate compressed image and reducing the possibility of distortion of the non-text area in the compressed image.

[0077] In some embodiments, if the image compression method includes an image color processing method; according to the image compression processing method in the current compression scheme, image compression processing is performed on the image to be compressed to obtain an initial compressed image, including: image color subtraction processing is performed on each pixel value in the compressed image to obtain a compressed image corresponding to this compression process.

[0078] Specifically, image color reduction processing (including at least one of chroma reduction and chroma change) is performed on each pixel value in the image to be compressed to obtain a compressed image corresponding to the current compression process.

[0079] This embodiment can perform image color reduction processing on each pixel value in the image to be compressed, thereby determining a more accurate compressed image and reducing the possibility of distortion of the compressed image.

[0080] In some embodiments, if the image compression processing method includes an image size processing method; according to the image compression processing method in the current compression scheme, image compression processing is performed on the image to be compressed to obtain an initial compressed image, including: compressing both the image width and image height in the image to be compressed to obtain a compressed image corresponding to this compression process.

[0081] Specifically, the image width and the image height in the image to be compressed are compressed as a whole to obtain a compressed image corresponding to this compression process.

[0082] This embodiment can compress both the image width and the image height in the image to be compressed, thereby determining a more accurate compressed image and reducing the possibility of distortion of the compressed image.

[0083] In one embodiment, this embodiment provides an optional method for image compression, and takes the method applied to a server as an example for explanation. Figure 3 As shown, the method comprises the following steps:

[0084] Step 301, obtaining an original image.

[0085] Step 302, for each image compression process, determine the current compression scheme corresponding to the current image compression process; if the current compression scheme includes at least one image compression processing method, the execution order of each image compression processing method and the standard image parameters corresponding to each image compression processing method.

[0086] Step 303 , based on the execution order of each image compression method in the current compression scheme, the image to be compressed is compressed in turn according to each image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process.

[0087] Step 304 , when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

[0088] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0089] Based on the same inventive concept, the embodiment of the present application also provides an image compression device for implementing the above-mentioned image compression method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image compression device embodiments provided below can refer to the limitations on the image compression method above, and will not be repeated here.

[0090] In an exemplary embodiment, Figure 4 As shown, an image compression device is provided, comprising: an image acquisition module 10, a scheme determination module 11, an image compression module 12 and an image evaluation module 13, wherein:

[0091] An image acquisition module 10, used to acquire an original image;

[0092] The scheme determination module 11 is used to determine the current compression scheme corresponding to each image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method;

[0093] The image compression module 12 is used to compress the image to be compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process;

[0094] The image evaluation module 13 is used to use the compressed image corresponding to the current image compression process as the target compressed image of the image to be compressed when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme.

[0095] In one embodiment, Figure 4The image compression module 12 is further used to perform region division processing on the image to be compressed to obtain the text region of the image to be compressed; perform text adjustment processing on the text region of the image to be compressed to obtain a compressed image corresponding to this compression process; wherein the text adjustment processing includes at least one of text size adjustment processing, text color adjustment processing and text shape adjustment processing.

[0096] In one embodiment, Figure 4 The image compression module 12 is further used to perform region division processing on the image to be compressed to obtain the non-text region of the image to be compressed; and to perform cropping processing on the non-text region of the image to be compressed to obtain the compressed image corresponding to this compression process.

[0097] In one embodiment, Figure 4 The image compression module 12 is further used to perform image color reduction processing on each pixel value in the image to be compressed to obtain a compressed image corresponding to this compression process.

[0098] In one embodiment, Figure 4 The image compression module 12 is further used to compress both the image width and the image height in the image to be compressed to obtain a compressed image corresponding to this compression process.

[0099] In one embodiment, Figure 4 The image compression module 12 is also used to compress the image to be compressed according to the image compression methods in the current compression scheme in turn based on the execution order of the image compression methods in the current compression scheme to obtain a compressed image corresponding to this compression process.

[0100] Each module in the above-mentioned image compression device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0101] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store current compression scheme data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image compression method is implemented.

[0102] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image compression method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0103] Those skilled in the art will understand that Figure 5 and Figure 6The structure shown in the figure is only a block diagram of a part of the structure 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 computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0104] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0105] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0106] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0107] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image compression method, characterized in that: The method comprises: Get the original image; For each image compression process, determining a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method; According to the image compression method in the current compression scheme, the image to be compressed is compressed to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process; When the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme, the compressed image corresponding to the current image compression process is used as the target compressed image of the image to be compressed.

2. The method according to claim 1, characterized in that If the image compression method includes a text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to the current compression process, including: Performing region division processing on the image to be compressed to obtain a text region of the image to be compressed; Performing text adjustment processing on the text area of ​​the image to be compressed to obtain a compressed image corresponding to this compression process; The text adjustment process includes at least one of text size adjustment process, text color adjustment process and text shape adjustment process.

3. The method according to claim 1, characterized in that If the image compression method includes a non-text content processing method, the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to the current compression process, including: Performing region division processing on the image to be compressed to obtain a non-text region of the image to be compressed; The non-text area of ​​the image to be compressed is cropped to obtain a compressed image corresponding to this compression process.

4. The method according to claim 1, characterized in that: If the image compression method includes an image color processing method; performing image compression processing on the image to be compressed according to the image compression processing method in the current compression scheme to obtain an initial compressed image includes: Performing image color reduction processing on each pixel value in the image to be compressed to obtain a compressed image corresponding to this compression process.

5. The method according to claim 1, characterized in that If the image compression processing method includes an image size processing method; performing image compression processing on the image to be compressed according to the image compression processing method in the current compression scheme to obtain an initial compressed image includes: The image width and image height in the image to be compressed are compressed to obtain a compressed image corresponding to this compression process.

6. The method according to any one of claims 1 to 4, characterized in that: If the current compression scheme includes at least one image compression processing method, the execution order of each image compression processing method and the standard image parameters corresponding to each image compression processing method; then the image to be compressed is compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process, including: Based on the execution order of each image compression method in the current compression scheme, the image to be compressed is compressed in turn according to each image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process.

7. An image compression device, characterized in that: The device comprises: An image acquisition module, used for acquiring original images; A scheme determination module is used to determine, for each image compression process, a current compression scheme corresponding to the current image compression process; the current compression scheme includes an image compression method and an image evaluation standard corresponding to the image compression method; An image compression module, used to compress the image to be compressed according to the image compression method in the current compression scheme to obtain a compressed image corresponding to this compression process; wherein the image to be compressed is the original image or the compressed image corresponding to the previous image compression process; The image evaluation module is used to use the compressed image corresponding to the current image compression process as the target compressed image of the image to be compressed when the image evaluation data of the compressed image corresponding to the current image compression process is the same as the image evaluation standard corresponding to the current compression scheme.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Raster image compression and reconstruction method and device, computer equipment and storage medium

    CN121810823A

  • Grid image compression and reconstruction method, device, computer equipment and storage medium

    CN121810823B