Animation generation method and device, electronic equipment and computer readable storage medium

The animation generation method simplifies and enhances the production process by using pixel blending to generate animations with gradient effects, addressing inefficiencies in current manual frame editing methods.

CN119068087APending Publication Date: 2024-12-03TCL COMM TECH (CHENGDU) LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411120064.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Current animation production methods are inefficient and complex due to the manual editing of multiple image frames, leading to high CPU/GPU usage and increased power consumption.

Method used

An animation generation method that involves obtaining a first image and target description information to perform pixel blending processing, generating frame images, and creating a target animation using pixel blending to simplify and enhance the production process.

Benefits of technology

Reduces the complexity of animation production and improves efficiency by replacing manual editing with pixel blending, allowing for rapid generation of animations with gradient effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068087A_ABST
    Figure CN119068087A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an animation generation method and device, electronic equipment and a computer readable storage medium. The method comprises the steps that a first to-be-processed image and target description information used for controlling the animation gradient effect are acquired; pixel mixing processing is carried out on the first to-be-processed image according to the target description information to obtain one or more frame images, and the one or more frame images are used for generating a target animation corresponding to the first to-be-processed image. The target description information used for controlling the animation gradual change effect is used for carrying out pixel mixing processing on the first to-be-processed image, and the animation with the gradual change effect is rapidly generated in a pixel mixing mode. And a mode of manually editing and manufacturing a plurality of frame images in related technologies is replaced by a mode of pixel mixing, so that the animation manufacturing complexity is reduced, and the animation manufacturing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing, and specifically to an animation generation method, device, electronic device, and computer-readable storage medium. Background Art

[0002] Animation effects are very common in mobile phones and other devices. Animation is usually very expensive, with high CPU / GPU usage, which will also cause increased power consumption.

[0003] Currently, the most commonly used method for animation production is image sequence frames, that is, the animation is directly made into images one by one, and the playback order of each image is configured.

[0004] However, currently, each image in an image sequence frame is usually obtained by copying the first frame of an animation and manually editing the image to adjust the content displayed by the image, which makes animation production complicated and inefficient. Summary of the invention

[0005] The embodiments of the present application provide an animation generation method, device, electronic device and computer-readable storage medium, which can simplify the production of animation and improve the efficiency of animation production.

[0006] In a first aspect, an embodiment of the present application provides an animation generation method, the method comprising:

[0007] Obtaining a first image to be processed and target description information for controlling an animation gradient effect;

[0008] The first image to be processed is subjected to pixel blending processing according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate a target animation corresponding to the first image to be processed.

[0009] In a second aspect, an embodiment of the present application further provides an animation generating device, the device comprising:

[0010] An acquisition module, used to acquire a first image to be processed and target description information for controlling an animation gradient effect;

[0011] A generation module is used to perform pixel blending processing on the first image to be processed according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate a target animation corresponding to the first image to be processed.

[0012] Optionally, in some embodiments of the present application, the target description information includes a target frame sequence, the target frame sequence includes N frame description images, each of the frame description images includes first mixing ratio information for performing pixel mixing processing on the first image to be processed, N is an integer greater than 0, and the generating module includes:

[0013] Get the i-th frame description image;

[0014] According to the first mixing ratio information contained in the i-th frame description image, perform pixel mixing processing on the first image to be processed to obtain an i-th frame image, where the i-th frame image belongs to the one or more frame images, and i is an integer greater than 0 and less than or equal to N;

[0015] Determining whether at least one of the first images to be processed is updated;

[0016] If yes, then obtain the updated second image to be processed and the (i+1)th frame description image;

[0017] According to the first mixing ratio information contained in the i+1th frame description image, pixel mixing processing is performed on the second image to be processed to obtain the i+1th frame image, and the i+1th frame image belongs to the one or more frame images.

[0018] In some embodiments of the present application, the target description information includes a target description image, and the generation module includes:

[0019] An extraction unit, used to extract pixel mixing parameter information from the target description image, wherein the pixel mixing parameter information corresponds to the value of the pixel in the target description image;

[0020] A first determining unit, configured to determine a frame image depth offset based on a preset display depth and a preset number of frame images, and obtain a frame image depth of each frame image based on the preset display depth and the frame image depth offset;

[0021] A second determining unit, configured to determine, for each frame image depth, second mixing ratio information based on the frame image depth and the pixel mixing parameter information;

[0022] The mixing unit is used to perform pixel mixing processing on the first image to be processed according to the second mixing ratio information corresponding to the depth of each frame image, so as to obtain the one or more frame images.

[0023] In some embodiments of the present application, the device further includes a first configuration module, and the first configuration module includes:

[0024] An acquisition unit, used for acquiring a target frame sequence, wherein the target frame sequence includes at least one frame description image for describing a degree of image gradient;

[0025] A third determining unit is used to determine target pixel position information and pixel value information corresponding to each frame description image based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image;

[0026] A generating unit, used for generating a target description image according to target pixel position information and pixel value information of each frame description image;

[0027] The pixel value information of each pixel point in the target description image is used as pixel mixing parameter information.

[0028] In some embodiments of the present application, the third determining unit includes:

[0029] An extraction subunit, configured to extract frame description images in sequence based on the order of the frame description images in the target frame sequence;

[0030] A first determining subunit is used to use the position information of the target description pixel point whose first mixing ratio information in the frame description image meets the preset condition as the candidate pixel position information;

[0031] A filtering subunit, configured to filter out repeated candidate pixel position information that is the same as the image described in the previous frame from the candidate pixel position information, to obtain target pixel position information;

[0032] The second determining subunit is used to determine the pixel value information of the target pixel position information according to the preset value information and the order of the frame description images in the target frame sequence.

[0033] In some embodiments of the present application, the second determining subunit is specifically used for:

[0034] Determining a value offset according to the order of the frame description images in the target frame sequence;

[0035] The pixel value information of the target pixel position information is obtained according to the preset value information and the value offset.

[0036] In some embodiments of the present application, the generating unit includes:

[0037] The first generating subunit is used to perform image generation processing based on each target pixel position information and pixel value information of each target pixel position information to obtain a target description image.

[0038] In some embodiments of the present application, the device further includes a screening unit, and the screening unit includes:

[0039] A response subunit, configured to select and obtain a reference animation in response to an animation selection operation, wherein the reference animation includes a first frame image, a last frame image, and one or more intermediate frame images, and the animation gradient effect of the reference animation is consistent with that of the target animation;

[0040] A second generating subunit is used to obtain a frame description image corresponding to each intermediate frame image according to the first frame image, the last frame image and each intermediate frame image;

[0041] The third generating subunit is used to obtain a target frame sequence according to the order of the intermediate frame images and the frame description image.

[0042] In some embodiments of the present application, the second generating subunit is specifically used for:

[0043] For each intermediate frame image, first mixing ratio information is obtained according to a first pixel value of the intermediate frame image, a second pixel value of the first frame image, and a third pixel value of the last frame image, wherein the first mixing ratio information includes a pixel mixing ratio corresponding to each pixel point of the intermediate frame image;

[0044] A frame description image corresponding to the intermediate frame image is obtained according to the first mixing ratio information.

[0045] In some embodiments of the present application, the device further includes a second configuration module, and the second configuration module includes:

[0046] An image determining unit, used to determine a target image of an animation gradient direction from the first image to be processed;

[0047] A grayscale extraction unit, used to extract the grayscale value of each pixel in the brightness channel from the target image to obtain reference brightness information;

[0048] An image generating unit is used to generate a target description image based on the reference brightness information, wherein the reference brightness information in the target description image is used as pixel mixing parameter information.

[0049] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned animation generation method when executed by the processor.

[0050] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned animation generation method are implemented.

[0051] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.

[0052] In summary, the embodiment of the present application obtains a first image to be processed and target description information for controlling the gradient effect of an animation, and performs pixel blending processing on the image to be processed according to the target description information to obtain one or more frame images, and generates a target animation corresponding to the first image to be processed based on the one or more frame images. Among them, by performing pixel blending processing on the first image to be processed through the target description information for controlling the gradient effect of an animation, it is possible to quickly generate an animation with a gradient effect by means of pixel blending. By replacing the manual editing and production method of multiple frame images in the related art with the pixel blending method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new animation with a gradient effect can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 is a schematic diagram of a scenario in which a terminal device according to an embodiment of the present application executes the animation generation method;

[0055] Figure 2 is a flowchart of an animation generation method provided in an embodiment of the present application;

[0056] Figure 3 is a guide map for generating a frame image provided by an embodiment of the present application;

[0057] Figure 4 is a flow chart of a second animation generation method provided in an embodiment of the present application;

[0058] Figure 5 This is a first schematic diagram of a frame image obtained by pixel blending processing provided in an embodiment of the present application;

[0059] Figure 6 is a flowchart of a third animation generation method provided in an embodiment of the present application;

[0060] Figure 7 is a side view of an uneven ground surface and a water level provided in an embodiment of the present application;

[0061] Figure 8 This is a second schematic diagram of a frame image obtained by pixel blending processing provided in an embodiment of the present application;

[0062] Fig. 9 It is a schematic diagram of generating a single target description image from multiple frame description images provided in an embodiment of the present application;

[0063] Fig.10 It is an animated gradient effect diagram provided in an embodiment of the present application;

[0064] Fig.11 It is a schematic diagram of pixel value information for generating a target description image provided by an embodiment of the present application;

[0065] Fig.12 is a schematic diagram of generating a target description image based on a target frame sequence provided by an embodiment of the present application;

[0066] Fig.13 is a structural schematic diagram of an animation generating device provided in an embodiment of the present application;

[0067] Fig.14 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0069] The embodiments of the present application provide an animation generation method, device, electronic device and computer-readable storage medium. Specifically, the embodiments of the present application provide an animation generation device suitable for electronic devices, the electronic devices include terminal devices or servers, the terminal devices include but are not limited to mobile phones, tablet computers, laptop computers or televisions, etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, etc. The server can be directly or indirectly connected via wired or wireless communication.

[0070] Specifically, the animation generation method of the embodiment of the present application can be executed by the terminal device alone, or by the server alone, or by the terminal device and the server together. Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a terminal device according to an embodiment of the present application executes the animation generation method, wherein the specific execution process of the terminal device executing the animation generation method is as follows:

[0071] The terminal device 10 receives interface input to obtain a first image to be processed, and obtains target description information for controlling an animation gradient effect in response to a gradient effect selection operation. Then, in response to a trigger operation such as a button, the target animation is generated based on the first image to be processed and the target description information. Specifically: pixel mixing processing is performed on the first image to be processed according to the target description information to obtain one or more frame images, and a target animation is generated through the image to be processed and the frame images.

[0072] It is understandable that the embodiment of the present application uses the target description information for controlling the animation gradient effect to perform pixel blending processing on the first image to be processed, thereby realizing the rapid generation of a gradient effect animation by pixel blending. By replacing the manual editing and production method of multiple frame images in the related art with the pixel blending method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new gradient effect animation can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects.

[0073] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0074] See also Figure 2 , Figure 2 The flowchart of the first animation generation method provided in the embodiment of the present application is shown in the flowchart. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying drawings. Specifically, the specific process of the animation generation method is as follows:

[0075] 201. Obtain a first image to be processed and target description information for controlling an animation gradient effect.

[0076] The animation is realized by playing the respective frame images contained in the corresponding image sequence frames in chronological order. The respective frame images in the image sequence frames are the main elements or main contents constituting the animation. In an embodiment of the present application, the first image to be processed is also the main element or main content constituting the animation, and the first image to be processed includes one or more images to be processed to which a gradient effect needs to be added. In an optional embodiment, the first image to be processed may include the first frame image constituting the animation, may include the last frame image constituting the animation, and may also include other intermediate frame images constituting the animation. Among them, the first frame image is sometimes also referred to as a foreground image, and the last frame image is sometimes also referred to as a background image.

[0077] The first image to be processed can be obtained by user input or in response to a search instruction, and can be obtained locally or from a server. For example, when a user wants to generate an animation containing a specific scene content, the first image to be processed containing the specific scene content can be selected, so as to generate an animation that meets the specific scene content requirements through the first image to be processed.

[0078] The animation gradient effect specifically refers to a content display effect in which specific screen content is gradually displayed according to a preset display method. For example, taking the first image to be processed as an example, which includes a foreground image and a background image, the animation gradient effect may refer to a display effect in which the foreground image gradually fades toward the background image, that is, the content of the foreground image gradually fades, and the content of the background image gradually emerges. The animation gradient effect in the embodiment of the present application also includes a variety of effects. For example, in the process of the foreground image gradually fading to the background image, different areas have the same or different gradient speeds, or gradients are performed according to specific graphics, such as gradient display according to a diamond, rectangle or circle.

[0079] In an embodiment of the present application, for an animation with a gradient effect, the individual frame images that make up the animation can be obtained by continuously superimposing the content of the background image on the foreground image (i.e., continuously increasing the mixing ratio of the background image). Then, by controlling the playback order of each frame image, the changing trend of the increasing content of the background image is presented, thereby achieving a gradient effect in which the background content is gradually displayed. Therefore, in an embodiment of the present application, the target description information for a certain animation gradient effect can describe the animation gradient effect, and records information that can directly or indirectly indicate the superposition ratio of the foreground image and the background image in each frame image that forms the animation. Based on the control of the target description information, an animation with a corresponding animation gradient effect can be generated using the first image to be processed.

[0080] The target description information can be pre-configured and then selected by the user when the animation needs to be generated. Alternatively, the target description information can also be obtained by extracting a previous animation with the same gradient effect. For example, based on the previous animation, the target description information of the previous animation is extracted through a control such as "shoot the same style" and the target animation is generated based on the target description information.

[0081] 202. Perform pixel blending processing on the image to be processed according to the target description information to obtain one or more frame images, where the one or more frame images are used to generate a target animation corresponding to the first image to be processed.

[0082] In an embodiment of the present application, after obtaining the first image to be processed and the target description information for controlling the animation gradient effect, the image to be processed is subjected to pixel blending processing based on the control of the target description information. Pixel blending processing refers to the fusion of pixel values ​​in the image to be processed. For example, taking the first image to be processed as an example, including a foreground image and a background image, the values ​​of the pixels in the foreground image and the values ​​of the pixels in the background image are fused in a certain ratio to obtain new pixel values. After the pixels at corresponding positions in the foreground image and the background image are fused, one or more frame images with new pixel values ​​are obtained, and the image size of the image to be processed and the frame image are the same.

[0083] For example, for the second frame image or the first few frames of the target animation to be generated, the mixing ratio of the background image can be set to be smaller, while for the 10th frame image of the target animation to be generated, or the 20th frame and other later frame images, the corresponding mixing ratio can be continuously increased, that is, according to the order of the frame images in the animation, the proportion of the background image content in the final mixed frame image is continuously increased, so as to achieve the effect of increasing the content of the background image during the animation playback and gradually displaying the background image.

[0084] For example, see Figure 3 As shown, Figure 3 It is a guide map for generating frame images provided by an embodiment of the present application. Taking the pixel blending processing of the foreground image and the background image based on the target description information as an example, specifically, the foreground image F and the background image B, based on the target description information D, are subjected to the pixel blending processing of the image processor (gpu) to obtain multiple frame images (i.e., the blended images 1-n).

[0085] It is understandable that in the embodiment of the present application, after each frame image is obtained, each frame image can be used as an intermediate frame image, and the target animation can be obtained by sequentially playing the image to be processed and each frame image.

[0086] In summary, the embodiment of the present application uses the target description information for controlling the animation gradient effect to perform pixel blending processing on the first image to be processed, thereby realizing the rapid generation of a gradient effect animation by pixel blending. By replacing the manual editing and production method of multiple frame images in the related art with the pixel blending method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new gradient effect animation can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects.

[0087] It should be noted that, in the embodiment of the present application, the target description information for indicating the animation gradient effect can be presented and utilized in a variety of different forms of information. Figure 2 In the embodiment, the target description information is presented in the form of a target frame sequence, such as Figure 4 As shown, the present application also provides a flow chart of a second animation generation method.

[0088] See also Figure 4 , a flow chart of a second animation generation method provided in an embodiment of the present application, including the contents of steps 401-406.

[0089] 401. Obtain a first image to be processed and target description information for controlling an animation gradient effect.

[0090] Among them, the first image to be processed includes a foreground image and a background image, the target description information includes a target frame sequence, the target frame sequence includes N frame description images, each frame description image contains first mixing ratio information for pixel mixing processing of the first image to be processed, and N is an integer greater than 0.

[0091] Among them, some of the contents in the embodiments of this application can be referred to Figure 2 Step 201 is understood.

[0092] The first image to be processed includes a foreground image and a background image. In the process of generating the target animation, the foreground image and the background image are first obtained. For example, the foreground image and the background image each contain image contents corresponding to 3*3 pixels. Figure 5 As shown, Figure 5 (a) is the foreground image, which contains the image content corresponding to 9 pixels F1-F9. Figure 5 (b) is the background image, which contains the image content corresponding to 9 pixels B1-B9.

[0093] It should be noted that the target description information in the embodiment of the present application includes a target frame sequence, and the target frame sequence includes N frame description images, each of which records the first mixing ratio information of a frame image. Figure 5(c) shows the i-th frame description image among N frame description images, where i is an integer greater than 0 and less than or equal to N. The first mixing ratio information of the i-th frame description image records the pixel mixing ratio of the foreground image and the background image when they are mixed. The pixel mixing ratio can be recorded or represented by the value of each pixel in the frame description image. Each pixel in the frame description image corresponds to a pixel mixing ratio. Figure 5 As shown in (c), the first mixing ratio information recorded in the i-th frame description image is: the first pixel D i,1 The pixel blending ratio is 10%, and the second pixel D i,2 The pixel mixing ratio is 10%, D i,3 The pixel mixing ratio is 15%, D i,4 The pixel mixing ratio is 20%, D i,5 The pixel mixing ratio is 20%, D i,6 The pixel mixing ratio is 20%, D i,7 The pixel mixing ratio is 15%, D i,8 The pixel mixing ratio is 10%, D i,9 The pixel mixing ratio is 10%. The pixel mixing ratio is used to indicate the mixing ratio of two corresponding pixels in the foreground image and the background image, that is, each first pixel mixing ratio information includes the pixel mixing ratio of multiple pixels. i,1 The pixel mixing ratio of F1 and B1 is 10%, D i,2 The pixel mixing ratio of F2 and B2 is 10%, D i,3 The pixel mixing ratio of F3 and B3 is 15%, D i,4 The pixel mixing ratio of F4 and B4 is 20%, D i,5 The pixel blending ratio of F5 and B5 is 20%, D i,6 The pixel mixing ratio of F6 and B6 is 20%, D i,7 The pixel mixing ratio of F7 and B7 is 15%, D i,8 The pixel mixing ratio of F8 and B8 is 10%, D i,9 The pixel mixing ratio of F9 and B9 is 10%. Among them, the first mixing ratio information recorded in at least two frame description images in the plurality of frame description images is different. For example, the first mixing ratio information recorded in the i+1th frame description image is: the first pixel D i+1,1 The pixel blending ratio is 10%, and the second pixel D i+1,2 The pixel mixing ratio is 15%, D i+1,3 The pixel blending ratio is 20%... i+1,7 The pixel mixing ratio is 15%, D i+1,8The pixel mixing ratio is 15%, D i+1,9 The pixel blending ratio is 10%.

[0094] Step 402: Obtain the i-th frame description image.

[0095] In the embodiment of the present application, after obtaining the first image to be processed and the target description information, when the i-th frame image is to be generated, the i-th frame description image needs to be obtained from the target description information. Similarly, when the i+1-th frame image is to be generated, the i+1-th frame description image needs to be obtained from the target description information.

[0096] Step 403: Perform pixel mixing processing on the first image to be processed according to the first mixing ratio information contained in the i-th frame description image to obtain the i-th frame image, where the i-th frame image belongs to the one or more frame images, and i is an integer greater than 0 and less than or equal to N.

[0097] Among them, in the embodiment of the present application, the pixel mixing ratio in the first mixing ratio information can represent the mixing ratio of pixels in the foreground image, and can also represent the mixing ratio of pixels in the background image. For example, the embodiment of the present application takes the pixel mixing ratio representing the mixing ratio of pixels in the foreground image as an example for explanation. That is, the pixel mixing ratio represents the mixing ratio of pixels in the foreground image when the pixels in the foreground image and the background image are mixed.

[0098] Correspondingly, each pixel point in the foreground image and the background image is mixed according to its corresponding pixel mixing ratio to obtain each pixel point used to form the frame image, and the combination of each pixel point obtains the frame image. j and pixel B of the background image j Describe the pixel D of the image based on the i-th frame i,j Mix to get the final pixel point T of the i-th frame image i,j The calculation can refer to the following formula:

[0099] T i,j =F j *D i,j +B j (1-D i,j ).

[0100] Where i is an integer greater than 0 and less than or equal to N, j is an integer greater than 0 and less than or equal to M, and M is the number of pixels contained in the foreground image or the background image. Where subscript i refers to the image, and subscript j refers to the pixel. For example, when i is 1 and j is 2, then T i,j =T 1,2 , which represents the second pixel of the first frame image.

[0101] That is, the pixel F in the foreground image and the pixel B in the background image are mixed based on the i-th frame description image to obtain the i-th frame image. Figure 5 As shown in (c), when j = 1, the first pixel D i,1 The pixel mixing ratio is 10%, then the first pixel point T of the corresponding i-th frame image i,1 =F1*10%+B1*(1-10%), where pixel F1 is the first pixel D i,1 Corresponding to the pixel in the foreground image, pixel B1 is the first pixel D i,1 Corresponding to the pixel points in the background image, (1-10%) is the pixel mixing ratio of pixel point B1 when pixel point F1 and pixel point B1 are mixed. Similarly, the pixel points T used to form the i-th frame image are obtained. i,2 -T i,9 Correspondingly, each pixel T i,1 -T i,9 Then the i-th frame image is obtained by combination.

[0102] Step 404: Determine whether at least one of the first images to be processed is updated.

[0103] Among them, at least one of the first images to be processed includes a foreground image or a background image.

[0104] Among them, in order to improve the diversity of image content and enhance the animation effect, when generating a frame image, the foreground image and background image based on which the frame image is generated can also be updated and transformed. For example, for the second frame image, the foreground image and the updated background image can be mixed and generated according to the second frame description image. Therefore, in an embodiment of the present application, before generating the next frame image, it can be determined whether the foreground image and the background image are updated and transformed, that is, it can be determined whether the first image to be processed is updated and transformed, so as to perform mixed generation processing based on the first image to be processed after the update and transformation.

[0105] Step 405: If yes, obtain the updated second image to be processed and the (i+1)th frame description image.

[0106] The second image to be processed includes an updated foreground image and a non-updated background image, or a non-updated foreground image and an updated background image, or an updated foreground image and an updated background image.

[0107] Step 406: Perform pixel mixing processing on the second image to be processed according to the first mixing ratio information contained in the i+1th frame description image to obtain the i+1th frame image, and the i+1th frame image belongs to the one or more frame images.

[0108] That is, the pixel mixing process of the second image to be processed is performed according to each pixel mixing ratio in the first mixing ratio information corresponding to the next frame description image to generate the next frame image. For example, when i=1, the second frame image is obtained by mixing and generating the second image to be processed according to the second frame description image, wherein the process of generating the frame image according to the pixel mixing ratio is the same as above and will not be repeated here.

[0109] Optionally, if each of the first images to be processed in step 404 is not updated, the (i+1)th frame image is generated according to the first image to be processed and the (i+1)th frame description image.

[0110] Specifically, in the embodiment of the present application, the principle of generating the i+1th frame image based on the second image to be processed or the first image to be processed and the i+1th frame description image can be understood by referring to the principle of generating the i-th frame image based on the i-th frame description image in step 403, which will not be elaborated here.

[0111] To summarize, the target description information is described in the form of a target frame sequence, so that each frame description image is used to respectively record or indicate the first mixing ratio information corresponding to each frame image. For the generation of each frame image, it is only necessary to read the corresponding frame description image from the target frame sequence, and the first mixing ratio information recorded in the frame description image can be used to achieve rapid generation of frame images, thereby improving image generation efficiency.

[0112] Among them, Figure 4 In the animation generation process of the embodiment, it is necessary to rely on multiple frame description images, so that each frame image mixed generation needs to read another frame description image. Figure 2 In the embodiment, the target description information is presented in the form of a target description image, such as Figure 6 As shown, the present application also provides a flowchart of a third animation generation method.

[0113] Figure 6 A flowchart of the third animation generation method is provided, including:

[0114] 601. Obtain a first image to be processed and target description information for controlling an animation gradient effect;

[0115] The first image to be processed includes a foreground image and a background image, the target description information includes a target description image, each pixel point in the target description image corresponds to a pixel mixing parameter information, and the mixing processing of the first image to be processed is controlled based on the pixel mixing parameter.

[0116] Specifically, each pixel mixing parameter information corresponds to a numerical value, and the numerical values ​​corresponding to each pixel point in the target description image may be the same or different.

[0117] In order to more clearly explain the target description image and pixel mixing parameters in the embodiment of the present application, the following will be explained from the relationship between the ground and the water surface (corresponding to a water level), see Figure 7 As shown, Figure 7 It is a side view of uneven ground and water level provided by an embodiment of the present application, including water level A and ground C, wherein the water surface is regarded as the foreground image and the ground is regarded as the background image. If the water surface is higher than all the ground, the foreground image can be seen at this time, and because the water has a certain degree of transparency, a part of the underwater background image can also be seen (it can be understood that the higher the ground is under the water surface, the clearer it is), and this part of the background image that can be seen is the result of the mixture of the foreground image and the background image. As the water level drops, the clarity of the underwater part will gradually increase, that is, during the mixture, the proportion of the background image will increase. When the water level drops to the lowest, only the second image can be seen, and there is no content of the first image at all.

[0118] Therefore, whether you can see the ground clearly is related to the water level. To be more precise, whether you can see the ground clearly is related to the distance between the ground and the water surface. When the distance is larger, it is more difficult to see the ground through the water surface. When the distance is smaller, it is easier to see the ground through the water surface.

[0119] Furthermore, it should be understood that each time the water level drops, a ground image through the water surface will be generated accordingly based on the effect of the water surface, that is, the ground with different clarity can be seen through the water surface at different water levels. Therefore, the embodiment of the present application expects to represent the ground through a target description image, that is, the value of each pixel in the target description image (corresponding to the pixel mixing parameter information of the pixel) corresponds to the height of each point on the ground (that is, the target description image forms a three-dimensional model based on the value of each pixel point), and then, the distance between the ground and the water surface is represented by the difference between the water level and the value of each pixel mixing parameter in the target description image.

[0120] 602. When generating the i-th frame image, extract pixel mixing parameter information from the target description image, where the pixel mixing parameter information corresponds to the value of the pixel in the target description image;

[0121] In the embodiment of the present application, after obtaining the first image to be processed and the target description information, when the first frame image is to be generated, the target description image corresponding to the target description information is obtained, and the target description image is used to perform pixel blending processing. The special feature is that when the second, third, ... frame images are to be generated, it is only necessary to still use the previously obtained target description image for pixel blending processing, without the need to re-acquire a new target description image.

[0122] 603. Determine a frame image depth offset based on a preset display depth and a preset number of frame images, and obtain a frame image depth of an i-th frame image based on the preset display depth and the frame image depth offset;

[0123] The preset display depth is the height of the initial water level, and the frame image depth offset reflects the amplitude of the water level drop, that is, the height of the water surface drop each time. The frame image depth information of each frame image can be calculated based on the order of the frame images, the preset display depth and the frame image depth offset.

[0124] That is, the frame image depth h of the i-th frame image i It is expressed as:

[0125] h i =Lk*i.

[0126] Among them, h i is the frame image depth of the i-th frame image, where the frame image depth h corresponding to each pixel point j in the i-th frame image i,j is the frame image depth h of the i-th frame image i L is the preset display depth, k is the frame image depth offset, and i also represents the order of the frame images.

[0127] For example, the preset display depth is 100, the preset number of frame images is 100, and the frame image depth offset is 1. For the 5th frame image, the frame image depth of the 5th frame image = preset display depth - frame image depth offset * frame image order = 100-1*5=95. For the 20th frame image, the frame image depth of the 20th frame image = 100-1*20=80.

[0128] For example, when the preset display depth is 200 and the preset number of frame images is 100, the frame image depth offset is 200 / 100=2. For the 5th frame image, the 5th frame image depth = preset display depth - frame image depth offset * frame image order = 200-2*5=190. For the 10th frame image, the frame image depth of the 10th frame image = 200-2*10=180. For the 20th frame image, the frame image depth of the 20th frame image = 200-2*20=160.

[0129] For example, when the preset display depth is 500 and the preset number of frame images is 200, the frame image depth offset is 500 / 200=2.5. For the 5th frame image, the 5th frame image depth = preset display depth - frame image depth offset * frame image order = 500-2.5*5=487.5. For the 10th frame image, the frame image depth of the 10th frame image = 500-2.5*10=475. For the 20th frame image, the frame image depth of the 20th frame image = 500-2.5*20=450.

[0130] For example, when the preset display depth is 200 and the preset number of frame images is 400, the frame image depth offset is 200 / 400=0.5. For the 5th frame image, the 5th frame image depth = preset display depth - frame image depth offset * frame image order = 200-0.5*5=197.5. For the 10th frame image, the frame image depth of the 10th frame image = 200-0.5*10=195. For the 20th frame image, the frame image depth of the 20th frame image = 200-0.5*20=190.

[0131] 604. Determine second mixing ratio information of the first image to be processed according to the frame image depth of the i-th frame image and the pixel mixing parameter information;

[0132] Among them, the second mixing ratio information includes the pixel mixing ratio of each pixel point in the first image to be processed during the mixing process, and the pixel mixing ratio is obtained by calculating the difference between the frame image depth and the value corresponding to each pixel mixing parameter information, and multiplying the difference with the adjustment coefficient (transparency coefficient).

[0133] For example, for a pixel point T in the i-th frame image, i,j , calculate the difference between the frame image depth and the value corresponding to the pixel blending parameter information corresponding to the pixel point, calculate the product of the difference and the transparency coefficient, and obtain the pixel blending ratio of the pixel point. Similarly, the pixel blending ratio of each pixel point of the i-th frame image is obtained through this calculation, and the pixel blending ratio of each pixel point is combined to obtain the second blending ratio information.

[0134] That is, the pixel mixing ratio d of the jth pixel in the i-th frame image i,j It is expressed as:

[0135] d i,j =(h i,j -a i,j )*AP.

[0136] Among them, d i,jis the pixel mixing ratio of pixel j in the i-th frame image, h i,j is the frame image depth corresponding to pixel j in the i-th frame image, where the frame image depth of each pixel in the i-th frame image is the frame image depth h corresponding to the i-th frame image. i , wherein the frame image depth information of the i-th frame image is obtained by referring to the principle of step 603 above, which will not be repeated here, a i,j is the pixel mixing parameter information corresponding to pixel j in the i-th frame image. AP is used to indicate the calculated transparency. The smaller the AP, the more transparent it is. The AP is usually an empirical value, that is, a predetermined value in each calculation process. i is an integer greater than 0 and less than or equal to N, where N is the number of frame images; j is an integer greater than 0 and less than or equal to M, where M is the number of pixels in the foreground image or background image.

[0137] Among them, since there is only one target description image, a 1,j =a 2,j =... =a i,j =a j .

[0138] In summary, d i,j =(h i,j -a i,j )*AP=(h i -a j )*AP.

[0139] For example, see Figure 8 As shown, the foreground image is the image content of 3*3 pixels (F1-F9), the background image is the image content of 3*3 pixels (B1-B9), and the target description image is the image content corresponding to 3*3 pixels, which are D1-D9 respectively. The values ​​of the pixel mixing parameter information of D1-D9 are a1-a9, which are 1-9. Assuming that the preset display depth (initial water level) is 10 and the frame image depth offset is 1, then the first frame image T 1.1 -T 1.9 The corresponding frame image depth h1 is the preset display depth - frame image depth offset * 1 = 10 - 1 * 1 = 9, so the first frame image T 1.1 -T 1.9 The pixel mixing ratio d 1,1 -d 1,9 They are:

[0140] d 1,1 =(h 1,1 -a 1,1 )*AP=(h1-a1)*AP=(9-1)*AP;

[0141] d 1,2=(h 1,2 -a 1,2 )*AP=(h1-a2)*AP=(9-2)*AP;

[0142] d 1,3 =(h 1,3 -a 1,3 )*AP=(h1-a3)*AP=(9-3)*AP; ...

[0144] d 1,9 =(h 1,9 -a 1,9 )*AP=(h1-a9)*AP=(9-9)*AP.

[0145] Similarly, the second frame image T 2.1 -T 2.9 The frame image depth h = 8, the second frame image T 2.1 -T 2.9 The pixel mixing ratio d 2,1 -d 2,9 They are:

[0146] d 2,1 =(h 2,1 -a 2,1 )*AP=(h2-a1)*AP=(8-1)*AP;

[0147] d 2,2 =(h 2,2 -a 2,2 )*AP=(h2-a2)*AP=(8-2)*AP;

[0148] d 2,3 =(h 2,3 -a 2,3 )*AP=(h2-a3)*AP=(8-3)*AP; ...

[0150] d 2,9 =(h 2,9 -a 2,9 )*AP=(h2-a9)*AP=(8-9)*AP.

[0151] 605. Perform pixel mixing processing on the first image to be processed according to the second mixing ratio information to obtain the i-th frame image;

[0152] like Figure 8 As shown, each pixel mixing ratio in the second mixing ratio information controls the pixel mixing processing of each pixel point in the first image to be processed, such as the pixel point T in the frame image. i,j =Fj *d i,j +B j (1-d i,j ), specifically, taking the second mixing ratio information of the first frame image as an example, the mixing result T of each pixel of the first frame image is 1,1 -T 1,9 They are

[0153] T 1,1 =F1*d 1,1 +B1*(1-d 1,1 );

[0154] T 1,2 =F2*d 1,2 +B2*(1-d 1,2 );

[0155] T 1,3 =F3*d 1,3 +B3*(1-d 1,3 ); ...

[0157] T 1,9 =F9*d 1,9 +B9*(1-d 1,9 ).

[0158] 606. When the (i+1)th frame image is generated, determining whether at least one of the first images to be processed is updated;

[0159] 607. If yes, obtain the updated second image to be processed;

[0160] 608. Extracting pixel mixing parameter information from the target description image;

[0161] 609. Obtain a frame image depth of an (i+1)th frame image based on the preset display depth and the frame image depth offset;

[0162] 610. Determine second mixing ratio information of a second image to be processed according to the frame image depth of the (i+1)th frame image and the pixel mixing parameter information;

[0163] 611. Perform pixel mixing processing on the second image to be processed according to the second mixing ratio information to obtain the (i+1)th frame image.

[0164] For example, the second frame image corresponding to the second image to be processed is generated using the second mixing ratio information of the second frame image.

[0165] Optionally, if each of the first images to be processed in step 606 is not updated, the (i+1)th frame image is generated according to the first image to be processed, the target description image and the frame image depth of the (i+1)th frame image.

[0166] Specifically, in the embodiment of the present application, the principle of generating the i+1th frame image based on the second image to be processed or the first image to be processed, the target description image and the frame image depth of the i+1th frame image can be understood by referring to the principle of generating the i-th frame image based on the target description image and the frame image depth of the i-th frame image in step 605, which is not elaborated here.

[0167] Among them, the embodiment of the present application utilizes the change of the preset display depth, and combines the difference relationship of the mixing parameter information of each pixel in the target description image to dynamically determine the second mixing ratio information corresponding to different frame images, so that the target description information only needs to be obtained once during the generation process of each frame image, that is, only the target description image needs to be obtained once, which reduces the amount of information read during the frame image generation process and reduces system overhead.

[0168] Among them, in the embodiment of the present application, in order to make the frame image or target animation generated based on the target description image consistent with the effect of the frame image or target action generated based on the target frame sequence, the embodiment of the present application can control the generation of the target description image based on each frame description image in the target frame sequence. That is, optionally, in some embodiments of the present application, before the step of "extracting pixel mixing parameter information from the target description image", the method also includes:

[0169] Acquire a target frame sequence, wherein the target frame sequence includes at least one frame description image for describing a degree of image gradient;

[0170] Based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image, determine the target pixel position information and pixel value information corresponding to each frame description image;

[0171] Generate the target description image according to the target pixel position information and pixel value information of each frame description image;

[0172] The pixel value information of each pixel point in the target description image is used as the pixel mixing parameter information.

[0173] For example, see Fig. 9 As shown, Fig. 9It is a schematic diagram of generating a single target description image from multiple frame description images provided in an embodiment of the present application, wherein the target description image H is generated by the first pixel mixing ratio recorded in each frame description image G, so that a single target description image is used to represent multiple frame description images. During the animation generation process, it is only necessary to obtain the target description image once to control the gradient of the entire animation, thereby reducing system overhead, power consumption, and the occurrence of problems such as performance freezes.

[0174] Specifically, in the embodiments of the present application, for a gradual animation, the target description image can be determined based on the content that is continuously newly displayed in each frame image, that is, optionally, in some embodiments of the present application, the step of "determining the target pixel position information and pixel value information corresponding to each frame description image based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image" includes:

[0175] Extracting frame description images in sequence based on the order of each frame description image in the target frame sequence;

[0176] taking the position information of the target description pixel point whose first mixing ratio information in the frame description image meets the preset condition as the candidate pixel position information;

[0177] Filter out repeated candidate pixel position information that is the same as the image described in the previous frame from the candidate pixel position information to obtain target pixel position information;

[0178] According to the preset value information and the order of the frame description images in the target frame sequence, the pixel value information of the target pixel position information is determined.

[0179] Among them, the first pixel mixing ratio in the frame description image satisfies the preset condition means that the pixel mixing ratio in the first mixing ratio information reaches the preset threshold value, that is, the pixel mixing ratio corresponding to the frame description image represents that the mixing ratio of the background image reaches a certain ratio. For example, taking the mixing situation where the pixels in the frame description image are fully transparent as an example, that is, the mixing ratio of the pixels of the foreground image is 0%, and the mixing ratio of the pixels of the background image is 100%, that is, the value of the pixel in the frame description image corresponding to the pixel in the frame image is the value of the pixel at the corresponding position in the background image, that is, the target description pixel representing the mixing as fully transparent is screened out from the frame description image.

[0180] Among them, because the gradient is usually a process of gradually showing the content of the next image, there is basically no situation where the content is first shown and then hidden. Therefore, usually, the fully transparent target description pixels in the next frame description image contain the fully transparent pixels in the previous frame description image. For example, see Fig.10 As shown, Fig.10It is an animated gradient effect diagram provided in an embodiment of the present application, wherein the effect diagram includes a frame image, wherein content S2 is displayed in the previous frame image of the frame image, and the frame image additionally displays S1 on the basis of S2, that is, the content S1 that needs to be gradually displayed in the frame image includes the content S2 gradually displayed in the previous frame image. Therefore, in order to more clearly define the display content of each frame image, it is necessary to filter out the content S2 displayed in the previous frame image to obtain S1-S2, that is, to filter out the repeated alternative pixel position information that is the same as the previous frame description image, and obtain the target pixel position information.

[0181] Among them, in the embodiments of the present application, based on the characteristics of the water level drop, the pixel value information corresponding to each target pixel position information can be set to show a downward trend. For example, the pixel value information corresponding to the target pixel position information determined by the first few frames describing the images is relatively large, while the pixel value information corresponding to the target pixel position information corresponding to the next few frames describing the images gradually decreases. That is, optionally, in some embodiments of the present application, the step of "determining the pixel value information of the target pixel position information according to the preset value information and the order of the frame description images in the target frame sequence" includes:

[0182] Determining a value offset according to the order of the frame description images in the target frame sequence;

[0183] The pixel value information of the target pixel position information is obtained according to the preset value information and the value offset.

[0184] For example, see Fig.11 As shown, Fig.11 : is a schematic diagram of pixel value information for generating a target description image provided by an embodiment of the present application, wherein, taking the decreasing trend along with the order of the frame description image as an example, specifically:

[0185] 141. Calculate the total number N of frame description images;

[0186] 142. Read the frame description image Pi;

[0187] Among them, i is the image subscript, indicating the i-th image;

[0188] 143. Determine whether the reading is complete. If the reading is not complete, execute step 144;

[0189] 144. Record the fully transparent pixels in Pi in the pixels at the corresponding positions in the target description image;

[0190] That is, the candidate pixel position information is obtained;

[0191] 145. Remove the duplicate candidate pixel position information that is the same as the previous frame description information, that is, determine the target pixel position information;

[0192] 146. Determine whether the pixel blending parameter information a of the target pixel position information is less than N. If it is less than N, execute step 147;

[0193] That is, it is determined whether the pixel mixing parameter information a of the pixel point corresponding to the target pixel position information is less than N, wherein, initially, the a value of the pixel point corresponding to the target pixel position information is 0.

[0194] 147. Set the value of a to N;

[0195] 148. Update N using N-1 and return to execute step 142.

[0196] Among them, N-1 updates N, which means N=N-1 in programming, that is, when the image is read in each cycle and assigned by N, the value of N is gradually reduced by 1.

[0197] like Fig.12 , take the target frame sequence including 9 frame description images (3*3 pixel points D1-D9 image content as an example), and, based on the order of the frame description images, each frame description image sequentially adds a fully transparent target description pixel point, namely D9 in the first frame description image, D8 in the second frame description image, D7 in the third frame description image, ..., D1 in the ninth frame description image. Among them, such a target frame sequence, when the foreground image and the background image are fused, forms the effect of D9-D1 being displayed in sequence in a gradual manner.

[0198] Specifically, based on Fig.11 The generation process of pixel value information in the target description image is as follows. When the first frame description image is read in the first loop, D9 is detected as a fully transparent target description pixel point. Correspondingly, the pixel value information of D9 (that is, the pixel mixing parameter information) is the number N of frame description images, that is, the pixel value information of D9 is 9; when the second frame description image is read in the second loop (at this time N is decremented by 1, and N=8), D8 is detected as a fully transparent target description pixel point. Correspondingly, the pixel value information of D8 (that is, the pixel mixing parameter information) is N, that is, the pixel value information of D8 is 8, and so on. After all the frame description images are looped through, the pixel value information of D9-D1 is 9-1 respectively.

[0199] It is understandable that the conditions for depth adjustment include not only the drop in water level. Therefore, when the depth, such as the water level, is adjusted in an upward manner, the pixel value information may also show an increasing trend along with the order of the frame description information. That is, the clarity, that is, the mixing ratio, can be mainly reflected by the distance between the water surface and the ground, and the animation gradient effect can be achieved.

[0200] Among them, in the embodiment of the present application, by gradually reducing the N value, the pixel value information corresponding to the fully transparent pixel points in each frame description image on the target pixel position information is gradually reduced, forming an uneven "ground" or "sand table". Then, by continuously adjusting the water level, the second pixel mixing ratio of each pixel point corresponding to each water level is controlled, and then a target animation with a gradual effect that changes with the water level is obtained. That is, the embodiment of the present application emphasizes the gradient effect of controlling the animation based on the pixel mixing ratio, and in this embodiment, the difference between the pixel brightness information of each pixel in the water level and the target description image is used to calculate the second pixel mixing ratio corresponding to each pixel.

[0201] Among them, in the embodiment of the present application, after determining each target pixel position information, a target description image can be generated based on each target pixel position information and the pixel value information corresponding to the target pixel position information, that is, optionally, in some embodiments of the present application, the step of "generating a target description image according to the target pixel position information and pixel value information of each frame description image" includes:

[0202] Image generation processing is performed based on the pixel position information of each target and the pixel value information of each target pixel position information to obtain a target description image.

[0203] For example, the target description image is obtained by filling in the blank image based on the pixel value information and the corresponding target pixel position information. Fig.11 In the embodiment, the values ​​of the 3*3 pixels D1-D9 are 1-9 respectively, and the target description image is formed according to the positions of D1-D9, such as, Figure 8 The target description image in .

[0204] In the embodiment of the present application, the target frame sequence may also be generated based on the selected reference animation, that is, optionally, in some embodiments of the present application, before the step of “obtaining the target frame sequence”, the method further includes:

[0205] In response to the animation selection operation, a reference animation is obtained by screening, the reference animation includes a first frame image, a last frame image and one or more intermediate frame images, and the animation gradient style of the reference animation is consistent with that of the target animation;

[0206] Obtaining a frame description image corresponding to each intermediate frame image according to the first frame image, the last frame image and each intermediate frame image;

[0207] A target frame sequence is obtained according to the order of the intermediate frame images and the frame description image.

[0208] For example, for each intermediate frame image, first mixing ratio information is obtained according to the first pixel value of the intermediate frame image, the second pixel value of the first frame image and the third pixel value of the last frame image, and the first mixing ratio information includes the pixel mixing ratio corresponding to each pixel point of the intermediate frame image; and the frame description image corresponding to the intermediate frame image is obtained according to each of the first pixel mixing ratios.

