Image processing method, device, storage medium, and program product

By sharing the color channels of adjacent pixels to record transparency information, the storage and transmission problems of transparent frame animation videos in split-screen format are solved, achieving more efficient image processing.

CN117528096BActive Publication Date: 2026-07-31BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2022-07-28
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, transparent frame animation videos in the left-right split-screen format increase video size and transmission time, and occupy additional texture space and rendering costs.

Method used

By sharing two color channels between two adjacent pixels during image encoding, the transparency channel is reduced, and only one channel is reserved for recording transparency information, thus reducing storage space and transmission time.

Benefits of technology

It effectively reduces image storage space and transmission time, while also reducing texture space usage and consumption during rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117528096B_ABST
    Figure CN117528096B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure provides an image processing method, device, storage medium and program product, two color channels of two adjacent pixel points are shared when encoding an image, so that each pixel point can leave one channel for recording transparency information, thereby reducing the transparency channel, reducing the storage space occupied by the image, and reducing the transmission time of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video processing technology, and in particular to an image processing method, apparatus, storage medium, and program product. Background Technology

[0002] Currently, the mainstream frame animation formats include traditional PNG sequence frames, GIF, APNG, WebP, etc., as well as transparent frame animation videos in the left-right split-screen format, which have been widely used in recent years and are widely used in animation scenarios such as live streaming gifts.

[0003] The core principle of transparent frame animation videos in split-screen format is to expand the sequence of frame images to twice their original width, and fill the transparency information with half of the pixels. During rendering, the transparency image can be restored through the fragment shader in the rendering pipeline.

[0004] However, this method increases the video size, occupies twice the texture space, and increases the transmission time of the animated video as well as the consumption during rendering. Summary of the Invention

[0005] This disclosure provides an image processing method, apparatus, storage medium, and program product to reduce the storage space occupied by images and reduce image transmission time.

[0006] In a first aspect, embodiments of this disclosure provide an image processing method, including:

[0007] Get the first image;

[0008] The first image is encoded to obtain the second image;

[0009] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0010] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0011] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0012] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

[0013] Secondly, embodiments of this disclosure provide an image processing method, including:

[0014] Obtain the second image;

[0015] Decode the second image to obtain the first image;

[0016] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0017] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0018] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0019] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0020] Thirdly, embodiments of this disclosure provide an image processing apparatus, including:

[0021] The acquisition unit is used to acquire the first image;

[0022] The encoding unit is used to encode the first image to obtain the second image;

[0023] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0024] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0025] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0026] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

[0027] Fourthly, embodiments of this disclosure provide an image processing apparatus, comprising:

[0028] The acquisition unit is used to acquire the second image;

[0029] The decoding unit is used to decode the second image to obtain the first image;

[0030] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0031] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0032] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0033] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0034] Fifthly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;

[0035] The memory stores computer-executed instructions;

[0036] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the image processing method as described in the first aspect and various possible designs of the first aspect, or the image processing method as described in the second aspect and various possible designs of the second aspect.

[0037] In a sixth aspect, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect, or the image processing method described in the second aspect and various possible designs of the second aspect.

[0038] In a seventh aspect, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect, or the image processing method described in the second aspect and various possible designs of the second aspect.

[0039] The image processing method, apparatus, storage medium, and program products provided in this disclosure reduce the number of transparency channels, decrease the storage space occupied by the image, and shorten the image transmission time by sharing two color channels of two adjacent pixels when encoding the image, so that each pixel can reserve a channel for recording its transparency information. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1a This is an example diagram of a transparent frame animation video in the existing technology with a split-screen format;

[0042] Figure 1b This is an example image of a transparent frame animation video in a split-screen format from the prior art, rendered to restore the transparency of the image.

[0043] Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure;

[0044] Figure 3 This is a schematic diagram of the encoding process in an image processing method provided in an embodiment of the present disclosure;

[0045] Figure 4 This is a schematic diagram of images before and after encoding provided in an embodiment of the image processing method of this disclosure;

[0046] Figure 5 This is a schematic flowchart of an image processing method provided in another embodiment of the present disclosure;

[0047] Figure 6 This is a schematic diagram of the decoding and restoration process in an image processing method provided in an embodiment of the present disclosure;

[0048] Figure 7 This is a structural block diagram of an image processing apparatus provided in an embodiment of the present disclosure;

