A method and device for processing a gradient semi-transparent image

By splitting and compressing the gradient translucent picture into basic information and pixel width, the problem of image quality reduction in the prior art after compression is solved, efficient lossless compression is achieved, and the image capacity is significantly reduced.

CN113538220BActive Publication Date: 2025-02-25BEIJING TMSK NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110806551.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2025-02-25
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

In the prior art, compression processing for gradient translucent pictures usually adopts a method of directly reducing and enlarging or sacrificing image details, resulting in a decrease in the quality of the picture during the restoration process.

Method used

By splitting the gradient translucent picture into the gradient part and the color information part, and compressing it into the basic translucent information and the first pixel width, the basic color information and the second pixel width respectively, only these basic units are retained to reduce the information during the compression process storage.

Benefits of technology

The lossless compression of gradient translucent pictures is achieved, with unchanged quality and reduced capacity by more than 90%, improving game operation efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113538220B_ABST
    Figure CN113538220B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for processing a gradient semi-transparent image. The method comprises the steps of receiving a gradient semi-transparent image to be processed, splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; compressing the gradient part into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient part; compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit in which no repeated color features exist in the color information; and sending the basic semi-transparent information, the first pixel width, the basic color information, and the second pixel width to a receiving end. In the above process, when the gradient part and the color information part are compressed, only the basic semi-transparent information and the first pixel width, the basic color information and the second pixel width are retained, thereby reducing the storage of information during the compression process, and retaining the basic color information and the basic semi-transparent information, thereby ensuring the quality of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for processing a gradient semi-transparent image. Background Art

[0002] The installation of game software usually contains a large number of gradient semi-transparent image resources, which take up a lot of space, thus affecting the size of the game software installation package and the size of the game running memory. In order to reduce the size of the game software installation package and running memory, it is necessary to compress the gradient semi-transparent images.

[0003] In the prior art, the compression processing of gradient semi-transparent images generally adopts a method of directly reducing and then enlarging, or a compression method that sacrifices the details of the image, resulting in a decrease in the quality of the gradient semi-transparent image during the restoration process. Summary of the invention

[0004] In view of this, the present invention provides a method and device for processing a gradient semi-transparent image, which is used to solve the problem that the compression processing of gradient semi-transparent images in the prior art generally adopts a method of directly reducing and then enlarging, or a compression method that sacrifices the details of the image, resulting in a decrease in the quality of the gradient semi-transparent image during the restoration process. The specific scheme is as follows:

[0005] A method for processing a gradient semi-transparent image, applied to a sending end, includes:

[0006] Receiving a gradient semi-transparent image to be processed, and splitting the gradient semi-transparent image to be processed into a gradient part and a color information part;

[0007] compressing the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion;

[0008] compressing the color information portion into basic color information and a second pixel width, wherein the basic color information is a basic unit in which no repeated color features exist in the color information;

[0009] The basic translucent information, the first pixel width, the basic color information and the second pixel width are sent to a receiving end.

[0010] The above method, optionally, compressing the gradient portion into the basic semi-transparent information and the first pixel width, comprises:

[0011] Creating a black and white channel corresponding to the gradient portion, and representing the semi-transparent information corresponding to the gradient portion through the black and white channel;

[0012] In the black and white channel, basic semi-transparent information is selected based on the corresponding image features and a first pixel width corresponding to the basic semi-transparent information is obtained, wherein the first pixel width is the pixel width of the basic semi-transparent information in the gradient part.

[0013] The above method, optionally, compressing the color information part into basic color information and a second pixel width, comprises:

[0014] Traverse the color features in the color information part, and select basic color information from the color feature;

[0015] A second pixel width in the color information portion is obtained, wherein the second pixel width is a pixel width of the basic color information in the color information.

[0016] The above method may optionally split the to-be-processed gradient semi-transparent image into a gradient part and a color information part, including:

[0017] Obtaining a first channel of the gradient semi-transparent image, and obtaining semi-transparent information of the gradient part in the first channel;

[0018] The second channel of the gradient semi-transparent image is obtained, and the color information of the color information part is obtained in the second channel.

[0019] A method for processing a gradient semi-transparent image, applied to a receiving end, includes:

[0020] Receive basic translucent information, a first pixel width, basic color information, and a second pixel width;

[0021] generating a gradient portion based on the basic semi-transparent information and the first pixel width;

[0022] generating a color information portion based on the basic color information and the second pixel width;

