CN115037937B - Image compression method, apparatus, device and medium - Google Patents
Image compression method, apparatus, device and medium Download PDFInfo
- Publication number
- CN115037937B CN115037937B CN202210626130.0A CN202210626130A CN115037937B CN 115037937 B CN115037937 B CN 115037937B CN 202210626130 A CN202210626130 A CN 202210626130A CN 115037937 B CN115037937 B CN 115037937B
- Authority
- CN
- China
- Prior art keywords
- image
- compression
- target
- compressed
- ratio
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/172—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本公开提供一种图像压缩方法、装置、设备及介质,其中该方法包括:获取待压缩的原始图像;从预设的多种图像类别中获取所述原始图像所属的目标类别,以及所述目标类别对应的压缩损失阈值和多个图像压缩比例;将多个所述图像压缩比例按照由小至大的顺序依次对所述原始图像执行压缩处理,直至获取到目标压缩图像;所述目标压缩图像是多个所述图像压缩比例对应的压缩图像中压缩损失与所述压缩损失阈值最接近且不大于所述压缩损失阈值的压缩图像。本公开在符合图像要求(不大于压缩损失阈值)的基础上能够尽可能最大程度地对原始图像进行压缩,在节约人力成本的基础上,也较好地提升了图像压缩效果。
The present disclosure provides an image compression method, device, equipment, and medium, wherein the method includes: acquiring an original image to be compressed; acquiring the target category to which the original image belongs from a variety of preset image categories, and the target The compression loss threshold corresponding to the category and a plurality of image compression ratios; the plurality of image compression ratios are sequentially compressed on the original image in order from small to large until the target compressed image is obtained; the target compressed image It is a compressed image whose compression loss is closest to the compression loss threshold and not greater than the compression loss threshold among the compressed images corresponding to the image compression ratio. The disclosure can compress the original image as much as possible on the basis of meeting the image requirements (not greater than the compression loss threshold), and better improve the image compression effect on the basis of saving labor costs.
Description
技术领域technical field
本公开涉及图像处理领域,尤其涉及图像压缩方法、装置、设备及介质。The present disclosure relates to the field of image processing, in particular to an image compression method, device, equipment and medium.
背景技术Background technique
图像压缩是数据压缩技术在数字图像上的应用,在很多场合下都需要对图像进行压缩,通过压缩图像的方式来节约存储图像所需的空间或者缩短传输图像所需的时间。在诸如Unity等平台中,通常需要用户凭借经验手动设置图像的压缩比例,然后基于用户设置的压缩比例进行图像压缩,但是这种方式容易出现压缩后的图像仍旧过大或者出现失真等问题,因此还需要用户反复调整修改图像压缩比例,费时费力,需要消耗较高的人力成本。Image compression is the application of data compression technology on digital images. In many occasions, images need to be compressed. By compressing images, the space required for storing images can be saved or the time required for transmitting images can be shortened. In platforms such as Unity, users usually need to manually set the compression ratio of the image based on experience, and then perform image compression based on the compression ratio set by the user, but this method is prone to problems such as the compressed image is still too large or distorted, so It also requires the user to repeatedly adjust and modify the image compression ratio, which is time-consuming and labor-intensive, and requires high labor costs.
发明内容Contents of the invention
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像压缩方法、装置、设备及介质。In order to solve the above technical problems or at least partly solve the above technical problems, the present disclosure provides an image compression method, device, equipment and medium.
根据本公开的一方面,提供了一种获取待压缩的原始图像;从预设的多种图像类别中获取所述原始图像所属的目标类别,以及所述目标类别对应的压缩损失阈值和多个图像压缩比例;将多个所述图像压缩比例按照由小至大的顺序依次对所述原始图像执行压缩处理,直至获取到目标压缩图像;所述目标压缩图像是多个所述图像压缩比例对应的压缩图像中压缩损失与所述压缩损失阈值最接近且不大于所述压缩损失阈值的压缩图像。According to one aspect of the present disclosure, there is provided a method of obtaining an original image to be compressed; obtaining the target category to which the original image belongs, as well as the compression loss threshold corresponding to the target category and multiple Image compression ratio; perform compression processing on the original image sequentially in order of a plurality of the image compression ratios from small to large until the target compressed image is obtained; the target compressed image is a plurality of the image compression ratios corresponding to Among the compressed images, the compressed images whose compression loss is closest to the compression loss threshold and not greater than the compression loss threshold.
根据本公开的另一方面,提供了一种图像压缩装置,包括:原始图像获取模块,用于获取待压缩的原始图像;阈值及比例获取模块,用于从预设的多种图像类别中获取所述原始图像所属的目标类别,以及所述目标类别对应的压缩损失阈值和多个图像压缩比例;图像压缩模块,用于将多个所述图像压缩比例按照由小至大的顺序依次对所述原始图像执行压缩处理,直至获取到目标压缩图像;所述目标压缩图像是多个所述图像压缩比例对应的压缩图像中压缩损失与所述压缩损失阈值最接近且不大于所述压缩损失阈值的压缩图像。According to another aspect of the present disclosure, an image compression device is provided, including: an original image acquisition module, used to acquire the original image to be compressed; a threshold and ratio acquisition module, used to acquire the The target category to which the original image belongs, and the compression loss threshold and multiple image compression ratios corresponding to the target category; the image compression module is used to sequentially compare the multiple image compression ratios in order from small to large The original image performs compression processing until the target compressed image is obtained; the target compressed image is a plurality of compressed images corresponding to the image compression ratio, and the compression loss is the closest to the compression loss threshold and is not greater than the compression loss threshold compressed image.
根据本公开的另一方面,提供了一种电子设备,包括:处理器;以及存储程序的存储器,其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行上述图像压缩方法。According to another aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory storing a program, wherein the program includes instructions which, when executed by the processor, cause the processor to Execute the image compression method described above.
根据本公开的另一方面,提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述图像压缩方法。According to another aspect of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the above image compression method.
本公开实施例中提供的上述技术方案,从预设的多种图像类别中获取原始图像所属的目标类别,以及目标类别对应的压缩损失阈值和多个图像压缩比例,可以得到更适用于原始图像的压缩损失阈值以及可用于对原始图像进行压缩的多个图像压缩比例,进而将多个图像压缩比例按照由小至大的顺序依次对原始图像执行压缩处理,直至获取到压缩损失与压缩损失阈值最接近且不大于压缩损失阈值的目标压缩图像;上述方式无需人工凭借经验设置压缩比例并反复调整,而是可以采用适用于原始图像的多个图像压缩比例从小至大尝试压缩直至得到目标压缩图像,该目标压缩图像最接近且不大于压缩损失阈值,因此上述方式在符合图像要求(不大于压缩损失阈值)的基础上能够尽可能最大程度地对原始图像进行压缩,在节约人力成本的基础上,也较好地提升了图像压缩效果。The above technical solutions provided in the embodiments of the present disclosure obtain the target category to which the original image belongs, as well as the compression loss threshold and multiple image compression ratios corresponding to the target category from various preset image categories, which can be more suitable for the original image. The compression loss threshold and multiple image compression ratios that can be used to compress the original image, and then perform compression processing on the original image in order of multiple image compression ratios in order from small to large, until the compression loss and compression loss threshold are obtained The target compressed image that is closest to and not greater than the compression loss threshold; the above method does not need to manually set the compression ratio based on experience and adjust it repeatedly, but can use multiple image compression ratios suitable for the original image to try to compress from small to large until the target compressed image is obtained , the target compressed image is closest to and not greater than the compression loss threshold, so the above method can compress the original image as much as possible on the basis of meeting the image requirements (not greater than the compression loss threshold), and on the basis of saving labor costs , and also better improve the image compression effect.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood through the following description.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings without paying creative labor.
图1为本公开实施例提供的一种图像压缩方法的流程示意图;FIG. 1 is a schematic flowchart of an image compression method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的一种图像压缩方法的流程示意图;FIG. 2 is a schematic flowchart of an image compression method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种图像压缩装置的结构示意图;FIG. 3 is a schematic structural diagram of an image compression device provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种电子设备的结构示意图。Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein; A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method implementations of the present disclosure may be executed in different orders, and/or executed in parallel. Additionally, method embodiments may include additional steps and/or omit performing illustrated steps. The scope of the present disclosure is not limited in this respect.
本公开使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。As used in this disclosure, the term "comprise" and its variations are open-ended, ie "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one further embodiment"; the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms will be given in the description below. It should be noted that concepts such as "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the sequence of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more" multiple".
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, in the case of no conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.
在诸如Unity等平台中,通常需要用户凭借经验手动设置图像的压缩比例,压缩所得的图像可能不符合需求(仍旧过大或失真),如果压缩图像仍旧过大,则不便于图像存储或传输,如果压缩图像失真,则可能会严重影响后续的图像应用。而且在诸如Unity内容开发平台中,每个开发项目都可能会涉及到大量的图片,如果每张图片都需要用户进行手动压缩,且还需要人为核查压缩后的图像是否符合需求,非常耗费人力成本。为了至少部分地改善以上问题,本公开实施例提供了一种图像压缩方法、装置、设备及介质,以下进行详细阐述说明。In platforms such as Unity, users usually need to manually set the image compression ratio based on experience. The compressed image may not meet the requirements (still too large or distorted). If the compressed image is still too large, it is not convenient for image storage or transmission. If the compressed image is distorted, it may seriously affect the subsequent image application. Moreover, in a content development platform such as Unity, each development project may involve a large number of pictures. If each picture needs to be manually compressed by the user, and it is also necessary to manually check whether the compressed image meets the requirements, it is very labor-intensive. . In order to at least partly improve the above problems, embodiments of the present disclosure provide an image compression method, device, device, and medium, which will be described in detail below.
图1为本公开实施例提供的一种图像压缩方法的流程示意图,该方法可以由图像压缩装置执行,其中该装置可以采用软件和/或硬件实现,一般可集成在电子设备中,该电子设备包括但不限于手机、电脑、服务器、便携式穿戴设备、机器人等具有图像处理能力的设备,如图1所示,该方法主要包括如下步骤S102~步骤S106:Fig. 1 is a schematic flow chart of an image compression method provided by an embodiment of the present disclosure. The method can be executed by an image compression device, wherein the device can be implemented by software and/or hardware, and can generally be integrated in an electronic device. The electronic device Including but not limited to mobile phones, computers, servers, portable wearable devices, robots and other devices with image processing capabilities, as shown in Figure 1, the method mainly includes the following steps S102 to S106:
步骤S102,获取待压缩的原始图像。Step S102, acquiring the original image to be compressed.
本公开实施例对原始图像的内容和用途不进行限定,该原始图像可以是用户从本地选择、利用外部设备上传或者通过网络下载的图像,本公开实施例对原始图像的来源不进行限定,任何需要压缩的原始图像均可。The embodiment of the present disclosure does not limit the content and use of the original image. The original image can be an image selected by the user locally, uploaded by using an external device, or downloaded through the network. The source of the original image is not limited in the embodiment of the present disclosure. Any Raw images that require compression are fine.
步骤S104,从预设的多种图像类别中获取原始图像所属的目标类别,以及目标类别对应的压缩损失阈值和多个图像压缩比例。In step S104, the target category to which the original image belongs, as well as the compression loss threshold and multiple image compression ratios corresponding to the target category are obtained from various preset image categories.
其中,图像压缩比例为原始图像的大小与压缩图像的大小的比值。图像压缩比例越大,则压缩图像越小。在本公开实施例中,可以预先基于图像内容和/或图像用途设置多种图像类别。示例性地,可以基于图像内容设置多种图像类别,诸如人物图像类别、风景图像类别、夜景图像类别等;也可以基于图像用途设置多种图像类别,诸如用于作为贴纸的图像类别、用于作为背景的图像类别、用于目标对象识别的图像类别等;还可以基于图像内容和图像用途设置多种图像类别,诸如材质贴图类别、法线贴图类别等。本公开实施例对划分图像类别的方式不进行限制。Wherein, the image compression ratio is a ratio of the size of the original image to the size of the compressed image. The larger the image compression ratio, the smaller the compressed image. In the embodiments of the present disclosure, various image categories may be set in advance based on image content and/or image usage. Exemplarily, multiple image categories can be set based on image content, such as person image categories, landscape image categories, night scene image categories, etc.; multiple image categories can also be set based on image usage, such as image categories for stickers, image categories for Image category as background, image category for target object recognition, etc.; multiple image categories can also be set based on image content and image usage, such as material map category, normal map category, etc. The embodiment of the present disclosure does not limit the manner of classifying image categories.
在一些实施方式中,不同的图像类别对应的压缩损失阈值不同,和/或,不同的图像类别对应的多个图像压缩比例不同。也即,可以根据每种图像类别的特征,分别为每种图像类别设置相应的压缩损失阈值和/或多种图像压缩比例。诸如,对于人物图像类别或者用于人脸识别的图像类别等图像类别大多需要较高的清晰度,因此可以设置相对较小的压缩损失阈值(也即可接受的压缩程度较低),以便保证压缩后的图像仍旧具有较好的清晰度;又诸如,对于用于作为背景的图像类别的清晰度需求通常不高,因此可以设置相对较大的压缩损失阈值(也即可接受的压缩程度较高),以此尽可能将此类图像进行压缩。同样,不同的图像类别对应的可用的图像压缩比例的数量可以不同,诸如人物图像类别设置2个图像压缩比例,风景图像类别设置3个图像压缩比例等,且不同的图像类别对应的图像压缩比例的具体数值可以相同,也可以不同,具体可根据实际情况灵活设置,在此不进行限制。In some implementations, different image categories correspond to different compression loss thresholds, and/or different image categories correspond to different image compression ratios. That is, according to the characteristics of each image category, corresponding compression loss thresholds and/or various image compression ratios may be set for each image category. For example, most image categories such as person image categories or image categories used for face recognition require high definition, so a relatively small compression loss threshold (that is, an acceptable compression degree) can be set to ensure The compressed image still has a good definition; another example is that the definition requirement for the image category used as the background is usually not high, so a relatively large compression loss threshold can be set (that is, the acceptable compression degree is relatively low). High) to compress such images as much as possible. Similarly, the number of available image compression ratios corresponding to different image categories can be different, such as setting 2 image compression ratios for the person image category, setting 3 image compression ratios for the landscape image category, etc., and the image compression ratios corresponding to different image categories The specific values of can be the same or different, which can be flexibly set according to the actual situation, and are not limited here.
在获取到原始图像后,可以基于已有的多个图像类别,根据原始图像的内容或者原始图像的用途确定原始图像所属的目标类别,进而获取目标类别对应的压缩损失阈值和多个图像压缩比例。After the original image is obtained, based on the existing multiple image categories, the target category to which the original image belongs can be determined according to the content of the original image or the purpose of the original image, and then the compression loss threshold and multiple image compression ratios corresponding to the target category can be obtained .
步骤S106,将多个图像压缩比例按照由小至大的顺序依次对原始图像执行压缩处理,直至获取到目标压缩图像;目标压缩图像是多个图像压缩比例对应的压缩图像中压缩损失与压缩损失阈值最接近且不大于压缩损失阈值的压缩图像。Step S106, performing compression processing on the original image sequentially with multiple image compression ratios in ascending order until the target compressed image is obtained; the target compressed image is the compression loss and compression loss in the compressed image corresponding to the multiple image compression ratios Compressed images whose threshold is closest to and not greater than the compression loss threshold.
通过将多个图像压缩比例按照由小至大的顺序依次对原始图像执行压缩处理,也即对压缩图像逐步提升压缩比例,直至得到目标压缩图像为止,目标压缩图像的压缩损失最接近于压缩损失阈值,且目标压缩图像的压缩损失不大于压缩损失阈值。By compressing multiple image compression ratios in order from small to large, the original image is compressed sequentially, that is, the compression ratio of the compressed image is gradually increased until the target compressed image is obtained, and the compression loss of the target compressed image is closest to the compression loss threshold, and the compression loss of the target compressed image is not greater than the compression loss threshold.
在实际应用中,从多个图像压缩比例中的最小比例开始逐一作为当前的图像压缩比例,并对原始图像进行压缩;如果当前的图像压缩比例对应的压缩图像的压缩损失小于压缩损失阈值,可以按照比例排序再采用下一个图像压缩比例对原始图像进一步压缩,直至试到可以终结的图像压缩比例(以下简称为终结比例)。其中,终结比例所得的压缩图像的压缩损失值大于或等于压缩损失阈值,或者,终结比例为多个图像压缩比例中最大的图像压缩比例(以下简称为最大比例)。之后可以进一步根据终结比例对应的压缩图像的压缩损失与压缩损失阈值之间的比较结果,获取目标压缩图像。诸如,在终结比例对应的压缩图像的压缩损失等于压缩损失阈值时,则将终结比例对应的压缩图像作为目标压缩图像,在终结比例对应的压缩图像的压缩损失大于压缩损失阈值时,则将终结比例之前的图像压缩比例对应的压缩图像作为目标压缩图像,在终结比例为最大比例,且最大比例的压缩图像的压缩损失小于压缩损失阈值时,则直接采用最大比例的压缩图像作为目标压缩图像。In practical applications, the minimum ratio of multiple image compression ratios is used as the current image compression ratio one by one, and the original image is compressed; if the compression loss of the compressed image corresponding to the current image compression ratio is less than the compression loss threshold, you can Sorting according to the ratio, the next image compression ratio is used to further compress the original image until the final image compression ratio (hereinafter referred to as the termination ratio) is reached. Wherein, the compression loss value of the compressed image obtained by the termination ratio is greater than or equal to the compression loss threshold, or the termination ratio is the largest image compression ratio among multiple image compression ratios (hereinafter referred to as the maximum ratio). Afterwards, the target compressed image may be further obtained according to the comparison result between the compression loss of the compressed image corresponding to the final ratio and the compression loss threshold. For example, when the compression loss of the compressed image corresponding to the termination ratio is equal to the compression loss threshold, the compressed image corresponding to the termination ratio is used as the target compressed image, and when the compression loss of the compressed image corresponding to the termination ratio is greater than the compression loss threshold, the termination The compressed image corresponding to the image compression ratio before the ratio is used as the target compressed image. When the final ratio is the maximum ratio and the compression loss of the compressed image with the maximum ratio is less than the compression loss threshold, the compressed image with the maximum ratio is directly used as the target compressed image.
上述方式无需人工凭借经验设置压缩比例并反复调整,而是可以采用适用于原始图像的多个图像压缩比例从小至大尝试压缩直至得到目标压缩图像,该目标压缩图像最接近且不大于压缩损失阈值(基于原始图像的所属图像类别确定),因此上述方式在符合图像要求(不大于压缩损失阈值)的基础上能够尽可能最大程度地对原始图像进行压缩,在节约人力成本的基础上,也较好地提升了图像压缩效果。The above method does not need to manually set the compression ratio based on experience and adjust it repeatedly. Instead, it can use multiple image compression ratios suitable for the original image from small to large and try to compress until the target compressed image is obtained. The target compressed image is closest to and not greater than the compression loss threshold. (determined based on the image category of the original image), so the above method can compress the original image as much as possible on the basis of meeting the image requirements (not greater than the compression loss threshold), and saves labor costs. Improved the image compression effect.
在一些实施示例中,将多个图像压缩比例按照由小至大的顺序依次对原始图像执行压缩处理,直至获取到目标压缩图像的步骤,可以参照如下方式执行:可以首先将多个图像压缩比例按照由小至大的顺序依次作为目标比例,并采用目标比例对原始图像执行压缩处理,得到目标比例对应的压缩图像;之后获取目标比例对应的压缩图像的压缩损失值;然后基于压缩损失值与压缩损失阈值的比较结果对目标比例进行更新,直至获取到目标压缩图像。通过上述方式,有助于逐步找到能够最大程度压缩图像且符合要求(不大于压缩损失阈值)的目标压缩图像。In some implementation examples, the multiple image compression ratios are sequentially compressed on the original image in ascending order until the target compressed image is obtained. Take the target ratio in order from small to large, and use the target ratio to perform compression processing on the original image to obtain the compressed image corresponding to the target ratio; then obtain the compression loss value of the compressed image corresponding to the target ratio; then based on the compression loss value and The comparison result of the compression loss threshold updates the target ratio until the target compressed image is obtained. Through the above method, it is helpful to gradually find the target compressed image that can compress the image to the maximum extent and meet the requirements (not greater than the compression loss threshold).
具体而言,基于压缩损失值与压缩损失阈值的比较结果对目标比例进行更新,直至获取到目标压缩图像的步骤,可以基于目标比例以及目标比例对应的压缩损失值的具体情况参照如下(1)~(4)执行:Specifically, the target ratio is updated based on the comparison result of the compression loss value and the compression loss threshold until the step of obtaining the target compressed image can be based on the specific situation of the target ratio and the compression loss value corresponding to the target ratio as follows (1) ~(4) Execution:
(1)在目标比例并非多个图像压缩比例中的最大比例,且目标比例对应的压缩损失值小于压缩损失阈值的情况下,对目标比例进行更新,直至采用最大比例作为目标比例,或者直至目标比例对应的压缩损失值大于或等于压缩损失阈值。(1) When the target ratio is not the largest ratio among multiple image compression ratios, and the compression loss value corresponding to the target ratio is less than the compression loss threshold, update the target ratio until the largest ratio is used as the target ratio, or until the target ratio The compression loss value corresponding to the ratio is greater than or equal to the compression loss threshold.
具体而言,采用排在目标比例的下一个图像压缩比例作为更新后的目标比例,然后再采用更新后的目标比例对原始图像进行图像压缩,直至采用最大比例作为目标比例,或者直至目标比例对应的压缩损失值大于或等于压缩损失阈值,此时则停止更新目标比例。Specifically, the next image compression ratio ranked in the target ratio is used as the updated target ratio, and then the original image is compressed using the updated target ratio until the largest ratio is used as the target ratio, or until the target ratio corresponds to The compression loss value of is greater than or equal to the compression loss threshold, then stop updating the target ratio.
(2)在目标比例为最大比例,且目标比例对应的压缩损失值小于或等于压缩损失阈值的情况下,采用最大比例对应的压缩图像作为目标压缩图像。也即,如果已经试至最大比例,且采用最大比例对原始图像进行压缩得到压缩图像,该压缩图像的压缩损失值仍旧不大于压缩损失阈值,则直接采用最大比例对应的压缩图像作为目标压缩图像,此时达到最大程度的图像压缩效果。(2) When the target ratio is the maximum ratio, and the compression loss value corresponding to the target ratio is less than or equal to the compression loss threshold, the compressed image corresponding to the maximum ratio is used as the target compressed image. That is, if the maximum ratio has been tried, and the original image is compressed with the maximum ratio to obtain a compressed image, and the compression loss value of the compressed image is still not greater than the compression loss threshold, the compressed image corresponding to the maximum ratio is directly used as the target compressed image , at this time to achieve the maximum image compression effect.
(3)在目标比例对应的压缩损失值大于压缩损失阈值的情况下,将排在目标比例前一位的图像压缩比例对应的压缩图像作为目标压缩图像。也即,在将多个图像压缩比例从小到大的顺序对原始图像进行压缩,直至试到压缩损失值大于压缩损失阈值的图像压缩比例(即为终结比例)时,该终结比例的前一个图像压缩比例即为可对原始图像进行最大程度压缩的比例,前一个图像压缩比例对原始图像所得的压缩图像即满足与压缩损失阈值最接近且不大于压缩损失阈值的要求。(3) When the compression loss value corresponding to the target ratio is greater than the compression loss threshold, the compressed image corresponding to the image compression ratio that is one place ahead of the target ratio is used as the target compressed image. That is to say, the original image is compressed in ascending order of the compression ratios of multiple images until the image compression ratio (that is, the termination ratio) whose compression loss value is greater than the compression loss threshold is tried, the previous image of the termination ratio The compression ratio is the ratio that can compress the original image to the greatest extent, and the compressed image obtained by the previous image compression ratio on the original image meets the requirement that it is closest to the compression loss threshold and not greater than the compression loss threshold.
(4)在目标比例对应的压缩损失值等于压缩损失阈值的情况下,将目标比例对应的压缩图像作为目标压缩图像。在目标比例的压缩损失值等于压缩损失阈值时,说明该目标比例对应的压缩图像正好满足与压缩损失阈值最接近且不大于压缩损失阈值的要求。(4) When the compression loss value corresponding to the target ratio is equal to the compression loss threshold, the compressed image corresponding to the target ratio is used as the target compressed image. When the compression loss value of the target ratio is equal to the compression loss threshold, it means that the compressed image corresponding to the target ratio just meets the requirement that the compression loss threshold is closest to and not greater than the compression loss threshold.
为便于理解,示例性地,多个图像压缩比例由小至大的顺序分别为比例1、比例2、比例3、直至比例N(也即多个图像压缩比例中的最大比例),则首先采用比例1对原始图像执行压缩处理(此时比例1则为目标比例),得到比例1对应的压缩图像;如果该压缩图像的压缩损失小于压缩损失阈值,则继续采用比例2对原始图像执行压缩处理(此时将比例2作为目标比例,也即目标比例得以更新),得到比例2对应的压缩图像;如果比例2对应的压缩图像的压缩损失小于压缩损失阈值,则继续采用比例3对原始图像执行压缩图像(此时将比例3作为目标比例,也即目标比例得以更新),以此类推,直至得到压缩损失与压缩损失阈值最接近且不大于压缩损失阈值的目标压缩图像。诸如,如果比例3对应的压缩图像的压缩损失大于压缩损失阈值,则将比例2对应的压缩图像作为与压缩损失阈值最接近且不大于压缩损失阈值的目标压缩图像,或者如果比例3对应的压缩图像的压缩损失等于压缩损失阈值,则将比例3对应的压缩图像作为目标压缩图像;之后将不再采用比例4~比例N进行图像压缩尝试,因为比例4~比例N对应的压缩图像的压缩损失必然会越来越大,且均大于压缩损失阈值。当然,如果比例N之前的比例对应的压缩图像均小于压缩损失阈值,则在比例N对应的压缩图像小于或等于压缩损失阈值时,将比例N对应的压缩图像作为目标压缩图像,而在比例N对应的压缩图像大于压缩损失阈值时,则将比例N-1对应的压缩图像作为目标压缩图像。通过上述方式,可以高效地获取到目标压缩图像。For ease of understanding, for example, the order of multiple image compression ratios from small to large is ratio 1, ratio 2, ratio 3, and ratio N (that is, the largest ratio among the plurality of image compression ratios), then first use Scale 1 performs compression processing on the original image (at this time, Scale 1 is the target scale) to obtain the compressed image corresponding to Scale 1; if the compression loss of the compressed image is less than the compression loss threshold, continue to use Scale 2 to perform compression processing on the original image (At this time, the ratio 2 is used as the target ratio, that is, the target ratio is updated), and the compressed image corresponding to ratio 2 is obtained; if the compression loss of the compressed image corresponding to ratio 2 is less than the compression loss threshold, continue to use ratio 3 to perform on the original image Compress the image (at this time, the ratio 3 is used as the target ratio, that is, the target ratio is updated), and so on, until the target compressed image whose compression loss is closest to the compression loss threshold and not greater than the compression loss threshold is obtained. For example, if the compression loss of the compressed image corresponding to ratio 3 is greater than the compression loss threshold, then use the compressed image corresponding to ratio 2 as the target compressed image that is closest to the compression loss threshold and not greater than the compression loss threshold, or if the compression loss corresponding to ratio 3 If the compression loss of the image is equal to the compression loss threshold, the compressed image corresponding to ratio 3 will be used as the target compressed image; after that, image compression attempts will no longer be performed with ratio 4 to ratio N, because the compression loss of the compressed image corresponding to ratio 4 to ratio N is It is bound to become larger and larger, and both are greater than the compression loss threshold. Of course, if the compressed images corresponding to the ratios before the ratio N are all smaller than the compression loss threshold, then when the compressed image corresponding to the ratio N is less than or equal to the compression loss threshold, the compressed image corresponding to the ratio N will be used as the target compressed image, and at the ratio N When the corresponding compressed image is greater than the compression loss threshold, the compressed image corresponding to the ratio N−1 is used as the target compressed image. Through the above manner, the target compressed image can be efficiently acquired.
本公开实施例提供了获取目标比例对应的压缩图像的压缩损失值的具体实施示例,包括如下步骤A~步骤C:The embodiment of the present disclosure provides a specific implementation example of obtaining the compression loss value of the compressed image corresponding to the target ratio, including the following steps A to C:
步骤A,基于原始图像的像素值以及目标比例对应的压缩图像的像素值,确定目标比例对应的压缩图像的像素损失值。Step A, based on the pixel values of the original image and the pixel values of the compressed image corresponding to the target ratio, determine the pixel loss value of the compressed image corresponding to the target ratio.
在一些实施方式中,可以基于原始图像中的每个像素值与目标比例对应的压缩图像中的相应像素值计算损失值,并针对所有像素值对应的损失值进行加权平均,得到压缩图像的像素损失值。上述方式可以合理客观地对压缩图像的像素损失进行评估。In some implementations, the loss value can be calculated based on each pixel value in the original image and the corresponding pixel value in the compressed image corresponding to the target ratio, and a weighted average is performed on the loss values corresponding to all pixel values to obtain the pixel of the compressed image loss value. The above method can reasonably and objectively evaluate the pixel loss of the compressed image.
步骤B,根据原始图像的线条平滑度以及目标比例对应的压缩图像的线条平滑度,确定目标比例对应的压缩图像的平滑损失值。Step B: Determine the smoothing loss value of the compressed image corresponding to the target ratio according to the line smoothness of the original image and the line smoothness of the compressed image corresponding to the target ratio.
在一些实施方式中,线条平滑度基于线条的锯齿数量表征;且锯齿数量与线条平滑度呈负相关,也即,锯齿数量越多,线条平滑度越低。在此基础上,在根据原始图像的线条平滑度以及目标比例对应的压缩图像的线条平滑度,确定目标比例对应的压缩图像的平滑损失值时,可以首先根据原始图像中的线条锯齿数量以及目标比例对应的压缩图像中的线条锯齿数量,确定目标比例对应的压缩图像的线条锯齿增量;然后根据预先设置的多个锯齿增量区间,确定压缩图像的线条锯齿增量所属的目标增量区间;最后根据预先设置的各锯齿增量区间与平滑损失值之间的对应关系,获取目标增量区间对应的平滑损失值,并将获取的平滑损失值作为压缩图像的线条锯齿增量对应的平滑损失值。在实际应用中,可以根据需求灵活设置增量区间的范围,在此不进行限制。通过上述方式,可以便捷且准确地对图像的线条平滑度进行估计。In some embodiments, the line smoothness is characterized based on the number of jagged lines; and the number of jagged lines is negatively correlated with the smoothness of the line, that is, the greater the number of jagged lines, the lower the smoothness of the line. On this basis, when determining the smoothness loss value of the compressed image corresponding to the target ratio according to the line smoothness of the original image and the line smoothness of the compressed image corresponding to the target ratio, it can first be based on the number of line jaggies in the original image and the target ratio. The number of line aliases in the compressed image corresponding to the ratio, determine the line aliasing increment of the compressed image corresponding to the target ratio; and then determine the target increment interval to which the line aliasing increment of the compressed image belongs according to the preset multiple aliasing increment intervals ;Finally, according to the preset correspondence between each sawtooth increment interval and the smoothing loss value, obtain the smoothing loss value corresponding to the target increment interval, and use the obtained smoothing loss value as the smoothing value corresponding to the line sawtooth increment of the compressed image loss value. In practical applications, the range of the incremental interval can be flexibly set according to requirements, and there is no limitation here. Through the above method, the line smoothness of the image can be estimated conveniently and accurately.
步骤C,根据像素损失值和平滑损失值,生成目标比例对应的压缩图像的压缩损失值。Step C, generating a compression loss value of the compressed image corresponding to the target ratio according to the pixel loss value and the smoothing loss value.
在一些具体的实施示例中,可以首先获取像素损失值对应的第一权重以及平滑损失值对应的第二权重,并将像素损失值和平滑损失值进行归一化处理;之后根据第一权重和第二权重,将归一化后的像素损失值以及归一化后的平滑损失值进行加权平均运算,将运算结果作为目标比例对应的压缩图像的压缩损失值。在实际应用中,可以根据需求灵活设置第一权重和第二权重,第一权重和第二权重的数值可以相同也可以不同,以此来调节像素损失以及平滑损失对压缩图像的整个压缩损失的影响。In some specific implementation examples, the first weight corresponding to the pixel loss value and the second weight corresponding to the smoothing loss value may be obtained first, and the pixel loss value and the smoothing loss value are normalized; then according to the first weight and The second weight is to perform a weighted average operation on the normalized pixel loss value and the normalized smoothing loss value, and use the operation result as the compression loss value of the compressed image corresponding to the target ratio. In practical applications, the first weight and the second weight can be flexibly set according to requirements, and the values of the first weight and the second weight can be the same or different, so as to adjust the effect of pixel loss and smoothing loss on the entire compression loss of the compressed image. Influence.
本公开实施例提供的上述方式可以综合衡量像素损失以及平滑损失,以此来客观地评估压缩图像的压缩损失,从而保障压缩损失值的准确性。The foregoing method provided by the embodiments of the present disclosure can comprehensively measure the pixel loss and the smoothing loss, so as to objectively evaluate the compression loss of the compressed image, thereby ensuring the accuracy of the compression loss value.
在前述实施例的基础上,为便于理解,还可以参见图2所示的图像压缩方法的流程示意图,主要包括如下步骤S202~步骤S216:On the basis of the foregoing embodiments, for ease of understanding, you can also refer to the schematic flowchart of the image compression method shown in FIG. 2 , which mainly includes the following steps S202 to S216:
步骤S202,获取原始图像。Step S202, acquiring an original image.
步骤S204,从预设的多种图像类别中获取原始图像所属的目标类别,以及目标类别对应的压缩损失阈值和多个图像压缩比例。In step S204, the target category to which the original image belongs, as well as the compression loss threshold and multiple image compression ratios corresponding to the target category are obtained from various preset image categories.
步骤S206,将多个图像压缩比例按照由小至大的顺序排序,得到排序结果。Step S206 , sorting the multiple image compression ratios in descending order to obtain a sorting result.
步骤S208,根据排序结果从多个图像压缩比例中确定当前的目标比例。初始的目标比例为多个图像压缩比例的最小值,之后可按序更新目标比例,直至无需再更新目标比例为止。Step S208, determining the current target ratio from multiple image compression ratios according to the sorting result. The initial target ratio is the minimum value of multiple image compression ratios, and then the target ratios can be updated sequentially until there is no need to update the target ratio.
步骤S210,获取目标比例对应的压缩图像的压缩损失值。Step S210, acquiring the compression loss value of the compressed image corresponding to the target ratio.
步骤S212,对上述压缩损失值与压缩损失阈值进行比较,得到比较结果。Step S212, comparing the compression loss value with the compression loss threshold to obtain a comparison result.
步骤S214,根据比较结果判断是否更新目标比例,如果是,执行步骤S208;如果否,执行步骤S216。具体而言,在目标比例并非多个图像压缩比例中的最大比例,且目标比例对应的压缩损失值小于压缩损失阈值的情况下,确定需要对目标比例进行更新。Step S214, judging whether to update the target ratio according to the comparison result, if yes, execute step S208; if not, execute step S216. Specifically, in a case where the target ratio is not the largest ratio among multiple image compression ratios, and the compression loss value corresponding to the target ratio is smaller than the compression loss threshold, it is determined that the target ratio needs to be updated.
步骤S216,根据比较结果获取目标压缩图像。具体而言,在目标比例为最大比例,且目标比例对应的压缩损失值小于或等于压缩损失阈值的情况下,采用最大比例对应的压缩图像作为目标压缩图像;在目标比例对应的压缩损失值大于压缩损失阈值的情况下,将排在目标比例前一位的图像压缩比例对应的压缩图像作为目标压缩图像;在目标比例对应的压缩损失值等于压缩损失阈值的情况下,将目标比例对应的压缩图像作为目标压缩图像。Step S216, acquiring the target compressed image according to the comparison result. Specifically, when the target ratio is the maximum ratio, and the compression loss value corresponding to the target ratio is less than or equal to the compression loss threshold, the compressed image corresponding to the maximum ratio is used as the target compressed image; when the compression loss value corresponding to the target ratio is greater than In the case of the compression loss threshold, the compressed image corresponding to the image compression ratio that ranks first in the target ratio is used as the target compressed image; when the compression loss value corresponding to the target ratio is equal to the compression loss threshold, the compression ratio corresponding to the target ratio image as the target compressed image.
通过上述方式,无需人工凭借经验设置压缩比例并反复调整,而是可以采用适用于原始图像的多个图像压缩比例从小至大尝试压缩直至得到目标压缩图像,该目标压缩图像最接近且不大于压缩损失阈值,因此上述方式在符合图像要求(不大于压缩损失阈值)的基础上能够尽可能最大程度地对原始图像进行压缩,也无需人为再对压缩图像进行核查,在节约人力成本的基础上,也较好地提升了图像压缩效果。Through the above method, there is no need to manually set the compression ratio based on experience and adjust it repeatedly. Instead, multiple image compression ratios suitable for the original image can be used to try to compress from small to large until the target compressed image is obtained. The target compressed image is closest to and not greater than the compressed image. The loss threshold, so the above method can compress the original image as much as possible on the basis of meeting the image requirements (not greater than the compression loss threshold), and there is no need to manually check the compressed image. On the basis of saving labor costs, It also improves the image compression effect better.
应当说明的是,本公开实施例对图像压缩场景不进行限制,诸如,可以将本公开实施例提供的上述图像压缩方法应用于Unity内容开发平台,Unity内容开发平台可广泛应用于诸如游戏、汽车、建筑工程、影视动画等多种领域,可用于创作、运营和变现任何实时互动的2D和3D内容,在Unity内容开发平台中通常会涉及需要处理的大量的图像,通常情况下都需要人工进行手动压缩,还需要人工核查所得的压缩图像是否满足需求(诸如是否失真等),而采用本公开实施例提供的上述图像压缩方法,极大节约了人力成本,提升了图像压缩效率,并有效保障了图像压缩效果,可较好提升用户体验。It should be noted that the embodiments of the present disclosure do not limit the image compression scenarios. For example, the above-mentioned image compression method provided by the embodiments of the present disclosure can be applied to the Unity content development platform, which can be widely used in games, automobiles, etc. , architectural engineering, film and television animation and other fields, which can be used to create, operate and realize any real-time interactive 2D and 3D content. In the Unity content development platform, it usually involves a large number of images that need to be processed, and usually requires manual processing. For manual compression, it is also necessary to manually check whether the compressed image obtained meets the requirements (such as whether it is distorted, etc.), and the above-mentioned image compression method provided by the embodiment of the present disclosure greatly saves labor costs, improves image compression efficiency, and effectively guarantees The image compression effect is improved, which can better improve the user experience.
对应于前述图像压缩方法,本公开实施例还提供了一种图像压缩装置,图3为本公开实施例提供的一种图像压缩装置的结构示意图,该装置可由软件和/或硬件实现,一般可集成在电子设备中。如图3所示,图像压缩装置300包括:Corresponding to the aforementioned image compression method, an embodiment of the present disclosure also provides an image compression device. FIG. 3 is a schematic structural diagram of an image compression device provided by an embodiment of the present disclosure. The device can be implemented by software and/or hardware, and generally can integrated in electronic equipment. As shown in Figure 3, the image compression device 300 includes:
原始图像获取模块302,用于获取待压缩的原始图像;An original image acquisition module 302, configured to acquire an original image to be compressed;
阈值及比例获取模块304,用于从预设的多种图像类别中获取原始图像所属的目标类别,以及目标类别对应的压缩损失阈值和多个图像压缩比例;Threshold and ratio acquisition module 304, configured to acquire the target category to which the original image belongs, as well as the compression loss threshold and multiple image compression ratios corresponding to the target category from a variety of preset image categories;
图像压缩模块306,用于将多个图像压缩比例按照由小至大的顺序依次对原始图像执行压缩处理,直至获取到目标压缩图像;目标压缩图像是多个图像压缩比例对应的压缩图像中压缩损失与压缩损失阈值最接近且不大于压缩损失阈值的压缩图像。The image compression module 306 is used to compress multiple image compression ratios sequentially on the original image in order from small to large until the target compressed image is obtained; the target compressed image is compressed in the compressed image corresponding to multiple image compression ratios Compressed images whose loss is closest to and not greater than the compression loss threshold.
上述装置无需人工凭借经验设置压缩比例并反复调整,而是可以采用适用于原始图像的多个图像压缩比例从小至大尝试压缩直至得到目标压缩图像,该目标压缩图像最接近且不大于压缩损失阈值,因此上述方式在符合图像要求(不大于压缩损失阈值)的基础上能够尽可能最大程度地对原始图像进行压缩,在节约人力成本的基础上,也较好地提升了图像压缩效果。The above device does not need to manually set the compression ratio based on experience and adjust it repeatedly, but can use multiple image compression ratios suitable for the original image from small to large to try to compress until the target compressed image is obtained, and the target compressed image is closest to and not greater than the compression loss threshold , so the above method can compress the original image as much as possible on the basis of meeting the image requirements (not greater than the compression loss threshold), and can better improve the image compression effect on the basis of saving labor costs.
在一些实施方式中,所述装置还包括类别设置模块,用于预先基于图像内容和/或图像用途设置多种图像类别。In some embodiments, the device further includes a category setting module, configured to pre-set multiple image categories based on image content and/or image usage.
在一些实施方式中,不同的图像类别对应的压缩损失阈值不同,和/或,不同的图像类别对应的多个图像压缩比例不同。In some implementations, different image categories correspond to different compression loss thresholds, and/or different image categories correspond to different image compression ratios.
在一些实施方式中,图像压缩模块306具体用于:将多个所述图像压缩比例按照由小至大的顺序依次作为目标比例,并采用所述目标比例对所述原始图像执行压缩处理,得到所述目标比例对应的压缩图像;获取所述目标比例对应的压缩图像的压缩损失值;基于所述压缩损失值与所述压缩损失阈值的比较结果对所述目标比例进行更新,直至获取到目标压缩图像。In some implementations, the image compression module 306 is specifically configured to: take multiple image compression ratios in ascending order as target ratios, and use the target ratios to perform compression processing on the original image to obtain A compressed image corresponding to the target ratio; acquiring a compression loss value of the compressed image corresponding to the target ratio; updating the target ratio based on a comparison result between the compression loss value and the compression loss threshold until the target ratio is obtained Compress images.
在一些实施方式中,图像压缩模块306具体用于:在所述目标比例并非多个所述图像压缩比例中的最大比例,且所述目标比例对应的压缩损失值小于所述压缩损失阈值的情况下,对所述目标比例进行更新,直至采用所述最大比例作为所述目标比例,或者直至所述目标比例对应的压缩损失值大于或等于所述压缩损失阈值;在所述目标比例为所述最大比例,且所述目标比例对应的压缩损失值小于或等于所述压缩损失阈值的情况下,采用所述最大比例对应的压缩图像作为目标压缩图像;在所述目标比例对应的压缩损失值大于所述压缩损失阈值的情况下,将排在所述目标比例前一位的图像压缩比例对应的压缩图像作为目标压缩图像;在所述目标比例对应的压缩损失值等于所述压缩损失阈值的情况下,将所述目标比例对应的压缩图像作为目标压缩图像。In some implementations, the image compression module 306 is specifically used for: when the target ratio is not the largest ratio among multiple image compression ratios, and the compression loss value corresponding to the target ratio is smaller than the compression loss threshold Next, update the target ratio until the maximum ratio is used as the target ratio, or until the compression loss value corresponding to the target ratio is greater than or equal to the compression loss threshold; when the target ratio is the maximum ratio, and the compression loss value corresponding to the target ratio is less than or equal to the compression loss threshold, use the compressed image corresponding to the maximum ratio as the target compressed image; if the compression loss value corresponding to the target ratio is greater than In the case of the compression loss threshold, the compressed image corresponding to the image compression ratio that is one bit ahead of the target ratio is used as the target compressed image; when the compression loss value corresponding to the target ratio is equal to the compression loss threshold Next, use the compressed image corresponding to the target ratio as the target compressed image.
在一些实施方式中,图像压缩模块306具体用于:基于所述原始图像的像素值以及所述目标比例对应的压缩图像的像素值,确定所述目标比例对应的压缩图像的像素损失值;根据所述原始图像的线条平滑度以及所述目标比例对应的压缩图像的线条平滑度,确定所述目标比例对应的压缩图像的平滑损失值;根据所述像素损失值和所述平滑损失值,生成所述目标比例对应的压缩图像的压缩损失值。In some implementations, the image compression module 306 is specifically configured to: determine the pixel loss value of the compressed image corresponding to the target ratio based on the pixel value of the original image and the pixel value of the compressed image corresponding to the target ratio; The line smoothness of the original image and the line smoothness of the compressed image corresponding to the target ratio determine the smoothing loss value of the compressed image corresponding to the target ratio; according to the pixel loss value and the smoothing loss value, generate The compression loss value of the compressed image corresponding to the target ratio.
在一些实施方式中,所述线条平滑度基于线条的锯齿数量表征;图像压缩模块306具体用于:根据所述原始图像中的线条锯齿数量以及所述目标比例对应的压缩图像中的线条锯齿数量,确定所述目标比例对应的压缩图像的线条锯齿增量;根据预先设置的多个锯齿增量区间,确定所述压缩图像的线条锯齿增量所属的目标增量区间;根据预先设置的各锯齿增量区间与平滑损失值之间的对应关系,获取所述目标增量区间对应的平滑损失值,并将获取的所述平滑损失值作为所述压缩图像的线条锯齿增量对应的平滑损失值。In some implementations, the line smoothness is characterized based on the number of jagged lines; the image compression module 306 is specifically configured to: according to the number of jagged lines in the original image and the number of jagged lines in the compressed image corresponding to the target ratio , determine the line sawtooth increment of the compressed image corresponding to the target ratio; determine the target increment interval to which the line sawtooth increment of the compressed image belongs according to a plurality of preset sawtooth increment intervals; according to each preset sawtooth The corresponding relationship between the incremental interval and the smoothing loss value, obtaining the smoothing loss value corresponding to the target incremental interval, and using the obtained smoothing loss value as the smoothing loss value corresponding to the line sawtooth increment of the compressed image .
在一些实施方式中,图像压缩模块306具体用于:获取所述像素损失值对应的第一权重以及所述平滑损失值对应的第二权重;将所述像素损失值和所述平滑损失值进行归一化处理;根据所述第一权重和所述第二权重,将归一化后的所述像素损失值以及归一化后的所述平滑损失值进行加权平均运算,将运算结果作为所述目标比例对应的压缩图像的压缩损失值。In some implementations, the image compression module 306 is specifically configured to: obtain the first weight corresponding to the pixel loss value and the second weight corresponding to the smoothing loss value; Normalization processing; according to the first weight and the second weight, perform a weighted average operation on the normalized pixel loss value and the normalized smoothing loss value, and use the operation result as the The compression loss value of the compressed image corresponding to the above target ratio.
在一些实施方式中,所述图像压缩方法应用于Unity内容开发平台。In some embodiments, the image compression method is applied to the Unity content development platform.
本公开实施例所提供的图像压缩装置可执行本公开任意实施例所提供的图像压缩方法,具备执行方法相应的功能模块和有益效果。The image compression device provided by the embodiments of the present disclosure can execute the image compression method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置实施例的具体工作过程,可以参考方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the device embodiment described above can refer to the corresponding process in the method embodiment, and details are not repeated here.
本公开示例性实施例还提供一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器。所述存储器存储有能够被所述至少一个处理器执行的计算机程序,所述计算机程序在被所述至少一个处理器执行时用于使所述电子设备执行根据本公开实施例的方法。Exemplary embodiments of the present disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, and when executed by the at least one processor, the computer program is used to cause the electronic device to execute the method according to the embodiment of the present disclosure.
本公开示例性实施例还提供一种存储有计算机程序的非瞬时计算机可读存储介质,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本公开实施例的方法。Exemplary embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein, when the computer program is executed by a processor of a computer, the computer is used to cause the computer to execute the method.
本公开示例性实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本公开实施例的方法。Exemplary embodiments of the present disclosure also provide a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method according to the embodiments of the present disclosure.
所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。The computer program product can be written in any combination of one or more programming languages to execute the program codes for performing the operations of the embodiments of the present disclosure, and the programming languages include object-oriented programming languages, such as Java, C++, etc. , also includes conventional procedural programming languages, such as the "C" language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server to execute.
此外,本公开的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本公开实施例所提供的图像压缩方法。所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。In addition, the embodiments of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the image compression provided by the embodiments of the present disclosure. method. The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, but not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
参考图4,现将描述可以作为本公开的服务器或客户端的电子设备400的结构框图,其是可以应用于本公开的各方面的硬件设备的示例。电子设备旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。Referring to FIG. 4 , a structural block diagram of an
如图4所示,电子设备400包括计算单元401,其可以根据存储在只读存储器(ROM)402中的计算机程序或者从存储单元408加载到随机访问存储器(RAM)403中的计算机程序,来执行各种适当的动作和处理。在RAM 403中,还可存储设备400操作所需的各种程序和数据。计算单元401、ROM 402以及RAM 403通过总线404彼此相连。输入/输出(I/O)接口405也连接至总线404。As shown in FIG. 4 , the
电子设备400中的多个部件连接至I/O接口405,包括:输入单元406、输出单元407、存储单元408以及通信单元409。输入单元406可以是能向电子设备400输入信息的任何类型的设备,输入单元406可以接收输入的数字或字符信息,以及产生与电子设备的用户设置和/或功能控制有关的键信号输入。输出单元407可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。存储单元408可以包括但不限于磁盘、光盘。通信单元409允许电子设备400通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和/或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和/或类似物。Multiple components in the
计算单元401可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元401的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元401执行上文所描述的各个方法和处理。例如,在一些实施例中,图像压缩方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元408。在一些实施例中,计算机程序的部分或者全部可以经由ROM402和/或通信单元409而被载入和/或安装到电子设备400上。在一些实施例中,计算单元401可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行图像压缩方法。The
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program codes for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
如本公开使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor (eg, magnetic disk, optical disk, memory, programmable logic device (PLD)), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with the user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relative terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these No such actual relationship or order exists between entities or operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific implementation manners of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210626130.0A CN115037937B (en) | 2022-06-02 | 2022-06-02 | Image compression method, apparatus, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210626130.0A CN115037937B (en) | 2022-06-02 | 2022-06-02 | Image compression method, apparatus, device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115037937A CN115037937A (en) | 2022-09-09 |
CN115037937B true CN115037937B (en) | 2023-04-07 |
Family
ID=83123184
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210626130.0A Active CN115037937B (en) | 2022-06-02 | 2022-06-02 | Image compression method, apparatus, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115037937B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111683254A (en) * | 2020-06-24 | 2020-09-18 | 湖南国科微电子股份有限公司 | Image compression method and device, electronic equipment and storage medium |
CN113379858A (en) * | 2021-05-31 | 2021-09-10 | 超级视线科技有限公司 | Image compression method and device based on deep learning |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20010072430A (en) * | 1999-06-14 | 2001-07-31 | 오노 시게오 | Compression encoding method, recorded medium on which compression encoding program is recorded, and imaging device |
US7085420B2 (en) * | 2002-06-28 | 2006-08-01 | Microsoft Corporation | Text detection in continuous tone image segments |
CN102957906A (en) * | 2011-08-29 | 2013-03-06 | 广州九游信息技术有限公司 | Method and system for image classifying compression |
US9497357B2 (en) * | 2013-11-20 | 2016-11-15 | Kyocera Document Solutions Inc. | Image compressing/decompressing apparatus and image forming apparatus |
EP3185555B1 (en) * | 2015-12-23 | 2023-07-05 | Université de Genève | Image compression method with negligible and quantifiable information loss and high compression ratio |
US11100677B2 (en) * | 2017-09-22 | 2021-08-24 | Nec Corporation | Information processing device, information processing method and recording medium |
CN109376762A (en) * | 2018-09-13 | 2019-02-22 | 西安万像电子科技有限公司 | Image processing method and device |
CN109672888B (en) * | 2018-09-25 | 2022-04-22 | 平安科技(深圳)有限公司 | Picture compression method, equipment and computer readable storage medium |
CN109816739B (en) * | 2018-12-14 | 2024-02-20 | 上海昇晔网络科技有限公司 | Picture compression method, device, computer equipment and computer readable storage medium |
CN110830807B (en) * | 2019-11-04 | 2022-08-23 | 腾讯科技(深圳)有限公司 | Image compression method, device and storage medium |
-
2022
- 2022-06-02 CN CN202210626130.0A patent/CN115037937B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111683254A (en) * | 2020-06-24 | 2020-09-18 | 湖南国科微电子股份有限公司 | Image compression method and device, electronic equipment and storage medium |
CN113379858A (en) * | 2021-05-31 | 2021-09-10 | 超级视线科技有限公司 | Image compression method and device based on deep learning |
Also Published As
Publication number | Publication date |
---|---|
CN115037937A (en) | 2022-09-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111488985B (en) | Deep neural network model compression training methods, devices, equipment and media | |
WO2021179587A1 (en) | Neural network model quantification method and apparatus, electronic device and computer-readable storage medium | |
CN113808231B (en) | Information processing method and device, image rendering method and device, and electronic device | |
WO2024036847A1 (en) | Image processing method and apparatus, and electronic device and storage medium | |
KR102360271B1 (en) | Methods and devices for determining the color of a text | |
US11861498B2 (en) | Method and apparatus for compressing neural network model | |
EP3917131A1 (en) | Image deformation control method and device and hardware device | |
US20230206578A1 (en) | Method for generating virtual character, electronic device and storage medium | |
JP2023076820A (en) | Image processing method, device, electronic device, and storage medium | |
CN113159318B (en) | Quantification method and device of neural network, electronic equipment and storage medium | |
US11875601B2 (en) | Meme generation method, electronic device and storage medium | |
CN113139490B (en) | Image feature matching method and device, computer equipment and storage medium | |
CN117370798A (en) | Model compression method, training method, multimedia data processing method and device | |
CN113724398A (en) | Augmented reality method, apparatus, device and storage medium | |
CN115037937B (en) | Image compression method, apparatus, device and medium | |
CN115049051A (en) | Model weight compression method and device, electronic equipment and storage medium | |
CN113344213A (en) | Knowledge distillation method, knowledge distillation device, electronic equipment and computer readable storage medium | |
CN115842892A (en) | Picture compression method and device, electronic equipment and storage medium | |
CN113327194A (en) | Image style migration method, device, equipment and storage medium | |
CN114727029B (en) | Video processing method and device, electronic equipment and storage medium | |
CN113518088B (en) | Data processing method, device, server, client and medium | |
CN114881227A (en) | Model compression method, image processing method, device and electronic equipment | |
CN113556575A (en) | Method, apparatus, device, medium and product for compressing data | |
CN113327311A (en) | Virtual character based display method, device, equipment and storage medium | |
CN111292342A (en) | Method, device and equipment for cutting text in image and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |