Method, apparatus and electronic device for storing sequence frames

By generating and storing grayscale images of sequence frames and using color lookup maps, the problem of large storage space consumption in sequence frame animations is solved, achieving more efficient storage and performance improvement.

CN116361495BActive Publication Date: 2026-05-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-02-17
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the storage methods for sequence frame animations occupy a large amount of storage space, affecting game performance, especially when the frame rate is high or the number of animations is large.

Method used

By generating grayscale images of sequence frames and storing them in a single color channel, while using color lookup maps to recover color values, storage requirements are reduced and performance is improved.

Benefits of technology

It effectively reduces the space occupied by sequence frame textures in the game package, improves the game's performance, and can restore the colors of sequence frames without loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116361495B_ABST
    Figure CN116361495B_ABST
Patent Text Reader

Abstract

The application provides a sequence frame storage method and device and electronic equipment, for each sequence frame in a sequence frame set, a grayscale image of the sequence frame is generated according to an index value corresponding to a color value of the sequence frame; a color lookup map of the sequence frame is determined according to the color value and the index value; the grayscale image is stored in each map position of each channel of the sequence frame map; and a storage result of the sequence frame set is obtained according to the obtained target sequence frame map and the color lookup map. In the method, the grayscale image generated by the index value corresponding to the color value of the sequence frame only occupies one color channel, so that each channel of the sequence frame map can store the grayscale image of the sequence frame, more grayscale images can be stored, the utilization rate of the sequence frame map is improved, and the space occupied by the sequence frame map in a game package is reduced. In addition, the color lookup map of the sequence frame can restore the color of each sequence frame without loss, and the running performance of the game is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus and electronic device for storing sequence frames. Background Technology

[0002] Current 2D frame-by-frame animations are typically implemented using sequential frame images. Specifically, the game engine plays these images in a specified order to achieve the 2D animation. However, implementing frame-by-frame animation requires storing the color values ​​for each color channel of the frame images. Related technologies often use textures to store these values. When the frame rate is high or the number of animations is large, a large number of textures are needed to store the color values ​​for each channel. This results in a significant increase in game storage space, increasing the game's file size and impacting performance. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a method, apparatus and electronic device for storing sequence frames, so as to improve the utilization rate of sequence frame textures, reduce the space occupied by sequence frame textures in the game package, and improve the running performance of the game.

[0004] In a first aspect, embodiments of the present invention provide a method for storing sequence frames. The method includes: acquiring a set of sequence frames; wherein the set of sequence frames includes multiple sequence frames; for each sequence frame, determining an index value corresponding to a color value based on the color value of the sequence frame; generating a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicates the index value corresponding to the color value in the sequence frame; determining a color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value; storing the grayscale image of each sequence frame into the respective map position of each channel of the sequence frame map according to the playback order of the sequence frames, to obtain a target sequence frame map; and determining the target sequence frame map and the target color lookup map in the color lookup map as the storage result of the sequence frame set.

[0005] Secondly, embodiments of the present invention provide a storage device for sequence frames, the device comprising: a sequence frame set acquisition module, configured to acquire a sequence frame set; wherein the sequence frame set includes multiple sequence frames; an index value determination module, configured to determine, for each sequence frame, an index value corresponding to a color value based on the color value of the sequence frame; a grayscale image generation module, configured to generate a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicates: the index value corresponding to the color value in the sequence frame; a color lookup map determination module, configured to determine a color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value; a grayscale image storage module, configured to store the grayscale image of each sequence frame into each map position of each channel of the sequence frame map according to the playback order of the sequence frames, to obtain a target sequence frame map; and a storage result determination module, configured to determine the target sequence frame map and the target color lookup map in the color lookup map as the storage result of the sequence frame set.

[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for storing sequence frames according to any of the first aspects.

[0007] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the method for storing sequence frames according to any of the first aspects.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] This invention provides a method, apparatus, and electronic device for storing sequence frames. For each sequence frame in a sequence frame set, a grayscale image of the sequence frame is generated based on the index value corresponding to its color value. A color lookup map of the sequence frame is determined based on the color value and the index value. The grayscale image is stored in each map position of each channel of the sequence frame map. The storage result of the sequence frame set is obtained based on the obtained target sequence frame map and the color lookup map. In this method, the grayscale image generated by the index value corresponding to the color value of the sequence frame occupies only one color channel, allowing each channel of the sequence frame map to store the grayscale image of the sequence frame. This enables the storage of more grayscale images, improves the utilization rate of the sequence frame map, and reduces the space occupied by the sequence frame map in the game package. Furthermore, by using the color lookup map of the sequence frame, the color of each sequence frame can be restored without loss of quality, improving the game's performance.