[0049] Figure 8 This is a structural block diagram of an image processing apparatus provided in another embodiment of the present disclosure;

[0050] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0052] Currently, mainstream frame animation formats include traditional PNG (Portable Network Graphics) sequence frames, GIF (Graphics Interchange Format), APNG (Animated Portable Network Graphics, a bitmap animation format based on PNG), and WebP (a web image format launched by Google). There are also transparent frame animation videos in the left-right split-screen format, which have been widely used in recent years and are widely used in animation scenarios such as live streaming gifts.

[0053] The core principle of transparent frame animation videos in a split-screen format is to enlarge the sequence of frame images to twice their original width, filling the transparency information with half of the pixels, such as... Figure 1a As shown, the left side displays the image rendered using the RGB channels, and the right side displays the image rendered using the alpha channel. During rendering, the alpha effect can be reproduced using the fragment shader in the rendering pipeline. Figure 1b As shown.

[0054] However, this method increases the video size, occupies twice the texture space, and increases the transmission time of the animated video as well as the consumption during rendering.

[0055] To address the aforementioned technical problems, this disclosure proposes an image processing method that, during image encoding, shares two color channels between two adjacent pixels, allowing each pixel to reserve one channel for recording its transparency information. This reduces the number of transparency channels, decreases the storage space occupied by the image, and shortens the image transmission time. When applied to animated videos, this image processing method avoids expanding the image width to record transparency information, reducing the size of the animated video and the texture space occupied during rendering, thus reducing the transmission time and rendering overhead.

[0056] The image processing method provided in this disclosure will be described in detail below with reference to specific embodiments.

[0057] refer to Figure 2 , Figure 2This is a schematic flowchart of an image processing method provided in an embodiment of this disclosure. The method of this embodiment can be applied to a terminal device or a server, and the image processing method includes:

[0058] S201, Obtain the first image;

[0059] S202. Encode the first image to obtain the second image;

[0060] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0061] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0062] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0063] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

[0064] In this embodiment, for the first image that needs to be encoded, the pixels in each row of the first image can be grouped into groups of every two adjacent pixels in sequence for encoding processing. Specifically, the first and second pixels in each row are grouped together, the third and fourth pixels together, the fifth and sixth pixels together, and so on. Alternatively, the pixels in each column of the first image can also be grouped into groups of every two adjacent pixels in sequence for column encoding processing. Specifically, the first and second pixels in each column are grouped together, the third and fourth pixels together, the fifth and sixth pixels together, and so on. For ease of description, the two pixels in each group are referred to as the first pixel and the second pixel, respectively.

[0065] It should be noted that since each group includes two adjacent pixels, it is necessary to ensure that the number of pixels in each row or column is even, so that each pixel can be assigned to a group. To achieve this effect, before encoding the first image, it can be determined whether the number of pixels in each row of the first image is even. If it is not even, the number of pixels in each row of the first image is adjusted to be even, so that each pixel in each row can be divided into a pair of first and second pixels. Alternatively, it can be determined whether the number of pixels in each column of the first image is even. If it is not even, the number of pixels in each column of the first image is adjusted to be even, so that each pixel in each column can be divided into a pair of first and second pixels. The process of adjusting the number of pixels to be even can be achieved by scaling. Taking grouping by row direction as an example, if the number of pixels in each row of the first image is not even, the first or last column of pixels can be deleted, or a column of pixels can be added before the first column of pixels or after the last column of pixels, or the number of pixels in each row of the first image can be adjusted to be even by other scaling methods. The principle is similar when adjusting the number of pixels in each column when grouping by column direction, so it will not be elaborated here.

[0066] For the first image, each pixel includes a first color channel, a second color channel, a third color channel (the first and third color channels can be RGB channels or YUV channels, etc.), and a transparency channel (Alpha channel). During the encoding process, the transparency channel of each pixel in the first image is reduced, and the two color channels of two adjacent pixels are shared to obtain the second image. Each pixel in the second image includes only three color channels. The correspondence between the channels in the first image and the second image is as follows:

[0067] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0068] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

[0069] Optionally, the first color channel of the first pixel in the second image is the average of the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image; the second color channel of the second pixel in the second image is the average of the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image.

[0070] Taking the RGB color channel as an example, such as Figure 3 As shown, the R (red) channel (i.e., the first color channel mentioned above) of the first pixel can be used to record the average value R = (R1 + R2) / 2 of the R channel colors R1 and R2 of the first and second pixels. The B (blue) channel (i.e., the second color channel mentioned above) of the second pixel can be used to record the average value B = (B1 + B2) / 2 of the B channel colors B1 and B2 of the first and second pixels. In this way, the B channel of the first pixel and the R channel of the second pixel are left empty. The B channel of the first pixel can be used to write the transparency value A1 of the transparency channel of the first pixel, and the R channel of the second pixel can be used to write the transparency value A2 of the transparency channel of the second pixel. The G (green) channel (i.e., the third color channel mentioned above) of the first and second pixels remains unchanged. In this embodiment, the red and blue channels are chosen to be shared because the human eye is more sensitive to green (G channel). The color distortion caused by sharing the red and blue channels is not obvious to the human eye. Of course, in this embodiment, any two channels can be shared, such as sharing the R channel and the G channel, or sharing the G channel and the B channel. This embodiment is not limited.

[0071] After the above processing, such as Figure 4 As shown, a transcoded image (right side) can be generated from a transparent frame image (left side).

[0072] The image processing method provided in this embodiment reduces the number of transparency channels, decreases the storage space occupied by the image, and shortens the image transmission time by sharing two color channels between two adjacent pixels when encoding the image, so that each pixel can reserve a channel for recording its transparency information.

[0073] The above embodiments can be applied to the encoding of transparent frame animations. Each frame of the transparent frame animation is encoded as the first image in the above embodiments. For transparent frame animation videos, since both color channel and alpha channel values ​​are required, in order to avoid the prior art of enlarging the image to twice its original width and the alpha channel occupying twice the texture space, two adjacent pixels share two color channels. One of the three color channels of each pixel is left empty and written to the alpha channel for the alpha value. In this way, the alpha channel does not need to occupy twice the texture space, reducing the size of the animation video and the texture space occupied during rendering, reducing the transmission time of the animation video and the consumption during rendering.

[0074] Since this embodiment processes each frame of the image at the pixel level, before encoding each frame of the image, it is necessary to decode each frame of the transparent frame animation (i.e., the first image) from the initial image format into bitmap data. The bitmap data includes the pixel data of the frame image, especially the color channel and transparency channel values ​​of each pixel.

[0075] Optionally, when encoding transparent frame animations, the above encoding process can be implemented by sequentially traversing the pixel data of each frame image. For example, for the i-th row, let j = 0, and then read the channel values ​​of the first pixel:

[0076] R1=(float)image[i*width*4+j+0];

[0077] G1=(float)image[i*width*4+j+1];

[0078] B1=(float)image[i*width*4+j+2];

[0079] A1=(float)image[i*width*4+j+3];

[0080] Read the channel values ​​of the second pixel:

[0081] R2=(float)image[i*width*4+j+4];

[0082] G2=(float)image[i*width*4+j+5];

[0083] B2=(float)image[i*width*4+j+6];

[0084] A2=(float)image[i*width*4+j+7];

[0085] Then calculate R = (r1 + r2) / 2; B = (b1 + b2) / 2;

[0086] Then assign a value:

[0087] data[i*width*4+j+0]=R;

[0088] data[i*width*4+j+1]=G1;

[0089] data[i*width*4+j+2]=A1;

[0090] data[i*width*4+j+3]=255;

[0091] data[i*width*4+j+4]=A2;

[0092] data[i*width*4+j+5]=G2;

[0093] data[i*width*4+j+6]=B;

[0094] data[i*width*4+j+7]=255;

[0095] After completing the assignment, let j+=8 to process the two pixels in the next group. After processing a row of pixels, let i+=1 to process the next row of pixels.

[0096] Optionally, after encoding all pixels of an image frame, the bitmap data of that image frame (i.e., the second image) can be encoded into a target image format, such as PNG format.

[0097] After encoding each frame, the sequence of frames can be combined into a video using software or hardware encoders to obtain an animated video file. For example, using the software encoder ffmpeg, parameters such as video output frame rate (fps), bit rate (crf), pixel encoding format, and video output path can be set, which are not limited here.

[0098] The videos were sampled and encoded using YUV444p, with a CRF value of 6, a size of 1024*1024, an FPS of 24, and a keyframe interval of 10. An experiment was conducted using a certain mobile phone. Table 1 compares existing techniques for expanding image width to record transparency information (split-screen format) with this embodiment (sharing the RB channel).

[0099] Table 1

[0100] Encoding format volume Total memory usage Memory usage (graphics) CPU utilization GPU utilization Split-screen format 8.3MB 190MB 52MB 14% 3.6MB Shared RB channel 6.6MB 123MB 44MB 11% 3.7MB

[0101] As can be seen, the image processing method provided in this embodiment has better advantages in terms of memory and rendering.

[0102] refer to Figure 5 , Figure 5 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure. The image processing method of this embodiment can be applied to a terminal device or a server. The image processing method of this embodiment is the decoding process corresponding to the above embodiments, and includes:

[0103] S501, Obtain the second image;

[0104] S502. Decode the second image to obtain the first image;

[0105] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0106] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0107] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0108] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0109] In this embodiment, in order to decode the second image generated in the above embodiment, it is also necessary to group the pixels in the second image. The pixels in each row of the second image are grouped into groups of two adjacent pixels in sequence for encoding processing; or, the pixels in each column of the second image are grouped into groups of two adjacent pixels in sequence for column encoding processing. In this embodiment, a grouping method that is completely consistent with the encoding process needs to be adopted, because during encoding, two adjacent pixels in each group share two color channels. If a different grouping is used during decoding, it will result in the inability to restore the two target color channels shared by these two pixels.

[0110] The decoding process is the reverse of the encoding process in S202. It obtains the color and transparency values ​​of two adjacent pixels from a shared color channel, and then reconstructs the two adjacent pixels based on these values, thus restoring the second image to the first image. The correspondence between the channels of the second image and the first image is as follows:

[0111] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined according to the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined according to the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined according to the third color channel of the first pixel in the second image.

[0112] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0113] Optionally, the value of the first color channel of the first pixel in the second image is determined as the value of the first color channel of the first pixel in the first image and the value of the first color channel of the second pixel in the first image; the value of the second color channel of the second pixel in the second image is determined as the value of the second color channel of the first pixel in the first image and the value of the second color channel of the second pixel in the first image.

[0114] For example, with Figure 3 Taking the encoding process shown as an example, the corresponding decoding process is as follows: Figure 6 As shown,

[0115] The R channel (first color channel) value is extracted from the first pixel of the second image and used as the R value of the first pixel and the second pixel of the first image. The B channel (second color channel) value is extracted from the second pixel of the second image and used as the B value of the first pixel and the second pixel of the first image. The B channel value A1 is extracted from the first pixel of the second image and used as the transparency value A1 of the transparency channel of the first pixel of the first image. The R channel value A2 is extracted from the second pixel of the second image and used as the transparency value A2 of the transparency channel of the second pixel of the first image. The G channel (third color channel) of the first pixel and the second pixel remains unchanged.

[0116] Furthermore, the above embodiments can be applied to the decoding of transparent frame animations. First, the animation video file can be decoded to obtain the image texture (pixels) of each frame. Then, applying the above decoding method, after decoding to obtain the values ​​of each channel of each pixel in each frame, the color values ​​of the first, second, and third color channels of each pixel can be multiplied by its transparency value to obtain the color of the fragment pixel. Taking the first pixel as an example:

[0117] gl_FragColor.r = R * A1;

[0118] gl_FragColor.g = G1 * A1;

[0119] gl_FragColor.b = B * A1;

[0120] At this point, we can set gl_FragColor.a = 1.0f * alpha;

[0121] In other words, there is no need to double the image width to record transparency information, as the color of the fragment pixels already contains transparency information.

[0122] After the above processing, it can be Figure 4 The image after transcoding (right side) is restored to a transparent frame image (left side).

[0123] Similarly, in an embodiment of the encoding process described above, the decoding process described above can also be achieved by sequentially traversing the pixel data of each frame of the image, which will not be elaborated here.

[0124] Optionally, in this embodiment, the fragment shader in the rendering pipeline can be used to perform the decoding process. Specifically, the output transparent frame animation can be rendered using a graphics library (such as OpenGL) and finally displayed. When using OpenGL, the decoding process can be restored by the fragment shader in the OpenGL rendering pipeline to save CPU overhead.

[0125] This embodiment can decode, render, and display the animated video file generated in the above embodiment through the above process, avoiding the need to expand the image width to record transparency information, reducing the size of the animated video and the texture space occupied during rendering, and reducing the transmission time and rendering costs of the animated video.

[0126] The image processing method corresponding to the embodiment of the encoding process shown above, Figure 7 This is a structural block diagram of an image processing apparatus provided according to embodiments of the present disclosure. For ease of explanation, only the parts relevant to embodiments of the present disclosure are shown. (Refer to...) Figure 7 The image processing device 700 includes: an acquisition unit 701 and an encoding unit 702.

[0127] Acquisition unit 701 is used to acquire the first image;

[0128] The encoding unit 702 is used to encode the first image to obtain the second image;

[0129] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0130] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0131] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0132] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image; the second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image; and the third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image. In one or more embodiments of this disclosure, the first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image, including:

[0133] The first color channel of the first pixel in the second image is the average of the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image;

[0134] The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image, including:

[0135] The second color channel of the second pixel in the second image is the average of the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image.

[0136] In one or more embodiments of this disclosure, before encoding the first image, the encoding unit 702 is further configured to:

[0137] Determine whether the number of pixels in each row of the first image is even. If it is not even, adjust the number of pixels in each row of the first image to be even, so that each pixel in each row can be divided into a pair of first pixels and second pixels; or

[0138] Determine whether the number of pixels in each column of the first image is even. If it is not even, adjust the number of pixels in each column of the first image to be even, so that each pixel in each column can be divided into a pair of first pixels and second pixels.

[0139] In one or more embodiments of this disclosure, before encoding the first image, the encoding unit 702 is further configured to:

[0140] The first image is decoded from the initial image format into bitmap data, and the bitmap data includes the color channels and transparency channels of each pixel;

[0141] Encoding the first image to obtain the second image includes:

[0142] Based on the bitmap data of the first image, the first image is encoded to obtain the bitmap data of the second image, and the bitmap data of the second image is encoded into the second image in the target image format.

[0143] The image processing device provided in this embodiment can be used to execute the technical solution of the method embodiment corresponding to the above encoding process. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.

[0144] The image processing method corresponding to the embodiment of the decoding process shown above, Figure 8 This is a structural block diagram of an image processing apparatus provided according to embodiments of the present disclosure. For ease of explanation, only the parts relevant to embodiments of the present disclosure are shown. (Refer to...) Figure 8 The image processing device 800 includes: an acquisition unit 801 and a decoding unit 802.

[0145] Acquisition unit 801 is used to acquire the second image;

[0146] Decoding unit 802 is used to decode the second image to obtain the first image;

[0147] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0148] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0149] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0150] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0151] In one or more embodiments of this disclosure, the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image, including:

[0152] The value of the first color channel of the first pixel in the second image is determined as the value of the first color channel of the first pixel in the first image and the value of the first color channel of the second pixel in the first image;

[0153] The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image, including:

[0154] The value of the second color channel of the second pixel in the second image is determined as the value of the second color channel of the first pixel in the first image and the value of the second color channel of the second pixel in the first image.

[0155] In one or more embodiments of this disclosure, the decoding unit 802 is further configured to:

[0156] Multiply the first color channel, second color channel, and third color channel of each pixel in the first image by the value of its transparency channel.

[0157] The image processing device provided in this embodiment can be used to execute the technical solution of the method embodiment corresponding to the above decoding process. Its implementation principle and technical effect are similar, and will not be repeated here.

[0158] refer to Figure 9The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0159] like Figure 9 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0160] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0161] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing any one or more of the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of any one or more embodiments of this disclosure.

[0162] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a 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 device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0163] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0164] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods shown in any one or more of the above embodiments.

[0165] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0167] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0168] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0169] In the context of this disclosure, a machine-readable medium can 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 can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, 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 include electrical connections based on one or more wires, portable computer disks, hard disks, 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.

[0170] In a first aspect, according to one or more embodiments of the present disclosure, an image processing method is provided, comprising:

[0171] Get the first image;

[0172] The first image is encoded to obtain the second image;

[0173] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0174] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0175] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0176] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

[0177] According to one or more embodiments of this disclosure, the first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image, including:

[0178] The first color channel of the first pixel in the second image is the average of the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image;

[0179] The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image, including:

[0180] The second color channel of the second pixel in the second image is the average of the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image.

[0181] According to one or more embodiments of this disclosure, before encoding the first image, the method further includes:

[0182] Determine whether the number of pixels in each row of the first image is even. If it is not even, adjust the number of pixels in each row of the first image to be even, so that each pixel in each row can be divided into a pair of first pixels and second pixels; or

[0183] Determine whether the number of pixels in each column of the first image is even. If it is not even, adjust the number of pixels in each column of the first image to be even, so that each pixel in each column can be divided into a pair of first pixels and second pixels.

[0184] According to one or more embodiments of this disclosure, before encoding the first image, the method further includes:

[0185] The first image is decoded from the initial image format into bitmap data, and the bitmap data includes the color channels and transparency channels of each pixel;

[0186] Encoding the first image to obtain the second image includes:

[0187] Based on the bitmap data of the first image, the first image is encoded to obtain the bitmap data of the second image, and the bitmap data of the second image is encoded into the second image in the target image format.

[0188] Secondly, according to one or more embodiments of this disclosure, an image processing method is provided, comprising:

[0189] Obtain the second image;

[0190] Decode the second image to obtain the first image;

[0191] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0192] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0193] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0194] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0195] According to one or more embodiments of this disclosure, the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image, including:

[0196] The value of the first color channel of the first pixel in the second image is determined as the value of the first color channel of the first pixel in the first image and the value of the first color channel of the second pixel in the first image;

[0197] The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image, including:

[0198] The value of the second color channel of the second pixel in the second image is determined as the value of the second color channel of the first pixel in the first image and the value of the second color channel of the second pixel in the first image.

[0199] According to one or more embodiments of this disclosure, the method further includes:

[0200] Multiply the first color channel, second color channel, and third color channel of each pixel in the first image by the value of its transparency channel.

[0201] Thirdly, according to one or more embodiments of the present disclosure, an image processing apparatus is provided, comprising:

[0202] The acquisition unit is used to acquire the first image;

[0203] The encoding unit is used to encode the first image to obtain the second image;

[0204] The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel.

[0205] The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel;

[0206] The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image.

[0207] The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image; the second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image; and the third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image. According to one or more embodiments of this disclosure, the first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image, including:

[0208] The first color channel of the first pixel in the second image is the average of the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image;

[0209] The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image, including:

[0210] The second color channel of the second pixel in the second image is the average of the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image.

[0211] According to one or more embodiments of this disclosure, before encoding the first image, the encoding unit is further configured to:

[0212] Determine whether the number of pixels in each row of the first image is even. If it is not even, adjust the number of pixels in each row of the first image to be even, so that each pixel in each row can be divided into a pair of first pixels and second pixels; or

[0213] Determine whether the number of pixels in each column of the first image is even. If it is not even, adjust the number of pixels in each column of the first image to be even, so that each pixel in each column can be divided into a pair of first pixels and second pixels.

[0214] According to one or more embodiments of this disclosure, before encoding the first image, the encoding unit is further configured to:

[0215] The first image is decoded from the initial image format into bitmap data, and the bitmap data includes the color channels and transparency channels of each pixel;

[0216] Encoding the first image to obtain the second image includes:

[0217] Based on the bitmap data of the first image, the first image is encoded to obtain the bitmap data of the second image, and the bitmap data of the second image is encoded into the second image in the target image format.

[0218] Fourthly, according to one or more embodiments of this disclosure, an image processing apparatus is provided, comprising:

[0219] The acquisition unit is used to acquire the second image;

[0220] The decoding unit is used to decode the second image to obtain the first image;

[0221] The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel.

[0222] The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel.

[0223] The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image.

[0224] The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

[0225] According to one or more embodiments of this disclosure, the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image, including:

[0226] The value of the first color channel of the first pixel in the second image is determined as the value of the first color channel of the first pixel in the first image and the value of the first color channel of the second pixel in the first image;

[0227] The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image, including:

[0228] The value of the second color channel of the second pixel in the second image is determined as the value of the second color channel of the first pixel in the first image and the value of the second color channel of the second pixel in the first image.

[0229] According to one or more embodiments of this disclosure, the decoding unit is further configured to:

[0230] Multiply the first color channel, second color channel, and third color channel of each pixel in the first image by the value of its transparency channel.

[0231] Fifthly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0232] The memory stores computer-executed instructions;

[0233] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the image processing method as described in the first aspect and various possible designs of the first aspect, or the image processing method as described in the second aspect and various possible designs of the second aspect.