[0209] Correspondingly, by comparing the pixel values ​​of each intermediate frame image with the first frame image and the last frame image, the pixel mixing ratio corresponding to each pixel point in each intermediate frame image is calculated (the pixel mixing ratio of each pixel of the intermediate frame image is the first mixing ratio information of the frame description image corresponding to the intermediate frame image), and then each frame description image is obtained. Through the frame description images, the target frame sequence can be obtained according to the order of each frame image in the reference animation.

[0210] In an embodiment of the present application, the first pixel mixing ratio of a pixel in a certain intermediate frame image can also be predicted or corrected based on the overall change trend of the pixel in the animation. For example, the first pixel mixing ratio of the pixel in the current intermediate frame image can be predicted or corrected based on the pixel mixing ratio change curve of the pixel during the animation presentation process.

[0211] Among them, in an embodiment of the present application, the above-mentioned animation generation is generally completed based on a selected specific style, for example, a target description image is pre-selected, or a reference animation of a specific style is selected, and a target frame sequence is generated based on the reference animation, and then the generated animation is controlled based on the target frame sequence, or a target description image is generated first and then the generated animation is controlled based on the target description image.

[0212] In summary, the embodiment of the present application uses the target description information for controlling the animation gradient effect to perform pixel blending processing on the first image to be processed, thereby realizing the rapid generation of a gradient effect animation by pixel blending. By replacing the manual editing and production method of multiple frame images in the related art with the pixel blending method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new gradient effect animation can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects.

[0213] Furthermore, the target description information is represented in the form of a target frame sequence and a target description image, thereby improving the diversity of animation generation methods.

[0214] In order to better implement the animation generation method of the present application, the present application also provides an animation generation device based on the above animation generation method. The meanings of the terms are the same as those in the above animation generation method, and the specific implementation details can refer to the description in the method embodiment.

[0215] See also Fig.13 , Fig.13 : is a schematic diagram of the structure of an animation generating device provided in an embodiment of the present application, wherein the animation generating device can be specifically as follows:

[0216] An acquisition module 1301 is used to acquire a first image to be processed and target description information for controlling an animation gradient effect;

[0217] The generating module 1302 is used to perform pixel blending processing on the first image to be processed according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate the target animation corresponding to the first image to be processed.

[0218] Optionally, in some embodiments of the present application, the target description information includes a target frame sequence, the target frame sequence includes N frame description images, each of the frame description images includes first mixing ratio information for performing pixel mixing processing on the first image to be processed, N is an integer greater than 0, and the generation module 1302 includes:

[0219] Get the i-th frame description image;

[0220] According to the first mixing ratio information contained in the i-th frame description image, perform pixel mixing processing on the first image to be processed to obtain an i-th frame image, where the i-th frame image belongs to the one or more frame images, and i is an integer greater than 0 and less than or equal to N;

[0221] Determining whether at least one of the first images to be processed is updated;

[0222] If yes, then obtain the updated second image to be processed and the (i+1)th frame description image;

[0223] According to the first mixing ratio information contained in the i+1th frame description image, pixel mixing processing is performed on the second image to be processed to obtain the i+1th frame image, and the i+1th frame image belongs to the one or more frame images.

[0224] In some embodiments of the present application, the target description information includes a target description image, and the generating module 1302 includes:

[0225] An extraction unit, used to extract pixel mixing parameter information from the target description image, wherein the pixel mixing parameter information corresponds to the value of the pixel in the target description image;

[0226] A first determining unit, configured to determine a frame image depth offset based on a preset display depth and a preset number of frame images, and obtain a frame image depth of each frame image based on the preset display depth and the frame image depth offset;

[0227] A second determining unit, configured to determine, for each frame image depth, second mixing ratio information based on the frame image depth and the pixel mixing parameter information;

[0228] The mixing unit is used to perform pixel mixing processing on the first image to be processed according to the second mixing ratio information corresponding to the depth of each frame image, so as to obtain the one or more frame images.

[0229] In some embodiments of the present application, the device further includes a first configuration module, and the first configuration module includes:

[0230] An acquisition unit, used for acquiring a target frame sequence, wherein the target frame sequence includes at least one frame description image for describing a degree of image gradient;

[0231] A third determining unit is used to determine target pixel position information and pixel value information corresponding to each frame description image based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image;

[0232] A generating unit, used for generating a target description image according to target pixel position information and pixel value information of each frame description image;

[0233] The pixel value information of each pixel point in the target description image is used as pixel mixing parameter information.

[0234] In some embodiments of the present application, the third determining unit includes:

[0235] An extraction subunit, configured to extract frame description images in sequence based on the order of the frame description images in the target frame sequence;

[0236] A first determining subunit is used to use the position information of the target description pixel point whose first mixing ratio information in the frame description image meets the preset condition as the candidate pixel position information;

[0237] A filtering subunit, configured to filter out repeated candidate pixel position information that is the same as the image described in the previous frame from the candidate pixel position information, to obtain target pixel position information;

[0238] The second determining subunit is used to determine the pixel value information of the target pixel position information according to the preset value information and the order of the frame description images in the target frame sequence.

[0239] In some embodiments of the present application, the second determining subunit is specifically used for:

[0240] Determining a value offset according to the order of the frame description images in the target frame sequence;

[0241] The pixel value information of the target pixel position information is obtained according to the preset value information and the value offset.

[0242] In some embodiments of the present application, the generating unit includes:

[0243] The first generating subunit is used to perform image generation processing based on each target pixel position information and pixel value information of each target pixel position information to obtain a target description image.

[0244] In some embodiments of the present application, the device further includes a screening unit, and the screening unit includes:

[0245] A response subunit, configured to select and obtain a reference animation in response to an animation selection operation, wherein the reference animation includes a first frame image, a last frame image, and one or more intermediate frame images, and the animation gradient effect of the reference animation is consistent with that of the target animation;

[0246] A second generating subunit is used to obtain a frame description image corresponding to each intermediate frame image according to the first frame image, the last frame image and each intermediate frame image;

[0247] The third generating subunit is used to obtain a target frame sequence according to the order of the intermediate frame images and the frame description image.

[0248] In some embodiments of the present application, the second generating subunit is specifically used for:

[0249] For each intermediate frame image, first mixing ratio information is obtained according to a first pixel value of the intermediate frame image, a second pixel value of the first frame image, and a third pixel value of the last frame image, wherein the first mixing ratio information includes a pixel mixing ratio corresponding to each pixel point of the intermediate frame image;

[0250] A frame description image corresponding to the intermediate frame image is obtained according to the first mixing ratio information.

[0251] In some embodiments of the present application, the device further includes a second configuration module, and the second configuration module includes:

[0252] An image determining unit, used to determine a target image of an animation gradient direction from the first image to be processed;

[0253] A grayscale extraction unit, used to extract the grayscale value of each pixel in the brightness channel from the target image to obtain reference brightness information;

[0254] An image generating unit is used to generate a target description image based on the reference brightness information, wherein the reference brightness information in the target description image is used as pixel mixing parameter information.

[0255] In the embodiment of the present application, the acquisition module 1301 first acquires the first image to be processed and the target description information for controlling the animation gradient effect, and then the generation module 1302 performs pixel mixing processing on the first image to be processed according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate the target animation corresponding to the first image to be processed.

[0256] Among them, the embodiment of the present application uses the target description information for controlling the animation gradient effect to perform pixel blending processing on the first image to be processed, thereby realizing the rapid generation of a gradient effect animation by pixel blending. By replacing the manual editing and production method of multiple frame images in the related art with the pixel blending method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new gradient effect animation can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects.