[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a method for storing sequence frames according to an embodiment of the present invention;

[0014] Figure 2 A schematic diagram of a sequence frame set provided in an embodiment of the present invention;

[0015] Figure 3 This is a schematic diagram illustrating the index value corresponding to the color value of a sequence frame, provided in an embodiment of the present invention.

[0016] Figure 4 A schematic diagram illustrating the implementation result of a parameter code provided in an embodiment of the present invention;

[0017] Figure 5 A schematic diagram illustrating the implementation result of another parameter code provided in an embodiment of the present invention;

[0018] Figure 6 A schematic diagram of a first color lookup table provided in an embodiment of the present invention;

[0019] Figure 7 A schematic diagram illustrating a method for generating a grayscale image according to an embodiment of the present invention;

[0020] Figure 8 A schematic diagram illustrating a sampling method provided in an embodiment of the present invention;

[0021] Figure 9 A schematic diagram of the structure of a storage device for sequence frames provided in an embodiment of the present invention;

[0022] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

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

[0024] Currently in the gaming industry, whether on PC or mobile devices, implementing frame-by-frame animation requires storing the RGB three-channel colors of each frame. Specifically, 2D frame-by-frame animation is typically implemented using a series of frame images. This usually involves rendering the 3D animation onto a single image or a set of images, which are then played in a specified order within the game engine to achieve the 2D frame-by-frame animation. However, implementing frame-by-frame animation requires storing the color values ​​for each color channel within the frame images.

[0025] In related technologies, textures are typically used to store the color values ​​of each color channel in a sequence of frame images. When the frame rate of the sequence is high or the number of sequence frame animations is large, a large number of textures are needed to store the color values ​​of each channel in the sequence of frame images. A large number of textures will occupy a large amount of game storage space, increase the size of the game package, and affect the game's running performance. Based on this, the embodiments of the present invention provide a method, apparatus, and electronic device for storing sequence frames. This technology can be applied to terminal devices such as mobile phones, tablets, and computers, and is especially applicable to the batch processing of a large number of sequence frames.

[0026] To facilitate understanding of this embodiment, a method for storing sequence frames disclosed in this invention will first be described in detail, such as... Figure 1 As shown, the method includes:

[0027] Step S102: Obtain a set of sequence frames; wherein, the set of sequence frames includes multiple sequence frames;

[0028] The aforementioned sequence frames typically refer to single frames within a set of sequence frames. Multiple sequence frames usually belong to the same sequence frame animation; that is, the objects in each sequence frame are the same, only their actions differ. For example, ... Figure 2 As shown, this is a collection of sequence frames, which includes multiple sequence frames. Each sequence frame contains the same object, but the shapes are different. Based on these multiple sequence frames, playing them in a certain order can be displayed as a sequence frame animation.

[0029] In actual implementation, the first step is to obtain a set of sequence frames, which includes every single frame of the same sequence frame animation. For example, for a 2-minute sequence frame animation, all the frames in that 2-minute animation constitute the corresponding set of sequence frames.

[0030] Step S104: For each sequence frame, determine the index value corresponding to the color value based on the color value of the sequence frame;

[0031] The color values ​​mentioned above typically refer to the red, green, and blue channel colors of the RGB color mode in the sequence frame. Each channel is usually represented by a number between 0 and 255. The index values ​​mentioned above typically refer to integers between 0 and 255.

[0032] In actual implementation, for each sequence frame in the sequence frame set, the color value of that sequence frame is obtained. The index value corresponding to each color value can be determined based on the magnitude of that color value. For example, the color values ​​can be normalized to a value between 0 and 255 to obtain the index value for each color value, which is an integer between 0 and 255. Alternatively, the color values ​​can be sorted, and the index value corresponding to each color value can be determined based on the sorting order.

[0033] It is understandable that the color value of each pixel in a sequence frame corresponds to an index value. If different pixels have the same color value, then the corresponding index value for that pixel will also be the same. For example, ... Figure 3 The sequence frame shown in (a) includes three color values: the color value of the first region is the first color value, the color value of the second region is the second color value, and the color value of the third region is the third color value. The index value corresponding to each color value is determined according to the steps described above. For example, the index value corresponding to the first color value is 1, the index value corresponding to the second color value is 2, and the index value corresponding to the third color value is 3. Then, the index value corresponding to each pixel in this sequence frame is as follows: Figure 3 As shown in (b), the index value of each pixel in the first region is 1, the index value of each pixel in the second region is 2, and the index value of each pixel in the third region is 3.

[0034] Step S106: Generate a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicates the index value corresponding to the color value in the sequence frame.

[0035] The above steps are all implemented in an image processing program, where the index value corresponding to the color value can be directly obtained. However, in a game engine, the index value corresponding to the color value cannot be read. Therefore, a grayscale image of the sequence frames is generated based on the index value corresponding to the color value. The grayscale image stores the index value corresponding to the color value of the sequence frame through its grayscale values. In other words, the grayscale image is used to indicate the index value corresponding to the color value in the sequence frame. This allows the game engine to determine the index value corresponding to each pixel in the sequence frame by reading the grayscale values ​​of the grayscale image.

[0036] Specifically, you can directly convert the index value corresponding to the color value of each pixel in the sequence frame to a grayscale value to obtain the grayscale image of the sequence frame; that is, replace the color values ​​of the color channels in the sequence frame with the index values. Alternatively, you can update the color lookup table of the sequence frame according to the index values, changing the color values ​​in the color lookup table to the index values, which can also generate a grayscale image of the sequence frame.

[0037] For example, it can be based on Figure 3 The index value indicated by (b) in the image generates the corresponding grayscale image. In this grayscale image, the grayscale value of the first region is 1 (or represented as (1,1,1)), the grayscale value of the second region is 2 (or represented as (2,2,2)), and the grayscale value of the third region is 3 (or represented as (3,3,3)).

[0038] Step S108: Determine the color lookup map of the sequence frame based on the color value and the corresponding index value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value;

[0039] Similarly, the above steps are all implemented in the image processing program, where the color value corresponding to the index value can be directly obtained. However, the game engine cannot read the color value corresponding to the index value. Therefore, a color lookup map of the sequence frames is determined based on the color value and its corresponding index value. This color lookup map stores the correspondence between the color values ​​and index values ​​of the sequence frames. In other words, the color lookup map is used to determine the color value corresponding to the index value. This allows the game engine to determine the color value corresponding to the index value by reading the color lookup map.

[0040] The color lookup map described above stores index values ​​and their corresponding color values. This color lookup map can be a one-dimensional or multi-dimensional image. A one-dimensional image can be understood as containing 1 row and n columns of pixel positions, each storing its index and color value, with the index values ​​either increasing or decreasing from left to right. A multi-dimensional image can be understood as containing m rows and n columns of pixel positions. Each pixel position stores its index and color value, with the index values ​​either increasing or decreasing from left to right and top to bottom. Therefore, after obtaining the index value of a pixel in the sequence frame, the corresponding pixel position can be found in the color lookup map based on that index value. The color value of that pixel position can then be determined as the color value corresponding to the index value, thus obtaining the color value of the pixel in the sequence frame.

[0041] In practice, the index values ​​can be sorted by size to determine the pixel positions. Then, the color value corresponding to the index value of each pixel position can be stored in the color channel of that pixel position to generate a color lookup map for the sequence frames.

[0042] Step S110: According to the playback order of the sequence frames, store the grayscale image of each sequence frame into the respective texture position of each channel of the sequence frame texture to obtain the target sequence frame texture.

[0043] The aforementioned sequence frame texture is typically divided into multiple texture locations, with each location used to store one sequence frame. In this implementation, since a grayscale image occupies only one color channel, it can be stored in each channel of the sequence frame texture. Generally, a sequence frame texture includes four channels (RGBA), so each channel is also divided into multiple cells.

[0044] For example, the sequence frame set includes 60 sequence frames, and the sequence frame texture is divided into 3 rows and 5 columns of texture positions. Following the playback order of the sequence animation, the grayscale images of the first 15 frames are stored sequentially in the red channel. Specifically, the first frame is stored in the first row and first column of the red channel, the second frame in the first row and second column, and so on, from left to right and top to bottom. Then, the grayscale images of frames 16-30 are stored in the green channel. Specifically, the 16th frame is stored in the first row and first column, the 17th frame in the first row and second column, and so on, from left to right and top to bottom. Next, the grayscale images of frames 31-45 are stored in the blue channel, again in the left-to-right and top-to-bottom order. Finally, the grayscale images of frames 46-60 are stored in the alpha channel, again in the left-to-right and top-to-bottom order.

[0045] Step S112: Determine the target color lookup map in the target sequence frame map and the target color lookup map in the color lookup map as the storage result of the sequence frame set.

[0046] The aforementioned target color lookup map typically refers to the color lookup map of any one sequence frame in the sequence frame set. This target color lookup map is displayed as an image, and its color is basically consistent with the color lookup maps of the other sequence frames.

[0047] In actual implementation, since the colors of each sequence frame are basically the same, it is only necessary to store any one color lookup map (i.e., the target color lookup map mentioned above).

[0048] This invention provides a method for storing sequence frames, which involves obtaining a set of sequence frames, wherein the set of sequence frames includes multiple sequence frames; for each sequence frame, determining the index value corresponding to the color value of the sequence frame; generating a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicating the index value corresponding to the color value in the sequence frame; determining a color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map being used to: determine the color value corresponding to the index value based on the index value; storing the grayscale image of each sequence frame in the respective map position of each channel of the sequence frame map according to the playback order of the sequence frames, thereby obtaining a target sequence frame map; and determining the target sequence frame map and the target color lookup map in the color lookup map as the storage result of the sequence frame set. In this method, the grayscale image generated by the index value corresponding to the color value of the sequence frame only occupies one color channel, so that each channel of the sequence frame texture can store the grayscale image of the sequence frame, which can store more grayscale images, improve the utilization rate of the sequence frame texture, and reduce the space occupied by the sequence frame texture in the game package; in addition, by looking up the texture by the color of the sequence frame, the color of each sequence frame can be restored without loss, which improves the running performance of the game.

[0049] Before the step of generating a grayscale image of the sequence frame based on the index value corresponding to the color value, the above method also includes:

[0050] Based on the color value and its corresponding index value, the index mode of the sequence frame and the first color lookup table of the sequence frame are determined; wherein, the first color lookup table and the index mode are used to store the color value of the sequence frame.

[0051] It should be noted that since the index mode only supports 8-bit images, non-8-bit images need to be converted to 8-bit images first before the index mode of the sequence frame can be determined based on the color value and the corresponding index value.

[0052] Additionally, it's important to note that in RGB mode, a sequence frame only requires three channels to store color values ​​to be displayed. However, in indexed mode, a sequence frame typically requires one channel (to store the index value) and a color lookup table to store the colors in order to display the sequence frame. The first color lookup table for the aforementioned sequence frame is usually a table used to store the color values ​​of the sequence frame in indexed mode.

[0053] In practice, since indexed mode only supports 8-bit images, non-8-bit images need to be converted to 8-bit first. For example, using specific image processing software, non-8-bit images can be converted to 8-bit images. Specifically, `pdb.gimp_image_convert_precision()` in GIMP (GNU Image Manipulation Program) can be used to convert non-8-bit sequence frames to 8-bit sequence frames. Then, the indexed mode of the sequence frame is determined based on the color values ​​and their corresponding index values. For example, `pdb.gimp_image_convert_indexeds` can be used to convert the sequence frames to indexed mode. GIMP is an open-source image processing software, also known as an image processing and compositing tool. GIMP is highly extensible; users can extend its functionality through custom plugins. Typically, Python is used to develop GIMP plugins.

[0054] It is understandable that the first color lookup table and the index pattern of the sequence frame in the above color lookup table are used to store the color value of the sequence frame.

[0055] For example, converting an image to indexed mode can be implemented in code, such as by writing a GIMP plugin using Python:

[0056] dither_type = 0;

[0057] palette_type = 0;

[0058] num_cols = 256;

[0059] alpha_dither = False;

[0060] remove_unused = True;

[0061] palette="";

[0062] precision=pdb.gimp_image_get_precision(image);

[0063] If precision! = 150:;

[0064] pdb.gimp_image_convert_precision(image,150);

[0065] pdb.gimp_image_convert_indexed(image,dither_type,palette_type,num_cols,alpha_dither,remove_unused,palette);

[0066] In the code above,

[0067] `dither_type` indicates the dithering interpolation method. In this embodiment, it is usually set to not use dithering interpolation. Since the indexed mode image only supports a maximum of 256 colors, color loss will occur in images with rich colors, resulting in visually visible color banding. For example, ... Figure 4 As shown in (a). If dithering interpolation is used, the algorithm mitigates banding for the same number of colors, for example, as shown in... Figure 2 As shown in (b). Specifically, GIMP has a built-in dithering algorithm.

[0068] Palette_type indicates the type of color lookup table used. Here it is set to generate a color lookup table based on the image (i.e., the sequence of frames). Alternatively, you can choose to use other existing color lookup tables.

[0069] Num_cols represents the maximum number of colors allowed in the color lookup table. The maximum number of colors that the color lookup table can store is 256, and it is set to the maximum value here.

[0070] `Alpha_dither` indicates whether to use alpha dithering; here it's set to not use. It's important to note that the `dither_type` parameter only affects the RGB red, green, and blue color channels; the alpha channel remains unchanged. If alpha dithering is used, dithering interpolation will be applied to the alpha channel, which is the alpha channel. For example, ... Figure 5 (a) and (b) in the code compare the results before and after interpolation. Since the effect after interpolation is not good, alpha interpolation is not used. Specifically, the above code is implemented in GIMP, and dithering interpolation is the only color interpolation method in GIMP's indexed mode. Dithering interpolation is not used, which means that no interpolation method is used.

[0071] Furthermore, regarding the step of determining the index pattern of the sequence frame and the first color lookup table of the sequence frame based on the color value and its corresponding index value, one possible implementation is as follows:

[0072] The multiple color channels of the sequence frame are changed to a single index channel. The color values ​​stored in the multiple color channels are updated to the index values ​​corresponding to the color values, and the index values ​​are stored in the index channel to obtain the index pattern of the sequence frame. The color values ​​corresponding to the index values ​​are sorted first according to the size of the index values, and the result of the first sort is determined as the first color lookup table of the sequence frame.

[0073] The aforementioned multiple color channels typically refer to the red, green, and blue channels in the RGB color mode. The aforementioned index channel typically refers to a single channel in an indexed mode, used to store index values. The aforementioned first sorting can refer to sorting the color values ​​corresponding to the index values ​​in ascending order, meaning the index value at the first position in the first color lookup table is less than the index value at the last position of the color lookup table. Alternatively, it can refer to sorting the color values ​​corresponding to the index values ​​in descending order, meaning the index value at the first position in the first color lookup table is greater than the index value at the last position of the color lookup table.

[0074] In actual implementation, the multiple color channels of the sequence frame, such as the RGB three-color channels, are changed to a single index channel. The color values ​​stored in the multiple color channels are updated with their corresponding index values, which are integer values ​​between 0 and 255. These index values ​​are then stored in the index channel (also called the indexed channel), resulting in the index pattern of the sequence frame. Then, based on the index values, the color values ​​corresponding to the index values ​​can be sorted in ascending order, with the index value at the first position being less than the index value at the last position. Alternatively, they can be sorted in descending order, with the index value at the first position being greater than the index value at the last position. The result of this first sorting is used as the first color lookup table for the sequence frame.

[0075] For example, such as Figure 6 The image shows the first color lookup table. The top-left position is the first color value with an index of 0, and the bottom-right position is the last color value with an index of 255. The indices increase sequentially from left to right and from top to bottom. Figure 6 The colors in the color lookup table shown are grayscale; in reality, Figure 6 Each position in the text is colored.

[0076] In step S104 above, which involves determining the index value corresponding to the color value based on the color value of the sequence frame, one possible implementation is as follows:

[0077] Determine the color value of each pixel in the sequence frame, sort the color values ​​according to their magnitude, and obtain the sorting order value of the color values; determine the sorting order value of the color values ​​as the index value corresponding to the color values.

[0078] After acquiring multiple sequence frames, the color value of each pixel in each sequence frame is first obtained. The above arrangement order refers to the order of color values ​​from smallest to largest or from largest to smallest.

[0079] In actual implementation, the color value of each pixel in the sequence frame is obtained. For example, if there are only three colors in the sequence frame, then only three color values ​​will be obtained. Then, the color values ​​are sorted in ascending (or descending) order. For instance, the first color value is less than the second color value, which is less than the third color value. The first color value is ranked first with an index of 1, the second color value is ranked second with an index of 2, and the third color value is ranked third with an index of 3. For example,... Figure 3 The sequence frame shown in (a) includes three color values: the color value of the first region is the first color value, the color value of the second region is the second color value, and the color value of the third region is the third color value. The index value corresponding to each color value is determined according to the steps described above. For example, the index value corresponding to the first color value is 1, the index value corresponding to the second color value is 2, and the index value corresponding to the third color value is 3. Then, the index value corresponding to each pixel in this sequence frame is as follows: Figure 3 As shown in (b), the index value of each pixel in the first region is 1, the index value of each pixel in the second region is 2, and the index value of each pixel in the third region is 3.

[0080] Furthermore, regarding the step of generating grayscale images of sequence frames based on the index values ​​corresponding to the color values, one possible implementation is as follows:

[0081] Based on the index value, a second color lookup table for the sequence frame is determined; wherein, the index value of each table position in the second color lookup table is the same as the color value of the table position; and a grayscale image of the sequence frame is generated using the index pattern of the sequence frame and the second color lookup table of the sequence frame.

[0082] The aforementioned second color lookup table typically refers to a color lookup table generated based on a linear black and white gradient. The index value of each table position in the second color lookup table is the same as the color value of that table position. For example, if the index value is 7, the corresponding color value is (7, 7, 7), and if the index value is 8, the corresponding color value is (8, 8, 8).

[0083] In practice, the color values ​​in the first color lookup table can be replaced with their corresponding index values ​​to obtain the second color lookup table. Then, by replacing the first color lookup table in index mode with the second color lookup table, the grayscale image of the sequence frame can be generated.

[0084] For example, Figure 7As shown, the first color lookup table in the figure is in color. In index mode, a colored sequence frame can be displayed based on the index value of the index channel of the sequence frame and the first color lookup table. If the first color lookup table of the sequence frame is replaced with a second color lookup table, a grayscale image of the sequence frame can be generated based on the index value of the index channel of the sequence frame and the second color lookup table.

[0085] In the above method, under index mode, updating the first color lookup table to the second color lookup table generates a grayscale image, and then storing the index value in the grayscale image reduces the number of channels in the sequence frame.

[0086] Furthermore, regarding the step of determining the second color lookup table for the sequence frame based on the index value, one possible implementation is as follows:

[0087] The index values ​​are sorted a second time according to their size, and the result of the second sorting is used as the second color lookup table for the sequence frame.

[0088] The second sorting mentioned above usually refers to sorting in ascending order.

[0089] Specifically, the index values ​​are sorted in ascending order, and then the color value corresponding to each index value is replaced with that index value. For example, the color value corresponding to index 1 is (1,1,1), the color value corresponding to index 2 is (2,2,2), the color value corresponding to index 3 is (3,3,3), and the color value corresponding to the last position in the second color lookup table is 255, which corresponds to (255,255,255).

[0090] In step S108 above, which involves determining the color lookup map of a sequence frame based on its color value and the corresponding index value, one possible implementation is as follows:

[0091] The color lookup map of the sequence frame is determined based on the first color lookup table of the sequence frame.

[0092] In practice, the first color lookup table is stored in the indexed image in tabular form and can only be previewed in specified image processing software. This can be understood as exporting the first color lookup table from the image processing program into an image that can be read by the game engine. The pixel position of the texture can be directly determined by the index value of the table. For example, if the index value is 1, the corresponding pixel position in the texture is the top-left corner. In other words, the position of the index value in the first color lookup table corresponds to the position in the texture. Using the color value corresponding to the index value as the color value for that pixel position yields the aforementioned color lookup texture.

[0093] Furthermore, regarding the step of determining the color lookup map of the sequence frame based on the first color lookup table of the sequence frame, one possible implementation is as follows:

[0094] Based on the size of the index value in the first color lookup table, the color values ​​corresponding to the index values ​​are sorted in the third sorting, and the result of the third sorting is determined as the intermediate color lookup table of the sequence frame; wherein, the intermediate color lookup table is a one-dimensional table; based on the color values ​​stored in the intermediate color lookup table, the intermediate color lookup table is converted into a color lookup map of the sequence frame; wherein, the color channels of the color lookup map store color values, and the color values ​​of the color lookup map gradually increase or decrease in the first direction.

[0095] The third sorting mentioned above typically refers to sorting the color values ​​corresponding to the index values ​​in ascending or descending order. The intermediate color lookup table is usually represented as a one-dimensional table with a color gradient. The first direction typically refers to the horizontal direction U when sampling the color lookup map using UV coordinates.

[0096] In practice, the color values ​​corresponding to the first index value are arranged in ascending order and from left to right to form a one-dimensional color gradient table based on the size of the index value stored in the first color lookup table. The result of this arrangement is then used as the intermediate color lookup table for the sequence frame. Specifically, this process can be implemented in a specified image processing software, such as using GIMP's built-in pdb.python_fu_palette_to_gradient() function.

[0097] Then, based on the color values ​​stored in the intermediate color lookup table, the intermediate color lookup table is converted into a color lookup map of the sequence frame. This color lookup map is displayed as an image. Specifically, the intermediate color lookup table can be converted into a color gradient image using GIMP's built-in `pdb.script_fu_gradient_example()` function, and then exported. The exported color lookup map can be read by any software capable of reading images. This color lookup map corresponds to the sequence frame and stores color values ​​in the red, green, and blue channels of the RGB color mode. The color lookup map can be sampled using UV coordinates. In the horizontal direction U of the color lookup map, as the U value increases, the color value gradually increases, or as the U value decreases, the color value gradually decreases.

[0098] For example, exporting the image converted from the intermediate color lookup table can be done in a specific image processing software, such as using the PNG export method, specifically using GIMP's built-in `pdb.file_png_save_default`. This process requires specifying the export path beforehand, and then exporting the image converted from the intermediate color lookup table.

[0099] Step S110 above, which involves storing the grayscale image of each sequence frame into the respective texture position of each channel of the sequence frame texture according to the playback order of the sequence frames, to obtain the target sequence frame texture, can be implemented in one possible way:

[0100] The playback order of the sequence frames is determined based on their file names. In accordance with the playback order, the grayscale images of the sequence frames are stored sequentially at the respective texture positions of the channels of the sequence frame texture map for each channel, thus obtaining the target sequence frame texture map.

[0101] The playback order mentioned above usually refers to the order in which the sequence frames in a sequence frame set are played in chronological order. In actual implementation, for the same sequence frame set, the playback order can be determined based on the filenames of the sequence frame files in the corresponding folder of the sequence frame set. For example, the filenames can be set in ascending numerical order or according to the playback time of the sequence frames, thereby determining the playback order of the sequence frames.

[0102] Then, following the playback order, for each channel of the sequence frame (e.g., the red, green, and blue channels of the RGB color mode), the grayscale image of the sequence frame is stored sequentially in each texture position of the sequence frame texture channel. In other words, the sequence frame texture stores the grayscale image of the sequence frame in a single-cell format. Specifically, the sequence frame images in the sequence frame file are batch-processed to obtain the grayscale image of each sequence frame. Then, they are arranged according to the maximum number of sequence frame images for each channel of the red, green, and blue channels in the RGB color mode. For example, each channel can store 5 grayscale images horizontally and 3 grayscale images vertically, so each channel can store a maximum of 15 grayscale images. After obtaining the first 15 grayscale images of the sequence frame, they are arranged sequentially from left to right and from top to bottom in the red channel according to the playback order. After obtaining the 16th to 30th grayscale images of the sequence frame, they are arranged sequentially in the green channel, and so on. Since storing grayscale images of sequence frames in a texture only requires one channel, the RGB three-color channels and the alpha transparency channel of the texture can all be used to store grayscale images, resulting in four times more sequence frames stored in the texture than when using the RGB three-color channels.

[0103] Finally, the information of each texture position in the channel of the sequence frame texture is the grayscale image of the sequence frame. After storage is completed, the target sequence frame texture is obtained. For example, if the sequence frame set has 60 sequence frames and the storage space of each sequence frame is 100×100, then the storage space of the sequence frame texture obtained from all the sequence frames is 1000×600, while the storage space of the target sequence frame texture is only 500×300.

[0104] In the above method, by storing grayscale images sequentially according to the playback order for each channel, the sequence frame textures can be compressed, reducing the size of the sequence frame textures and enabling batch processing of a large number of sequence frame textures.

[0105] In order to find the color value in the first color lookup table, after determining the target color lookup map in the target sequence frame map and the target color lookup map in the color lookup map as the sequence frame set and storing the result, the above method also includes:

[0106] Obtain the grayscale image of the sequence frame from the target sequence frame texture; for each pixel in the grayscale image, determine the grayscale value of the pixel in the grayscale image as the index value of the pixel; based on the index value of the pixel, find the color value corresponding to the index value from the target color lookup texture, update the grayscale value of the pixel in the grayscale image to the color value corresponding to the index value, and obtain the sequence frame corresponding to the grayscale image.

[0107] The pixels mentioned above typically refer to the smallest image unit in a grayscale image. The grayscale values ​​mentioned above are typically integer values ​​between 0 and 255.

[0108] In actual implementation, the target sequence frame texture includes grayscale images of multiple sequence frames. The required grayscale images of the sequence frames are obtained from this target sequence frame texture. For each pixel in the grayscale image of the sequence frame, the grayscale value of the pixel (an integer between 0 and 255) is determined as the index value of that pixel. Based on the pixel's index value, the color value corresponding to the index value is looked up in the target color lookup map. This can be understood as using the grayscale image as the UV coordinates (a two-dimensional coordinate system where the u and v axes represent the horizontal and vertical axes of the texture in the game engine) of the target color lookup map.

[0109] Import the generated grayscale image and color lookup map into the game engine. This color lookup map can also be called a LUT (Look-up Table) map. It is an image that stores color values ​​and can find the corresponding color value based on the input value. Set the compression format of the grayscale image and color lookup map to uncompressed. In the material editor, use the grayscale image as the UV of the LUT map. By concatenating the sampled result of the LUT map with the self-illumination or base color, you can get the inverse solution effect, that is, obtain the original sequence frame.

[0110] In actual implementation, the index value is normalized so that both the grayscale value and the index value are between 0 and 1. For example, such as... Figure 8 As shown, the grayscale value at the first position of the grayscale image in the sequence frame is 0.05, the grayscale value at the second position is 0.56, and the grayscale value at the third position is 0.98. The sampled color corresponding to each position in the LUT texture is the color value at the position pointed to by the corresponding arrow. The color value at the position pointed to by the first arrow is the color value at the first position of the sequence frame; the color value at the position pointed to by the second arrow is the color value at the second position of the sequence frame; and the color value at the position pointed to by the third arrow is the color value at the third position of the sequence frame.

[0111] For the above method embodiments, see Figure 9 A storage device for a sequence of frames is shown, the device comprising:

[0112] The sequence frame set acquisition module 91 is used to acquire a sequence frame set; wherein, the sequence frame set includes multiple sequence frames;

[0113] The index value determination module 92 is used to determine the index value corresponding to the color value for each sequence frame based on the color value of the sequence frame.

[0114] The grayscale image generation module 93 is used to generate grayscale images of the sequence frames based on the index values ​​corresponding to the color values; the grayscale image indicates the index values ​​corresponding to the color values ​​in the sequence frames.

[0115] The color lookup map determination module 94 is used to determine the color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value;

[0116] The grayscale image storage module 95 is used to store the grayscale image of each sequence frame into the respective image position of each channel of the sequence frame image according to the playback order of the sequence frames, so as to obtain the target sequence frame image.

[0117] The storage result determination module 96 is used to determine the target color lookup map in the target sequence frame map and the target color lookup map in the color lookup map as the storage result of the sequence frame set.

[0118] The aforementioned sequence frame storage device acquires a sequence frame set, wherein the sequence frame set includes multiple sequence frames; for each sequence frame, it determines the index value corresponding to the color value based on the color value of the sequence frame; it generates a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicates the index value corresponding to the color value in the sequence frame; it determines a color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value; according to the playback order of the sequence frames, it stores the grayscale image of each sequence frame into the respective map position of each channel of the sequence frame map to obtain the target sequence frame map; the target sequence frame map and the target color lookup map in the color lookup map are determined as the storage result of the sequence frame set. In this method, the grayscale image generated by the index value corresponding to the color value of the sequence frame only occupies one color channel, so that each channel of the sequence frame texture can store the grayscale image of the sequence frame, which can store more grayscale images, improve the utilization rate of the sequence frame texture, and reduce the space occupied by the sequence frame texture in the game package; in addition, by looking up the texture by the color of the sequence frame, the color of each sequence frame can be restored without loss, which improves the running performance of the game.

[0119] The above-mentioned device further includes: a color value storage module, used to: determine the index mode of the sequence frame and the first color lookup table of the sequence frame according to the color value and the index value corresponding to the color value; wherein, the first color lookup table and the index mode are used to store the color value of the sequence frame.

[0120] The aforementioned color value storage module is further configured to: change multiple color channels of the sequence frame to an index channel, update the color values ​​stored in the multiple color channels to the index values ​​corresponding to the color values, and store the index values ​​in the index channel to obtain the index mode of the sequence frame; sort the color values ​​corresponding to the index values ​​according to the size of the index values, and determine the result of the first sorting as the first color lookup table of the sequence frame.

[0121] The aforementioned index value determination module is further configured to: determine the color value of each pixel in the sequence frame; sort the color values ​​according to their magnitude to obtain the sorting order value of the color values; and determine the sorting order value of the color values ​​as the index value corresponding to the color value.

[0122] The grayscale image generation module described above is further configured to: determine a second color lookup table for the sequence frame based on the index value; wherein the index value of each table position in the second color lookup table is the same as the color value of the table position; and generate a grayscale image of the sequence frame using the index pattern of the sequence frame and the second color lookup table of the sequence frame.

[0123] The grayscale image generation module described above is further configured to: sort the index values ​​in a second sorting order according to the size of the index values, and determine the result of the second sorting order as the second color lookup table of the sequence frame.

[0124] The aforementioned color lookup map determination module is further configured to: determine the color lookup map of the sequence frame based on the first color lookup table of the sequence frame.

[0125] The aforementioned color lookup map determination module is further configured to: sort the color values ​​corresponding to the index values ​​in the first color lookup table in a third sort, and determine the result of the third sort as the intermediate color lookup table of the sequence frame; wherein the intermediate color lookup table is a one-dimensional table; convert the intermediate color lookup table into a color lookup map of the sequence frame according to the color values ​​stored in the intermediate color lookup table; wherein the color channels of the color lookup map store the color values, and the color values ​​of the color lookup map gradually increase or decrease in a first direction.

[0126] The grayscale image storage module described above is further configured to: determine the playback order of the sequence frames based on the file name of the sequence frames; and, according to the playback order, store the grayscale image of the sequence frame in each of the channel's texture positions in the sequence frame texture to obtain the target sequence frame texture.

[0127] The aforementioned apparatus further includes: an inverse resolution module, configured to: obtain a grayscale image of the sequence frame from the target sequence frame texture; for each pixel in the grayscale image, determine the grayscale value of the pixel in the grayscale image as the index value of the pixel; based on the index value of the pixel, search for the color value corresponding to the index value in the target color lookup texture, update the grayscale value of the pixel in the grayscale image to the color value corresponding to the index value, and obtain the sequence frame corresponding to the grayscale image.

[0128] The sequence frame storage device provided in this embodiment of the invention has the same technical features as the sequence frame storage method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.

[0129] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for storing sequence frames. This electronic device can be a server or a terminal device.

[0130] See Figure 10As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described method for storing sequence frames. The method includes the following steps:

[0131] Obtain a sequence frame set, which includes multiple sequence frames. For each sequence frame, determine the index value corresponding to the color value. Generate a grayscale image of the sequence frame based on the index value. The grayscale image indicates the index value corresponding to the color value in the sequence frame. Determine the color lookup map of the sequence frame based on the color value and its corresponding index value. The color lookup map is used to determine the color value corresponding to the index value. According to the playback order of the sequence frames, store the grayscale image of each sequence frame into the respective map position of each channel of the sequence frame map to obtain the target sequence frame map. Combine the target sequence frame map and the target color lookup map in the color lookup map to determine the storage result of the sequence frame set. In this method, the grayscale image generated by the index value corresponding to the color value of the sequence frame only occupies one color channel, so that each channel of the sequence frame texture can store the grayscale image of the sequence frame, which can store more grayscale images, improve the utilization rate of the sequence frame texture, and reduce the space occupied by the sequence frame texture in the game package; in addition, by looking up the texture by the color of the sequence frame, the color of each sequence frame can be restored without loss, which improves the running performance of the game.

[0132] Before the step of generating a grayscale image of a sequence frame based on the index value corresponding to the color value, the method further includes: determining the index mode of the sequence frame and the first color lookup table of the sequence frame based on the color value and the index value corresponding to the color value; wherein, the first color lookup table and the index mode are used to store the color values ​​of the sequence frame.

[0133] The steps described above for determining the index mode and the first color lookup table of the sequence frame based on the color value and the corresponding index value include: changing multiple color channels of the sequence frame to one index channel, updating the color values ​​stored in the multiple color channels to the corresponding index values, and storing the index values ​​in the index channel to obtain the index mode of the sequence frame; sorting the color values ​​corresponding to the index values ​​according to the size of the index values, and determining the result of the first sorting as the first color lookup table of the sequence frame.

[0134] The steps described above for determining the index value corresponding to the color value based on the color value of the sequence frame include: determining the color value of each pixel in the sequence frame; sorting the color values ​​according to their magnitude to obtain the sorting order value of the color values; and determining the sorting order value of the color values ​​as the index value corresponding to the color value.

[0135] The steps described above for generating a grayscale image of a sequence frame based on the index value corresponding to the color value include: determining a second color lookup table for the sequence frame based on the index value; wherein the index value of each table position in the second color lookup table is the same as the color value of the table position; and generating the grayscale image of the sequence frame using the index mode and the second color lookup table of the sequence frame. In this method, in index mode, updating the first color lookup table to the second color lookup table generates the grayscale image, and then storing the index value in the grayscale image reduces the number of channels in the sequence frame.

[0136] The steps described above for determining the second color lookup table of the sequence frame based on the index value include: sorting the index values ​​in a second sort according to their size, and determining the result of the second sort as the second color lookup table of the sequence frame.

[0137] The steps described above for determining the color lookup map of a sequence frame based on the color value and the corresponding index value include: determining the color lookup map of the sequence frame based on the first color lookup table of the sequence frame.

[0138] The steps described above for determining the color lookup map of the sequence frame based on the first color lookup table of the sequence frame include: sorting the color values ​​corresponding to the index values ​​in the first color lookup table in a third sort, and determining the result of the third sort as the intermediate color lookup table of the sequence frame; wherein the intermediate color lookup table is a one-dimensional table; and converting the intermediate color lookup table into a color lookup map of the sequence frame based on the color values ​​stored in the intermediate color lookup table; wherein the color channels of the color lookup map store color values, and the color values ​​of the color lookup map gradually increase or decrease in the first direction.

[0139] The steps described above, which involve storing the grayscale image of each sequence frame in its respective channel and location within the sequence frame texture map according to the playback order, to obtain the target sequence frame texture map, include: determining the playback order of the sequence frames based on their file names; and storing the grayscale image of each sequence frame in its respective channel and location within the sequence frame texture map according to the playback order, thus obtaining the target sequence frame texture map. This method, by storing the grayscale image sequentially for each channel according to the playback order, can compress the sequence frame texture map, reduce its size, and enable batch processing of a large number of sequence frame texture maps.

[0140] After the steps described above, which involve determining the target color lookup map from the target sequence frame map and the color lookup map as the result of storing the sequence frame set, the method further includes: obtaining a grayscale image of the sequence frame from the target sequence frame map; for each pixel in the grayscale image, determining the grayscale value of the pixel in the grayscale image as the pixel index value; based on the pixel index value, searching for the color value corresponding to the index value in the target color lookup map, updating the grayscale value of the pixel in the grayscale image to the color value corresponding to the index value, and obtaining the sequence frame corresponding to the grayscale image.

[0141] Furthermore, Figure 10 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0142] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0143] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0144] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for storing sequence frames. The method includes the following steps:

[0145] Obtain a sequence frame set, which includes multiple sequence frames. For each sequence frame, determine the index value corresponding to the color value. Generate a grayscale image of the sequence frame based on the index value. The grayscale image indicates the index value corresponding to the color value in the sequence frame. Determine the color lookup map of the sequence frame based on the color value and its corresponding index value. The color lookup map is used to determine the color value corresponding to the index value. According to the playback order of the sequence frames, store the grayscale image of each sequence frame into the respective map position of each channel of the sequence frame map to obtain the target sequence frame map. Combine the target sequence frame map and the target color lookup map in the color lookup map to determine the storage result of the sequence frame set. In this method, the grayscale image generated by the index value corresponding to the color value of the sequence frame only occupies one color channel, so that each channel of the sequence frame texture can store the grayscale image of the sequence frame, which can store more grayscale images, improve the utilization rate of the sequence frame texture, and reduce the space occupied by the sequence frame texture in the game package; in addition, by looking up the texture by the color of the sequence frame, the color of each sequence frame can be restored without loss, which improves the running performance of the game.

[0146] Before the step of generating a grayscale image of a sequence frame based on the index value corresponding to the color value, the method further includes: determining the index mode of the sequence frame and the first color lookup table of the sequence frame based on the color value and the index value corresponding to the color value; wherein, the first color lookup table and the index mode are used to store the color values ​​of the sequence frame.

[0147] The steps described above for determining the index mode and the first color lookup table of the sequence frame based on the color value and the corresponding index value include: changing multiple color channels of the sequence frame to one index channel, updating the color values ​​stored in the multiple color channels to the corresponding index values, and storing the index values ​​in the index channel to obtain the index mode of the sequence frame; sorting the color values ​​corresponding to the index values ​​according to the size of the index values, and determining the result of the first sorting as the first color lookup table of the sequence frame.

[0148] The steps described above for determining the index value corresponding to the color value based on the color value of the sequence frame include: determining the color value of each pixel in the sequence frame; sorting the color values ​​according to their magnitude to obtain the sorting order value of the color values; and determining the sorting order value of the color values ​​as the index value corresponding to the color value.

[0149] The steps described above for generating a grayscale image of a sequence frame based on the index value corresponding to the color value include: determining a second color lookup table for the sequence frame based on the index value; wherein the index value of each table position in the second color lookup table is the same as the color value of the table position; and generating the grayscale image of the sequence frame using the index mode and the second color lookup table of the sequence frame. In this method, in index mode, updating the first color lookup table to the second color lookup table generates the grayscale image, and then storing the index value in the grayscale image reduces the number of channels in the sequence frame.

[0150] The steps described above for determining the second color lookup table of the sequence frame based on the index value include: sorting the index values ​​in a second sort according to their size, and determining the result of the second sort as the second color lookup table of the sequence frame.

[0151] The steps described above for determining the color lookup map of a sequence frame based on the color value and the corresponding index value include: determining the color lookup map of the sequence frame based on the first color lookup table of the sequence frame.

[0152] The steps described above for determining the color lookup map of the sequence frame based on the first color lookup table of the sequence frame include: sorting the color values ​​corresponding to the index values ​​in the first color lookup table in a third sort, and determining the result of the third sort as the intermediate color lookup table of the sequence frame; wherein the intermediate color lookup table is a one-dimensional table; and converting the intermediate color lookup table into a color lookup map of the sequence frame based on the color values ​​stored in the intermediate color lookup table; wherein the color channels of the color lookup map store color values, and the color values ​​of the color lookup map gradually increase or decrease in the first direction.

[0153] The steps described above, which involve storing the grayscale image of each sequence frame in its respective channel and location within the sequence frame texture map according to the playback order, to obtain the target sequence frame texture map, include: determining the playback order of the sequence frames based on their file names; and storing the grayscale image of each sequence frame in its respective channel and location within the sequence frame texture map according to the playback order, thus obtaining the target sequence frame texture map. This method, by storing the grayscale image sequentially for each channel according to the playback order, can compress the sequence frame texture map, reduce its size, and enable batch processing of a large number of sequence frame texture maps.

[0154] After the steps described above, which involve determining the target color lookup map from the target sequence frame map and the color lookup map as the result of storing the sequence frame set, the method further includes: obtaining a grayscale image of the sequence frame from the target sequence frame map; for each pixel in the grayscale image, determining the grayscale value of the pixel in the grayscale image as the pixel index value; based on the pixel index value, searching for the color value corresponding to the index value in the target color lookup map, updating the grayscale value of the pixel in the grayscale image to the color value corresponding to the index value, and obtaining the sequence frame corresponding to the grayscale image.

[0155] The computer program product of the method, apparatus and electronic device for storing sequence frames provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0156] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0157] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0158] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0159] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0160] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for storing sequence frames, characterized in that, The method includes: Obtain a set of sequence frames; wherein the set of sequence frames includes multiple sequence frames; For each sequence frame, the index value corresponding to the color value is determined based on the color value of the sequence frame; A grayscale image of the sequence frame is generated based on the index value corresponding to the color value; the grayscale image indicates the index value corresponding to the color value in the sequence frame. The color lookup map of the sequence frame is determined based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value; According to the playback order of the sequence frames, the grayscale image of each sequence frame is stored in each texture position of each channel of the sequence frame texture to obtain the target sequence frame texture. The target sequence frame texture and the target color lookup texture in the color lookup texture are determined as the storage result of the sequence frame set; The step of storing the grayscale image of each sequence frame into the respective texture position of each channel of the sequence frame texture according to the playback order of the sequence frames, to obtain the target sequence frame texture, includes: The playback order of the sequence frames is determined based on their file names; According to the playback order, for each channel, the grayscale image of the sequence frame is stored sequentially at each texture position of the channel of the sequence frame texture to obtain the target sequence frame texture.