[0234] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect, or the image processing method described in the second aspect and various possible designs of the second aspect.

[0235] In a seventh aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including computer execution instructions that, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect, or the image processing method described in the second aspect and various possible designs of the second aspect.

[0236] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0237] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0238] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. An image processing method, characterized in that, include: Get the first image; The first image is encoded to obtain the second image; The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel. The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel; The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image. The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

2. The method according to claim 1, characterized in that, The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image, including: The first color channel of the first pixel in the second image is the average of the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image; The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image, including: The second color channel of the second pixel in the second image is the average of the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image.

3. The method according to claim 1 or 2, characterized in that, Before encoding the first image, the method further includes: Determine whether the number of pixels in each row of the first image is even. If it is not even, adjust the number of pixels in each row of the first image to be even, so that each pixel in each row can be divided into a pair of first pixels and second pixels; or Determine whether the number of pixels in each column of the first image is even. If it is not even, adjust the number of pixels in each column of the first image to be even so that each pixel in each column can be divided into a pair of first pixels and second pixels.

4. The method according to claim 1 or 2, characterized in that, Before encoding the first image, the method further includes: The first image is decoded from the initial image format into bitmap data, and the bitmap data includes the color channel data of each pixel; Encoding the first image to obtain the second image includes: Based on the bitmap data of the first image, the first image is encoded to obtain the bitmap data of the second image, and the bitmap data of the second image is encoded into the second image in the target image format.

5. An image processing method, characterized in that, include: Obtain the second image; Decode the second image to obtain the first image; The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel. The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel. The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image. The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

6. The method according to claim 5, characterized in that, The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image, including: The value of the first color channel of the first pixel in the second image is determined as the value of the first color channel of the first pixel in the first image and the value of the first color channel of the second pixel in the first image; The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image, including: The value of the second color channel of the second pixel in the second image is determined as the value of the second color channel of the first pixel in the first image and the value of the second color channel of the second pixel in the first image.

7. The method according to claim 5 or 6, characterized in that, Also includes: Multiply the first color channel, second color channel, and third color channel of each pixel in the first image by the value of its transparency channel.

8. An image processing device, characterized in that, include: The acquisition unit is used to acquire the first image; The encoding unit is used to encode the first image to obtain the second image; The pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel, and the pixels of the second image include a first color channel, a second color channel, and a third color channel. The first pixel is located at the same position in the first image and the second image, the second pixel is located at the same position in the first image and the second image, and the first pixel is adjacent to the second pixel; The first color channel of the first pixel in the second image is determined based on the first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image. The second color channel of the first pixel in the second image is determined based on the transparency channel of the first pixel in the first image. The third color channel of the first pixel in the second image is determined based on the third color channel of the first pixel in the first image. The first color channel of the second pixel in the second image is determined based on the transparency channel of the second pixel in the first image. The second color channel of the second pixel in the second image is determined based on the second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image. The third color channel of the second pixel in the second image is determined based on the third color channel of the second pixel in the first image.

9. An image processing device, characterized in that, include: The acquisition unit is used to acquire the second image; The decoding unit is used to decode the second image to obtain the first image; The pixels of the second image include a first color channel, a second color channel, and a third color channel, while the pixels of the first image include a first color channel, a second color channel, a third color channel, and a transparency channel. The first pixel is located in the same position in the second image as in the first image, the second pixel is located in the same position in the second image as in the first image, and the first pixel is adjacent to the second pixel. The first color channel of the first pixel in the first image and the first color channel of the second pixel in the first image are determined based on the first color channel of the first pixel in the second image. The transparency channel of the first pixel in the first image is determined based on the second color channel of the first pixel in the second image. The third color channel of the first pixel in the first image is determined based on the third color channel of the first pixel in the second image. The transparency channel of the second pixel in the first image is determined based on the first color channel of the second pixel in the second image. The second color channel of the first pixel in the first image and the second color channel of the second pixel in the first image are determined based on the second color channel of the second pixel in the second image. The third color channel of the second pixel in the first image is determined based on the third color channel of the second pixel in the second image.

10. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-4 or 5-7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-4 or 5-7.

12. A computer program product, characterized in that, Includes computer execution instructions, which, when executed by a processor, implement the method as described in any one of claims 1-4 or 5-7.