[0023] The gradient part and the color information part are superimposed to obtain a gradient semi-transparent image to be processed.

[0024] A device for processing a gradient semi-transparent image, applied to a sending end, comprising:

[0025] A splitting module, used for receiving a gradient semi-transparent image to be processed, and splitting the gradient semi-transparent image to be processed into a gradient part and a color information part;

[0026] A first compression module, used for compressing the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion;

[0027] A second compression module, used for compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit without repeated color features in the color information;

[0028] A sending module is used to send the basic translucent information, the first pixel width, the basic color information and the second pixel width to a receiving end.

[0029] In the above device, optionally, the first compression module includes:

[0030] A production unit, used for producing a black and white channel corresponding to the gradient part, and representing the semi-transparent information corresponding to the gradient part through the black and white channel;

[0031] The first selection unit is used to select basic semi-transparent information in the black and white channel based on the corresponding image features and obtain a first pixel width corresponding to the basic semi-transparent information, wherein the first pixel width is the pixel width of the basic semi-transparent information in the gradient part.

[0032] In the above device, optionally, the second compression module includes:

[0033] A second selection unit, configured to traverse the color features in the color information portion and select basic color information from the color feature;

[0034] The first acquisition unit is used to acquire a second pixel width in the color information part, wherein the second pixel width is a pixel width of the basic color information in the color information.

[0035] In the above device, optionally, the splitting module includes:

[0036] A second acquisition unit is used to acquire a first channel of the gradient semi-transparent image, and acquire semi-transparency information of the gradient part in the first channel;

[0037] The third acquisition unit is used to acquire the second channel of the gradient semi-transparent image, and acquire the color information of the color information part in the second channel.

[0038] A device for processing a gradient semi-transparent image, applied to a receiving end, comprising:

[0039] A receiving module, used for receiving basic translucent information, a first pixel width, basic color information and a second pixel width;

[0040] A first generating module, configured to generate a gradient part based on the basic semi-transparent information and the first pixel width;

[0041] A second generating module, configured to generate a color information portion based on the basic color information and the second pixel width;

[0042] The superposition module is used to superimpose the gradient part and the color information part to obtain a gradient semi-transparent image to be processed.

[0043] Compared with the prior art, the present invention has the following advantages:

[0044] The present invention discloses a method and device for processing a gradient semi-transparent image, which is applied to a sending end. The method comprises: receiving a gradient semi-transparent image to be processed, splitting the gradient semi-transparent image to be processed into a gradient part and receiving a gradient semi-transparent image to be processed, splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; compressing the gradient part into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient part; compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit in which no repeated color features exist in the color information; and sending the basic semi-transparent information, the first pixel width, the basic color information, and the second pixel width to a receiving end. In the above process, when the gradient part and the color information part are compressed, only the basic semi-transparent information and the first pixel width, the basic color information and the second pixel width are retained, which reduces the storage of information during the compression process, and retains the basic color information and the basic semi-transparent information, thereby ensuring the quality of the image. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0046] Figure 1 A flowchart of a method for processing a gradient semi-transparent image disclosed in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of a gradual semi-transparent image compression disclosed in an embodiment of the present application;

[0048] Figure 3 This is another flow chart of a method for processing a gradient semi-transparent image disclosed in an embodiment of the present application;

[0049] Figure 4 This is a structural block diagram of a device for processing a gradient semi-transparent image disclosed in an embodiment of the present application;

[0050] Figure 5This is another structural block diagram of a device for processing a gradient semi-transparent image disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0053] The present invention discloses a method and device for processing a gradient semi-transparent image, which is applied to the processing process of the gradient semi-transparent image. In the prior art, in the output of game art image resources, the image resources are usually output in png and jpg formats. Usually, a part of the output resources are image resources with gradient semi-transparency, which are often huge in number and occupy a relatively large capacity, thereby affecting the size of the game package and the size of the game running memory. In the output of gradient semi-transparent image resources in the past, if the image resources want to compress the capacity, the method of directly shrinking and then enlarging is generally adopted, or the details of the image are sacrificed, which will reduce the image quality in short, which is called "destructive compression". The purpose of the present invention is to perform lossless compression on the gradient semi-transparent image resources, with the quality unchanged and the capacity reduced by more than 90%, so as to give more resources to other needs and further improve the running efficiency and utilization rate of the game. The present invention adopts a new method in the compression and restoration process of the image resources for the gradient semi-transparent image resources to achieve the purpose of reducing the resource capacity and maintaining the quality unchanged.

[0054] In the embodiment of the present invention, the above processing process includes a compression process at the sending end and a restoration process at the receiving end. The sending end and the receiving end can be any terminals. The sending end includes an application for realizing image compression. Preferably, the application is Photoshop. The launching end includes an application for realizing image restoration. Preferably, the application is Unity. Therefore, the present invention provides a method for processing a gradient semi-transparent image, which is applied to the sending end. The execution flow of the method is as follows: Figure 1 As shown, the steps include:

[0055] S101, receiving a gradient semi-transparent image to be processed, and splitting the gradient semi-transparent image to be processed into a gradient part and a color information part;

[0056] In an embodiment of the present invention, the transmitting end receives the semi-transparent image to be processed, opens the gradient semi-transparent image to be processed in the photoshop software of the transmitting end, and each gradient semi-transparent image to be processed in the photoshop software has its own channel, in which black represents 100% transparency and white represents 100% opacity, and obtains the gradient part and color information part of the gradient semi-transparent image to be processed in the channel. The specific acquisition process is as follows: obtain the first channel of the gradient semi-transparent image, and obtain the semi-transparent information of the gradient part in the first channel; obtain the second channel of the gradient semi-transparent image, and obtain the color information of the color information part in the second channel. Among them, the first channel and the second channel are the corresponding channels in the photoshop software, the gradient part is used to characterize the grayscale characteristics of the gradient semi-transparent image to be processed, the gradient part is a grayscale image, the gradient part adopts the black and white channel method, and the semi-transparent information is represented by the black and white channel, and the color information part is used to characterize the color information of the gradient semi-transparent image to be processed, and the color information part is a color image.

[0057] S102, compressing the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion;

[0058] In the embodiment of the present invention, the gradient portion includes semi-transparent information, a black and white channel corresponding to the gradient portion is produced, the semi-transparent information is represented based on the black and white channel, and basic semi-transparent information is selected by cutting in the black and white channel based on the image feature to which it belongs, wherein the basic semi-transparent information is a basic unit for representing the image information in the gradient portion, is the smallest unit to which the same content in the gradient portion can be compressed, and is a non-repeating section in the image feature. Preferably, the basic semi-transparent image is a JPG image, for example, one pixel, such as Figure 2 As shown, the basic translucent information is Figure 2 2-1. At the same time, a first pixel width corresponding to the basic semi-transparent information is obtained, wherein the first pixel width is the pixel width of the basic semi-transparent information in the gradient part. For example, if the gradient part is a gradient picture from top to bottom, the pixel width is the pixel width of the gradient picture.

[0059] Furthermore, the process of making a black and white channel corresponding to the gradient part is as follows: open the image and click the layer panel, directly press ctrl + left mouse button and click the layer to form a selection, open the channel panel, create a new channel and fill the selection with white, and copy and paste the black and white channel image into the layer panel.

[0060] S103, compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit without repeated color features in the color information;

[0061] In an embodiment of the present invention, the color information part includes the color features of the gradient semi-transparent image to be processed, the color features are traversed, and basic color information is selected from the color features by cutting, wherein the basic color information is a basic unit in which there is no repeated color feature in the color information, wherein preferably, the color feature is a color value corresponding to a color, and the basic color information is the smallest unit containing all the color information in the gradient semi-transparent image to be processed, which is a non-repeated section in the color feature, and preferably, the basic color information unit is an IPG image such as Figure 2 As shown, the basic color information is shown in 2-2.

[0062] Furthermore, if the color part information is a single color without gradient, the basic color information can be directly absorbed by using an eyedropper tool.

[0063] S104: Send the basic semi-transparent information, the first pixel width, the basic color information, and the second pixel width to a receiving end.

[0064] In the embodiment of the present invention, for the gradient part, not all information is retained during the compression process, only the basic semi-transparent information and the first pixel width are retained, so the occupied space is small. Figure 2 The basic semi-transparent information after the gradient part is compressed is identified based on the image viewing software, and the information obtained is as follows: Project type: IPG image file of image viewing software, resolution: 1×455, size: 1.55KB. In the process of compression, the color information is not fully retained, only the basic color information and the second pixel width are retained, so the space occupied is small. Figure 2As shown, after the color information is partially compressed, the basic color information is identified based on the image viewing software, and the obtained information is as follows: Project type: Image Viewer JPG picture file, resolution: 3×3, size: 1.10KB. After compression based on the above compression method, the gradient semi-transparent picture to be processed is 2.65KB, which reduces the space occupied. Further, the basic semi-transparent information, the first pixel width, the basic color information and the second pixel width are sent to the receiving end, so that the receiving end can restore the gradient semi-transparent picture to be processed based on the basic semi-transparent information, the first pixel width, the basic color information and the second pixel width.

[0065] The present invention discloses a method for processing a gradient semi-transparent image, which is applied to a sending end. The method comprises: receiving a gradient semi-transparent image to be processed, splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; compressing the gradient part into basic semi-transparent information and a first pixel width, wherein the base semi-transparent information is a basic unit in which no repeated image features exist in the gradient part; compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit in which no repeated color features exist in the color information; and sending the basic semi-transparent information, the first pixel width, the basic color information, and the second pixel width to a receiving end. In the above process, when the gradient part and the color information part are compressed, only the basic semi-transparent information and the first pixel width, the basic color information and the second pixel width are retained, which reduces the storage of information during the compression process, and retains the basic color information and the basic semi-transparent information, thereby ensuring the quality of the image.

[0066] The embodiment of the present invention provides a method for processing a gradient semi-transparent image, which is applied to a receiving end. The execution flow of the processing method is as follows: Figure 3 As shown, the steps include:

[0067] S201, receiving basic translucent information, a first pixel width, basic color information, and a second pixel width;

[0068] In the embodiment of the present invention, preferably, the receiving end includes a game engine Unity, and the receiving end receives the sent basic translucent information, the first pixel width, the basic color information and the second pixel width.

[0069] S202, generating a gradient part based on the basic semi-transparent information and the first pixel width;

[0070] In an embodiment of the present invention, restoration is performed based on the basic semi-transparent information and the first pixel width information. The restoration process is as follows: the basic semi-transparent information is stretched to the original size along the non-gradient direction based on the first pixel width to obtain the gradient part.

[0071] S203, generating a color information part based on the basic color information and the second pixel width;

[0072] In an embodiment of the present invention, restoration is performed based on the basic color information and the second pixel width, and the restoration process is as follows: the color information based on the second pixel width is stretched to the original size along a non-gradient direction to obtain the color information part.

[0073] Furthermore, if the basic color information is a single color without gradient, the second pixel width includes two pixel width values:

[0074] S204: superimpose the gradient part and the color information part to obtain a gradient semi-transparent image to be processed.

[0075] In the embodiment of the present invention, the gradient part and the color information part are based on the game engine Unity, and the two are superimposed to obtain the gradient semi-transparent image to be processed. The way of superimposing the two kinds of image information in the game engine is similar to Photoshop, but the process is reversed. The color block showing the color information part needs to be enlarged to the original size, and the channel resource showing the gradient part also needs to be enlarged to the original size. The superposition of the two will automatically generate the gradient semi-transparent image to be processed.

[0076] The present invention discloses a method for processing a gradient semi-transparent image, which is applied to a receiving end. The method comprises: receiving basic semi-transparent information, a first pixel width, basic color information, and a second pixel width; generating a gradient part based on the basic semi-transparent information and the first pixel width; generating a color information part based on the basic color information and the second pixel width; and superimposing the gradient part and the color information part to obtain a gradient semi-transparent image to be processed. In the above process, the gradient part can be restored to an image with unchanged quality based on the basic semi-transparent information and the first pixel width, and the color information part can be restored to an image with unchanged quality based on the basic color information and the second pixel width. Since the image quality of the gradient part and the color basic information part remains unchanged, the quality of the gradient semi-transparent image to be processed superimposed on the gradient part and the color information part remains unchanged.

[0077] Based on the above-mentioned method for processing a gradient semi-transparent image, which is applied to a sending end, an embodiment of the present invention provides a device for processing a gradient semi-transparent image, which is applied to a sending end. The structural block diagram of the processing device is as follows: Figure 4 As shown, including:

[0078] A splitting module 301 , a first compression module 302 , a second compression module 303 and a sending module 304 .

[0079] in,

[0080] The splitting module 301 is used to receive a gradient semi-transparent image to be processed, and split the gradient semi-transparent image to be processed into a gradient part and a color information part;

[0081] The first compression module 302 is used to compress the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion;

[0082] The second compression module 303 is used to compress the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit without repeated color features in the color information;

[0083] The sending module 304 is used to send the basic translucent information, the first pixel width, the basic color information and the second pixel width to a receiving end.

[0084] The present invention discloses a processing device for a gradient semi-transparent image, which is applied to a sending end and includes: receiving a gradient semi-transparent image to be processed, splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; compressing the gradient part into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient part; compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit in which no repeated color features exist in the color information; and sending the basic semi-transparent information, the first pixel width, the basic color information, and the second pixel width to a receiving end. In the above process, when the gradient part and the color information part are compressed, only the basic semi-transparent information and the first pixel width, the basic color information and the second pixel width are retained, which reduces the storage of information during the compression process, and retains the basic color information and the basic semi-transparent information, thereby ensuring the quality of the image.

[0085] In the embodiment of the present invention, the first compression module package 302 includes:

[0086] A production unit 305 and a first selection unit 306 .

[0087] in,

[0088] The production unit 305 is used to produce a black and white channel corresponding to the gradient part, and to represent the semi-transparent information corresponding to the gradient part through the black and white channel;

[0089] The first selection unit 306 is used to select basic semi-transparent information in the black and white channel based on the corresponding image features and obtain a first pixel width corresponding to the basic semi-transparent information, wherein the first pixel width is the pixel width of the basic semi-transparent information in the gradient part.

[0090] In the embodiment of the present invention, the second compression module 303 includes:

[0091] A second selecting unit 307 and a first acquiring unit 308 .

[0092] in,

[0093] The second selection unit 307 is used to traverse the color features in the color information part and select basic color information from the color feature;

[0094] The first acquisition unit 308 is used to acquire a second pixel width in the color information portion, wherein the second pixel width is a pixel width of the basic color information in the color information.

[0095] In the embodiment of the present invention, the splitting module 301 includes:

[0096] A second acquiring unit 309 and a third acquiring unit 310 .

[0097] in,

[0098] The second acquisition unit 309 is used to acquire the first channel of the gradient semi-transparent image, and acquire the semi-transparent information of the gradient part in the first channel;

[0099] The third acquisition unit 310 is used to acquire the second channel of the gradient semi-transparent image, and acquire the color information of the color information part in the second channel.

[0100] Based on the above-mentioned method for processing a gradient semi-transparent image, which is applied to a receiving end, an embodiment of the present invention further provides a device for processing a gradient semi-transparent image, which is applied to a receiving end. The structural block diagram of the processing device is as follows: Figure 5 As shown, including:

[0101] A receiving module 401 , a first generating module 402 , a second generating module 403 and a superimposing module 404 .

[0102] in,

[0103] The receiving module 401 is used to receive basic translucent information, a first pixel width, basic color information and a second pixel width;

[0104] The first generating module 402 is used to generate a gradient part based on the basic semi-transparent information and the first pixel width;

[0105] The second generating module 403 is used to generate a color information part based on the basic color information and the second pixel width;

[0106] The superposition module 404 is used to superimpose the gradient part and the color information part to obtain a gradient semi-transparent image to be processed.

[0107] The present invention discloses a processing device for a gradient semi-transparent image, which is applied to a receiving end and includes: receiving basic semi-transparent information, a first pixel width, basic color information, and a second pixel width; generating a gradient part based on the basic semi-transparent information and the first pixel width; generating a color information part based on the basic color information and the second pixel width; and superimposing the gradient part and the color information part to obtain a gradient semi-transparent image to be processed. In the above process, the gradient part can be restored to an image with unchanged quality based on the basic semi-transparent information and the first pixel width, and the color information part can be restored to an image with unchanged quality based on the basic color information and the second pixel width. Since the image quality of the gradient part and the color basic information part remains unchanged, the quality of the gradient semi-transparent image to be processed superimposed on the gradient part and the color information part remains unchanged.

[0108] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0112] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0113] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0114] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0115] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0116] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0117] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing a gradient semi-transparent image, characterized in that: Applied to the sending end, including: Receiving a gradient semi-transparent image to be processed, and splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; Compressing the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion, the basic semi-transparent information is obtained by cutting the gradient portion based on the image features, and the first pixel width is a pixel width of the basic semi-transparent information in the gradient portion along a non-gradient direction; Compressing the color information part into basic color information and a second pixel width, wherein the basic color information is a basic unit without repeated color features in the color information, and the second pixel width is a pixel width of the basic color information in the color information; Sending the basic semi-transparent information, the first pixel width, the basic color information and the second pixel width to a receiving end; The compressing the gradient part into the basic semi-transparent information and the first pixel width comprises: Creating a black and white channel corresponding to the gradient portion, and representing the semi-transparent information corresponding to the gradient portion through the black and white channel; In the black and white channel, basic semi-transparent information is selected based on the corresponding image feature and a first pixel width corresponding to the basic semi-transparent information is obtained.