2. The method according to claim 1, characterized in that, Before the step of generating the grayscale image of the sequence frame based on the index value corresponding to the color value, the method further includes: Based on the color value and the corresponding index value, the index pattern of the sequence frame and the first color lookup table of the sequence frame are determined; wherein, the first color lookup table and the index pattern are used to store the color value of the sequence frame.

3. The method according to claim 2, characterized in that, The step of determining the index pattern of the sequence frame and the first color lookup table of the sequence frame based on the color value and the corresponding index value includes: The multiple color channels of the sequence frame are changed to one index channel, the color values ​​stored in the multiple color channels are updated to the index values ​​corresponding to the color values, and the index values ​​are stored in the index channel to obtain the index mode of the sequence frame; According to the size of the index value, the color values ​​corresponding to the index value are sorted in the first sort, and the result of the first sort is determined as the first color lookup table of the sequence frame.

4. The method according to claim 1, characterized in that, The step of determining the index value corresponding to the color value based on the color value of the sequence frame includes: Determine the color value of each pixel in the sequence frame, and sort the color values ​​according to their magnitude to obtain the sorting order value of the color values; The order of the color values ​​is determined as the index value corresponding to the color value.

5. The method according to claim 2, characterized in that, The step of generating a grayscale image of the sequence frame based on the index value corresponding to the color value includes: A second color lookup table for the sequence frame is determined based on the index value; wherein the index value of each table position in the second color lookup table is the same as the color value of the table position. A grayscale image of the sequence frame is generated using the index pattern of the sequence frame and the second color lookup table of the sequence frame.