[0257] In addition, the present application also provides an electronic device, such as Fig.14 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0258] The electronic device may include components such as a processor 1401 with one or more processing cores, a memory 1402 with one or more computer-readable storage media, a power supply 1403, and an input unit 1404. Those skilled in the art will appreciate that Fig.14 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0259] The processor 1401 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 1402 and calling data stored in the memory 1402, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 1401 may include one or more processing cores; preferably, the processor 1401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1401.

[0260] The memory 1402 can be used to store software programs and modules. The processor 1401 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402. The memory 1402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1402 may also include a memory controller to provide the processor 1401 with access to the memory 1402.

[0261] The electronic device also includes a power supply 1403 for supplying power to each component. Preferably, the power supply 1403 can be logically connected to the processor 1401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1403 can also include one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0262] The electronic device may further include an input unit 1404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0263] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 1401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 1402 according to the following instructions, and the processor 1401 will run the application programs stored in the memory 1402, thereby implementing the steps in any one of the animation generation methods provided in the embodiments of the present application.

[0264] An embodiment of the present application obtains a first image to be processed and target description information for controlling an animation gradient effect, and performs pixel blending processing on the image to be processed according to the target description information to obtain one or more frame images, and generates a target animation corresponding to the first image to be processed based on the one or more frame images.

[0265] Among them, the pixel mixing process of the first image to be processed is carried out by the target description information used to control the animation gradient effect, so as to realize the rapid generation of the gradient effect animation by pixel mixing. By replacing the manual editing and production method of multiple frame images in the related art with the pixel mixing method, the embodiment of the present application reduces the complexity of animation production and improves the efficiency of animation production. In addition, in the embodiment of the present application, a new gradient effect animation can be generated by simply replacing the target description information, thereby improving the generation efficiency of animations with different gradient effects.

[0266] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0267] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0268] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any animation generation method provided in the present application.

[0269] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0270] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0271] Since the instructions stored in the computer-readable storage medium can execute the steps in any animation generation method provided in the present application, the beneficial effects that can be achieved by any animation generation method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0272] The above is a detailed introduction to an animation generation method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0273] It should be noted that in the specific implementation of the present application, related data such as the image to be processed, target description information, reference animation, and the first frame image, last frame image and intermediate frame image of the reference animation, frame description image, target frame sequence, target description image, etc., when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

Claims

1. An animation generation method, It is characterized in that The method comprises: Obtaining a first image to be processed and target description information for controlling an animation gradient effect; The first image to be processed is subjected to pixel blending processing according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate a target animation corresponding to the first image to be processed.

2. The animation generation method according to claim 1, It is characterized in that The target description information includes a target frame sequence, the target frame sequence includes N frame description images, each of the frame description images includes first mixing ratio information for performing pixel mixing processing on the first image to be processed, N is an integer greater than 0, and performing pixel mixing processing on the first image to be processed according to the target description information to obtain one or more frame images includes: Get the i-th frame description image; According to the first mixing ratio information contained in the i-th frame description image, pixel mixing processing is performed on the first image to be processed to obtain the i-th frame image, the i-th frame image belongs to the one or more frame images, and i is an integer greater than 0 and less than or equal to N.

3. The method according to claim 2, It is characterized in that After performing pixel mixing processing on the first image to be processed according to the first mixing ratio information contained in the i-th frame description image to obtain the i-th frame image, the method further includes: Determining whether at least one of the first images to be processed is updated; If yes, then obtain the updated second image to be processed and the (i+1)th frame description image; According to the first mixing ratio information contained in the i+1th frame description image, pixel mixing processing is performed on the second image to be processed to obtain the i+1th frame image, and the i+1th frame image belongs to the one or more frame images.

4. The animation generation method according to claim 1, It is characterized in that The target description information includes a target description image, and the pixel mixing process is performed on the first image to be processed according to the target description information to obtain one or more frame images, including: Extracting pixel mixing parameter information from the target description image, wherein the pixel mixing parameter information corresponds to the value of the pixel in the target description image; Determine a frame image depth offset based on a preset display depth and a preset number of frame images, and obtain a frame image depth of each frame image based on the preset display depth and the frame image depth offset; For each frame image depth, determining second mixing ratio information based on the frame image depth and the pixel mixing parameter information; The first image to be processed is subjected to pixel mixing processing respectively according to the second mixing ratio information corresponding to the depth of each frame image to obtain the one or more frame images.

5. The animation generation method according to claim 4, It is characterized in that Before extracting pixel mixing parameter information from the target description image, the method further includes: Acquire a target frame sequence, wherein the target frame sequence includes at least one frame description image for describing a degree of image gradient; Based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image, determine the target pixel position information and pixel value information corresponding to each frame description image; Generate the target description image according to the target pixel position information and pixel value information of each frame description image; The pixel value information of each pixel point in the target description image is used as the pixel mixing parameter information.

6. The animation generation method according to claim 5, It is characterized in that The determining of target pixel position information and pixel value information corresponding to each frame description image based on the order of each frame description image in the target frame sequence and the first mixing ratio information recorded in each frame description image includes: Extracting frame description images in sequence based on the order of each frame description image in the target frame sequence; taking the position information of the target description pixel point whose first mixing ratio information in the frame description image meets the preset condition as the candidate pixel position information; Filter out repeated candidate pixel position information that is the same as the image described in the previous frame from the candidate pixel position information to obtain target pixel position information; According to the preset value information and the order of the frame description images in the target frame sequence, the pixel value information of the target pixel position information is determined.

7. The animation generation method according to claim 6, It is characterized in that The step of determining the pixel value information of the target pixel position information according to the preset value information and the order of the frame description image in the target frame sequence includes: Determining a value offset according to the order of the frame description images in the target frame sequence; The pixel value information of the target pixel position information is obtained according to the preset value information and the value offset.

8. The animation generation method according to claim 5, It is characterized in that The step of generating a target description image according to target pixel position information and pixel value information of each frame description image comprises: Image generation processing is performed based on the pixel position information of each target and the pixel value information of each target pixel position information to obtain a target description image.

9. The animation generation method according to claim 5, It is characterized in that Before acquiring the target frame sequence, the method further includes: In response to the animation selection operation, a reference animation is obtained by screening, the reference animation includes a first frame image, a last frame image and one or more intermediate frame images, and the animation gradient effect of the reference animation is consistent with that of the target animation; Obtaining a frame description image corresponding to each intermediate frame image according to the first frame image, the last frame image and each intermediate frame image; A target frame sequence is obtained according to the order of the intermediate frame images and the frame description image.

10. The animation generation method according to claim 9, It is characterized in that The step of obtaining a frame description image corresponding to each intermediate frame image according to the first frame image, the last frame image and each intermediate frame image comprises: For each intermediate frame image, first mixing ratio information is obtained according to a first pixel value of the intermediate frame image, a second pixel value of the first frame image, and a third pixel value of the last frame image, wherein the first mixing ratio information includes a pixel mixing ratio corresponding to each pixel point of the intermediate frame image; A frame description image corresponding to the intermediate frame image is obtained according to the first mixing ratio information.

11. An animation generating device, It is characterized in that The device comprises: An acquisition module, used to acquire a first image to be processed and target description information for controlling an animation gradient effect; A generation module is used to perform pixel blending processing on the first image to be processed according to the target description information to obtain one or more frame images, and the one or more frame images are used to generate a target animation corresponding to the first image to be processed.

12. An electronic device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the animation generation method according to any one of claims 1 to 10 when executing the computer program.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the animation generation method according to any one of claims 1 to 10 are implemented.

Citation Information

Cited By

  • Animation generation method and apparatus, and electronic device and computer-readable storage medium

    WO2026037293A1