2. The method according to claim 1, characterized in that Compressing the color information portion into base color information and a second pixel width comprises: Traversing the color features in the color information part, and selecting basic color information from the color features; A second pixel width in the color information portion is obtained.

3. The method according to claim 1, characterized in that Splitting the to-be-processed gradient semi-transparent image into a gradient part and a color information part includes: Obtaining a first channel of the gradient semi-transparent image, and obtaining semi-transparent information of the gradient part in the first channel; The second channel of the gradient semi-transparent image is obtained, and the color information of the color information part is obtained in the second channel.

4. A method for processing a gradient semi-transparent image, characterized in that: Applied to the receiving end, including: Receive basic translucent information, a first pixel width, basic color information, and a second pixel width; wherein the basic translucent information is a basic unit in which no repeated image features exist in a gradient part of a gradient translucent picture, the basic translucent information is obtained by cutting the gradient part based on image features, and the first pixel width is a pixel width of the basic translucent information in the gradient part along a non-gradient direction; the basic color information is a basic unit in which no repeated color features exist in color information of the gradient translucent picture, and the second pixel width is a pixel width of the basic color information in the color information; generating a gradient portion based on the basic semi-transparent information and the first pixel width; generating a color information portion based on the basic color information and the second pixel width; The gradient part and the color information part are superimposed to obtain a gradient semi-transparent image to be processed.

5. A device for processing a gradient semi-transparent image, characterized in that: Applied to the sending end, including: A splitting module, used for receiving a gradient semi-transparent image to be processed, and splitting the gradient semi-transparent image to be processed into a gradient part and a color information part; A first compression module, configured to compress the gradient portion into basic semi-transparent information and a first pixel width, wherein the basic semi-transparent information is a basic unit in which no repeated image features exist in the gradient portion, the basic semi-transparent information is obtained by cutting the gradient portion based on the image features, and the first pixel width is a pixel width of the basic semi-transparent information in the gradient portion along a non-gradient direction; A second compression module, configured to compress the color information portion into basic color information and a second pixel width, wherein the basic color information is a basic unit without repeated color features in the color information, and the second pixel width is a pixel width of the basic color information in the color information; A sending module, used for sending the basic semi-transparency information, the first pixel width, the basic color information and the second pixel width to a receiving end; The first compression module comprises: A production unit, used for producing a black and white channel corresponding to the gradient part, and representing the semi-transparent information corresponding to the gradient part through the black and white channel; The first selection unit is used to select basic semi-transparent information in the black and white channel based on the corresponding image features and obtain a first pixel width corresponding to the basic semi-transparent information.

6. The device according to claim 5, characterized in that The second compression module comprises: A second selection unit, configured to traverse the color features in the color information portion and select basic color information from the color features; The first acquisition unit is used to acquire a second pixel width in the color information part.

7. The device according to claim 5, characterized in that The splitting module comprises: A second acquisition unit is used to acquire a first channel of the gradient semi-transparent image, and acquire semi-transparency information of the gradient part in the first channel; The third acquisition unit is used to acquire the second channel of the gradient semi-transparent image, and acquire the color information of the color information part in the second channel.

8. A device for processing a gradient semi-transparent image, characterized in that: Applied to the receiving end, including: A receiving module, configured to receive basic translucent information, a first pixel width, basic color information, and a second pixel width; wherein the basic translucent information is a basic unit in which no repeated image features exist in a gradient part of a gradient translucent image, the basic translucent information is obtained by cutting the gradient part based on image features, and the first pixel width is a pixel width of the basic translucent information in a non-gradient direction in the gradient part; the basic color information is a basic unit in which no repeated color features exist in the color information of the gradient translucent image, and the second pixel width is a pixel width of the basic color information in the color information; A first generating module, configured to generate a gradient part based on the basic semi-transparent information and the first pixel width; A second generating module, configured to generate a color information portion based on the basic color information and the second pixel width; The superposition module is used to superimpose the gradient part and the color information part to obtain a gradient semi-transparent image to be processed.

Citation Information

Patent Citations

  • ETC texture compression and restoration method and device and realization device

    CN107871330A