6. The method according to claim 5, characterized in that, The step of determining the second color lookup table for the sequence frame based on the index value includes: The index values ​​are sorted a second time according to their size, and the result of the second sorting is determined as the second color lookup table for the sequence frame.

7. The method according to claim 1, characterized in that, The step of determining the color lookup map of the sequence frame based on the color value and the index value corresponding to the color value includes: The color lookup map of the sequence frame is determined based on the first color lookup table of the sequence frame.

8. The method according to claim 7, characterized in that, The step of determining the color lookup map of the sequence frame according to the first color lookup table of the sequence frame includes: Based on the size of the index value in the first color lookup table, the color values ​​corresponding to the index values ​​are sorted in a third order, and the result of the third sort is determined as the intermediate color lookup table of the sequence frame; wherein, the intermediate color lookup table is a one-dimensional table; Based on the color values ​​stored in the intermediate color lookup table, the intermediate color lookup table is converted into a color lookup map of the sequence frame; wherein, the color channels of the color lookup map store the color values, and the color values ​​of the color lookup map gradually increase or decrease in a first direction.

9. The method according to claim 1, characterized in that, After determining the target sequence frame texture and the target color lookup texture in the color lookup texture as the result of storing the sequence frame set, the method further includes: Obtain the grayscale image of the sequence frame from the target sequence frame texture; For each pixel in the grayscale image, the grayscale value of the pixel in the grayscale image is determined as the index value of the pixel; Based on the index value of the pixel, the color value corresponding to the index value is found in the target color lookup map, and the gray value of the pixel in the grayscale map is updated to the color value corresponding to the index value to obtain the sequence frame corresponding to the grayscale map.

10. A storage device for sequence frames, characterized in that, The device includes: A sequence frame set acquisition module is used to acquire a sequence frame set; wherein, the sequence frame set includes multiple sequence frames; An index value determination module is used to determine, for each sequence frame, the index value corresponding to the color value based on the color value of the sequence frame; A grayscale image generation module is used to generate a grayscale image of the sequence frame based on the index value corresponding to the color value; the grayscale image indicates the index value corresponding to the color value in the sequence frame; The color lookup map determination module is used to determine the color lookup map of the sequence frame based on the color value and the index value corresponding to the color value; the color lookup map is used to: determine the color value corresponding to the index value based on the index value; The grayscale image storage module is used to store the grayscale image of each sequence frame into the respective image position of each channel of the sequence frame image according to the playback order of the sequence frames, so as to obtain the target sequence frame image. The storage result determination module is used to determine the target color lookup map in the target sequence frame map and the color lookup map as the storage result of the sequence frame set; The grayscale image storage module is further configured to determine the playback order of the sequence frames based on the file name of the sequence frames; and according to the playback order, for each channel, to sequentially store the grayscale image of the sequence frame at each texture position of the channel of the sequence frame texture to obtain the target sequence frame texture.

11. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the method for storing sequence frames according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for storing sequence frames as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Liquid crystal instrument sequence frame animation performance optimization method and liquid crystal instrument

    CN112991412A

  • Image Processing Device

    US20110044542A1