Text animation generation method and device, electronic equipment and storage medium
By obtaining target text and reference data, generating text images and converting them into text animations, the problems of single special-effect text styles and poor visual effects in the prior art are solved, and higher visual expression and diversity are achieved.
Patent Information
- Application Number
- CN202311278187.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
The special-effect text generated in the prior art has the problems of single style and poor visual effects.
By responding to user operations, the target text and reference data are obtained, the text image is generated, and the text animation of special-effect text is generated based on the text image. This method uses reference data to convert the target text into a text image, and then converts the text image into a text animation to achieve dynamically changing special-effect text.
The visual expressiveness and diversity of special effects texts are improved, and the problems of single style and poor visual effects generated are solved.
Smart Images

Figure CN119722857A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to a text animation generation method, device, electronic device and storage medium. Background Art
[0002] Special effect text is usually generated by adding additional special effects to basic fonts. Compared with ordinary fonts, it has better visual effects. Currently, inserting special effect text into pictures and videos to improve the visual expression of videos and images is a common image editing method.
[0003] In the prior art, the generation of special effect text is usually implemented based on special effect text templates. For example, in an image editing application or platform, several special effect text templates are preset, and users generate special effect text by calling such special effect text templates to meet the user's needs for inserting special effect text into an image.
[0004] However, the solutions in the prior art can only generate static special effect texts in a preset style, which results in the generated special effect texts having problems such as a single style and poor visual effects. Summary of the invention
[0005] The embodiments of the present disclosure provide a text animation generation method, device, electronic device and storage medium to overcome the problem that the generated artistic characters have a single style and poor visual effects.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a text animation, comprising:
[0007] In response to a first user operation, a target text and corresponding reference data are obtained, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text; a text image is generated based on the target text and the reference data, wherein the text image includes special effect text corresponding to the target text; and a text animation corresponding to the special effect text is generated based on the text image.
[0008] In a second aspect, an embodiment of the present disclosure provides a text animation generating device, comprising:
[0009] An interaction module, configured to obtain a target text and corresponding reference data in response to a first user operation, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text;
[0010] A processing module, configured to generate a text image according to the target text and the reference data, wherein the text image includes special effect text corresponding to the target text;
[0011] A generating module is used to generate a text animation corresponding to the special effect text according to the text image.
[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0013] The memory stores computer-executable instructions;
[0014] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text animation generation method described in the first aspect and various possible designs of the first aspect.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the text animation generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the text animation generation method as described in the first aspect and various possible designs of the first aspect.
[0017] The text animation generation method, device, electronic device and storage medium provided in this embodiment obtain target text and corresponding reference data in response to a first user operation, wherein the reference data is used to indicate the font effect of the special effect text generated based on the target text; a text image is generated based on the target text and the reference data, wherein the text image includes the special effect text corresponding to the target text; and a text animation corresponding to the special effect text is generated based on the text image. By using the reference data to convert the target text into a text image, and then converting the text image into a text animation, a dynamically changing special effect text is obtained, thereby improving the visual expressiveness and diversity of the special effect text. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 An application scenario diagram of the text animation generation method provided in the embodiment of the present disclosure;
[0020] Figure 2 A flowchart of a text animation generation method provided in an embodiment of the present disclosure Figure 1 ;
[0021] Figure 3 for Figure 2 A flowchart of a specific implementation method of step S102 in the illustrated embodiment;
[0022] Figure 4 for Figure 3 A flowchart of a specific implementation method of step S1021 in the illustrated embodiment;
[0023] Figure 5 A schematic diagram of a process for generating an input image provided by an embodiment of the present disclosure;
[0024] Figure 6 for Figure 2 A flowchart of a specific implementation method of step S103 in the illustrated embodiment;
[0025] Figure 7 A schematic diagram of a process for generating a two-dimensional skeletal animation provided by an embodiment of the present disclosure;
[0026] Figure 8 A flowchart of a text animation generation method provided in an embodiment of the present disclosure Figure 2 ;
[0027] Fig. 9 for Figure 6 A flowchart of a specific implementation method of step S205 in the illustrated embodiment;
[0028] Fig.10 A schematic diagram of generating a sequence frame animation provided by an embodiment of the present disclosure;
[0029] Fig.11 A schematic diagram of a process for generating multiple frames of simulated images provided by an embodiment of the present disclosure;
[0030] Fig.12 A structural block diagram of a text animation generating device provided in an embodiment of the present disclosure;
[0031] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0032] Fig.14 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] The application scenarios of the embodiments of the present disclosure are explained below:
[0036] Figure 1 This is an application scenario diagram of the text animation generation method provided in the embodiment of the present disclosure. The text animation generation method provided in the embodiment of the present disclosure can be applied to an application with a font special effect production function, and more specifically, can be applied to the application scenario of special effect text design, production and editing. The execution subject of this embodiment can be a terminal device running the above-mentioned application with a font special effect production function, or a server running the service end corresponding to the above-mentioned application, or other electronic devices with similar functions. Figure 1 As shown in , taking the terminal device as an example, after the terminal device runs an application with a font special effect production function, a text input box and a parameter control are displayed in the application interface, wherein the text input box is used to input the target text (shown as the letter "A" in the figure), and the parameter control is used to control the special effect style of the special effect text generated based on the target text. After the user operates the terminal device, enters the target text in the text input box, and configures the parameter control, clicks the "Generate" control to generate the dynamic special effect text corresponding to the target text. Among them, the special effect text, which can also be called artistic text, is text with special effect fonts. Compared with static special effect text, the font shape and / or font texture of the dynamic special effect text will change dynamically over time, that is, text animation. Afterwards, the generated text animation can be further inserted into carriers such as videos and images to generate videos and sequence frames with text animation. Thereby, the above-mentioned video and sequence frames can achieve better visual effects while displaying text information.
[0037] In the prior art, the generation of special effect text is usually based on special effect text templates, such as artistic word templates. For example, in an image editing application or platform, several special effect text templates are preset, and users generate special effect text by calling such special effect text templates to meet the user's needs of inserting special effect text in an image carrier. However, the scheme for generating special effect text in the prior art can only generate static special effect text of a preset style based on a special effect text style template, but cannot achieve more personalized dynamic special effect text, resulting in the generated special effect text having problems such as a single style and poor visual effect.
[0038] The disclosed embodiment provides a text animation generation method to solve the above problems.
[0039] refer to Figure 2 , Figure 2 A flowchart of a text animation generation method provided in an embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a terminal device or a server. The text animation generation method includes:
[0040] Step S101: in response to a first user operation, a target text and corresponding reference data are acquired, where the reference data is used to indicate a font effect of a special effect text generated based on the target text.
[0041] For example, reference Figure 1 The application scenario diagram shown in the figure takes the terminal device as the execution subject of the method of this embodiment as an example. After the terminal device runs the target application with the special effect text generation function, it displays the application interface for responding to the user operation. Figure 1 The input box and parameter controls in the application interface shown in the figure respond to the first user operation, and obtain the corresponding target text and the corresponding reference data. Among them, the target text is the text used to generate special effect text in the future, and the reference data is used to indicate the font effect of the special effect text generated based on the target text, wherein the special effect text is a flat font with font special effects. In a possible implementation method, the reference data includes, for example: font type, such as Songti, Kaiti; font color; language type, etc. Furthermore, the reference data can also include the texture features of the generated special effect text. Through the reference data, the font effect of the special effect text corresponding to the generated target text can be controlled.
[0042] It is understandable that in other possible implementations, the first user operation can also be implemented in other ways. For example, the first user operation is used to control the terminal device to load the target file. After that, the terminal device obtains the target text and corresponding reference data based on the content of the loaded target file. The specific implementation method is not limited and can be set as needed.
[0043] Step S102: Generate a text image according to the target text and reference data, wherein the text image includes special effect text corresponding to the target text.
[0044] Exemplarily, after obtaining the target text and reference data, the terminal device processes the target text using the generative model to obtain a corresponding text image, i.e., a text image. The text image may contain only special effect text corresponding to the target text, or may contain special effect text corresponding to the target text, and a corresponding background image, such as a solid color background image, or a background image with other image content, which may be set according to specific needs and is not limited here.
[0045] In a possible implementation, the reference data includes a font file based on the target language, or information indicating a font file based on the target language. Figure 3 As shown, the specific implementation of step S102 includes:
[0046] Step S1021: Generate an input image according to the target text and font file.
[0047] Step S1022: Generate a text image based on the input image and the generative model.
[0048] Exemplarily, a font file is a character library file for implementing a specific type of font, such as a TTF (TrueTypeFont) file, etc. Different languages correspond to different font files. In one implementation, the reference data includes an identifier indicating the font file of the target language (such as English). The terminal device obtains the corresponding font file through the above identifier and loads it, thereby obtaining the font file. Afterwards, the terminal device performs a text-to-image processing process through the target text and the corresponding font file to obtain the corresponding input image. Afterwards, the input image is further processed to generate a text image with font special effects.
[0049] Among them, in a possible implementation, the implementation of generating the input image includes: based on the font file, after converting the target text into a text image containing the target text, recognizing the glyph outline in the text image, and processing the glyph outline, such as changing the shape of the glyph outline, more specifically, for example, changing the outline of the glyph outline from a straight line or a curve to a wavy line, so as to obtain the input image.
[0050] In another possible implementation, a more complex input image can be generated by adding texture. For example, the reference data includes texture information, and the texture information represents the texture features of the input image, such as Figure 4 As shown, the specific implementation of step S1021 includes:
[0051] Step S1021A: Obtain a text image according to the target text and font file;
[0052] Step S1021B: Process the text image to obtain a character outline.
[0053] Step S1021C: Perform texture superposition on the glyph outline based on the texture information to generate an input image.
[0054] Exemplarily, after obtaining a text image according to the target text and the font file, the glyph outline of the target text in the text image can be obtained by processing the text image, such as glyph outline recognition. Specifically, the obtained glyph outline can be, for example, a pixel coordinate point describing the glyph outline, or a layer used to represent the glyph outline. Afterwards, based on the texture represented by the texture information, the corresponding texture data or file is obtained from the texture library, and the texture is superimposed on the glyph outline, thereby generating an input image with texture features.
[0055] Furthermore, in another possible implementation, the font morphology can be changed by adding a mask image, so as to obtain an input image of the target font including the font morphology, and then obtain personalized special effect text that meets user needs. Specifically, exemplarily, the reference data includes a mask image, and the mask image is used to represent the display area of the input image. The specific implementation of step S1021 includes:
[0056] Step S1021A: Obtain a text image according to the target text and font file;
[0057] Step S1021B: Process the text image to obtain a character outline.
[0058] Step S1021D: Generate an input image through the mask image and the glyph outline.
[0059] Among them, exemplarily, referring to the introduction in the steps of the previous embodiment, after obtaining the glyph outline, it can be further processed based on a mask, wherein the mask can be an image used to mask the target text in the text image to change its morphological appearance, such as a "venetian blinds" image. Under the action of the mask, part of the content of the target text in the text image is displayed, while part of the content is masked, thereby changing the font morphology.
[0060] Among them, in the above-mentioned step of obtaining the input image, the step of superimposing texture on the text picture, and the step of superimposing a mask on the text picture, can be executed separately to generate the input image, or can be executed successively to generate the input image. In the scheme of executing the above-mentioned superimposing texture and superimposing mask successively, the execution order of the two can be set as needed, and no specific restriction is made here.
[0061] Figure 5 A schematic diagram of a process for generating an input image provided by an embodiment of the present disclosure is shown below. Figure 5 For further description of the above process, refer to Figure 5 As shown, after the target text and font file are processed into images, a text image is generated, such as the image P1 containing the letter "A" shown in the figure; then, according to the texture information, the texture map P2 is superimposed on the text image P1 to obtain the superimposed image P3, and further, the mask map P4 is superimposed on the superimposed image P3 to further adjust the appearance of the target text "A" to obtain the input image P5 containing the target text with the above-mentioned appearance and texture.
[0062] In the steps of this embodiment, the texture and shape of the text in the input image are adjusted through texture information and / or mask information, so that the special effect text and text animation subsequently generated based on the input image can meet the user's personalized needs and improve the visual expressiveness and diversity of the text animation.
[0063] For example, after obtaining the input image, the input image can be further processed to generate special effect text. One possible implementation is to add a color style filter to the input image to change the color of the font in the input image, thereby obtaining special effect text. In another possible implementation, the input image can be processed using a generative model in an image to image (img2img) mode to obtain the corresponding special effect text.
[0064] Exemplarily, the specific implementation of step S1022 includes:
[0065] Step S1022A: Obtain description word information.
[0066] Step S1022B: Process the description word information and the input image through the pre-trained generative model to generate a text image.
[0067] In fact, exemplarily, the description word information (prompt) is information used to describe the content generation characteristics and content generation direction of the generative model, which can be obtained through the second user operation. For example, in the application interface, a text box for entering the description word information is provided, and the user enters text into the text box through the second user operation, so that the terminal device obtains the description word information. More specifically, the description word information can be input based on user needs, such as "flame", "cold winter", etc. Afterwards, the generative model will extract semantic features from the description word information to obtain the user intention represented by the description word information, and then generate content to obtain a text image, so that the special effect text in the text image has a font effect whose special effect style matches the user intention represented by the description word information based on the input image.
[0068] Furthermore, before the text image is generated by the pre-trained generative model, exemplarily, a step of configuring the generative model may also be included. Specifically, for example, in response to a third user operation, a model plug-in is configured for the generative model, and the model plug-in is used to enable the generative model to generate an image with a target image style. The model plug-in may be an open source plug-in, or other customized plug-in, which may be selected as needed. Through the model plug-in, the image style and image effect of the image generated by the generative model may be set, for example, through an open source plug-in, the generative model may generate a cartoon-style image, and so on. Thereby further improving the actual effect of the text image generated by the generative model and improving the personalized needs of users.
[0069] Among them, the specific training and use methods of the generative model are existing technologies known to those skilled in the art, and the specific execution process of generating an image through the generative model in the steps of this embodiment will not be repeated here.
[0070] Step S103: Generate a text animation corresponding to the special effect text according to the text image.
[0071] Further, after obtaining the text image generated by the generative model, the text image is further processed to obtain an image containing dynamic special effect text, that is, a text animation. Specifically, in a possible implementation, the text image can be three-dimensionalized to create a three-dimensional model corresponding to the special effect text in the text image, that is, a three-dimensional special effect text model, and then, based on the three-dimensional special effect text model, it is two-dimensionally mapped from different angles to obtain multiple frames of images containing artistic words, and then a text animation is generated based on the above multiple frames of images. The visualization effect of the text animation is, for example, a rotating letter "A". In another possible implementation, different font textures and colors can be added to the text image to generate multiple frames of image frames containing artistic words with different appearances, or multiple frames of text images with different appearances can be directly generated, and then a text animation is generated based on the above multiple frames of images or text images, such as a letter "A" with a changing appearance. Among them, the above steps of three-dimensionalizing the text image and adding and generating different font appearances to the text image can be implemented by a pre-trained generative model, which will not be repeated here.
[0072] In a possible implementation, the text animation includes at least two-dimensional skeletal animation, and the two-dimensional skeletal animation is used to show the shape changes of special effect text, such as Figure 6 As shown, the specific implementation of step S103 includes:
[0073] Step S1031: obtaining an initial skeleton animation template, wherein the skeleton animation template includes a skeleton model and at least one key frame, wherein the key frame is used to represent the shape of the skeleton model at a corresponding moment.
[0074] Step S1032: Map the text image to the skeleton animation template, bind the special effect text to the skeleton model, and obtain a two-dimensional skeleton animation corresponding to the key frame.
[0075] Exemplarily, skeletal animation is a kind of model animation. In skeletal animation, the model has a skeleton structure composed of interconnected "bones", and the animation is generated by changing the orientation and position of the "bones". Specifically, the skeletal animation template includes a face model and a skeleton bound to the face model, i.e., a skeletal model, and key frames corresponding to the skeletal model. By setting key frames (k frames) for the skeleton, the morphology of the skeletal model at the corresponding moment is set, and then at least corresponding pictures are generated in order for each key frame, so that the "motion effect" of the skeletal model can be achieved. Based on the above introduction, after obtaining the initial skeletal animation template, the special effect text in the text image is mapped to the skeletal animation template to achieve the binding between the special effect text and the skeletal model, and then for each key frame, a corresponding image frame containing the special effect text moving with the skeletal model is generated, and based on the above-mentioned orderly generated image frames, a two-dimensional skeletal animation can be obtained.
[0076] Figure 7 A schematic diagram of a process for generating a two-dimensional skeleton animation provided by an embodiment of the present disclosure, referring to Figure 7 As shown, after obtaining the preset skeletal animation template, the text image is mapped to the skeletal animation template, and then, based on the movement rules of the skeletal model determined by the key frames of the skeletal animation template, the corresponding skeletal motion frames are generated, such as the P1 frame, P2 frame, P3 frame, etc. shown in the figure. In each skeletal motion frame, the outline shape of the special effect text changes with the movement of the skeletal model, thereby producing a dynamic effect, and then based on a collection of multiple skeletal motion frames, a two-dimensional skeletal animation is generated.
[0077] The text animation generation method provided by the embodiment of the present disclosure obtains the target text and the corresponding reference data in response to the first user operation, the reference data is used to indicate the font effect of the special effect text generated based on the target text; generates a text image according to the target text and the reference data, the text image contains the special effect text corresponding to the target text; generates a text animation corresponding to the special effect text according to the text image. By using the reference data to convert the target text into a text image, and then converting the text image into a text animation, a dynamically changing artistic text is obtained, thereby improving the visual expressiveness and diversity of the artistic text.
[0078] refer to Figure 8 , Figure 8 A flowchart of a text animation generation method provided in an embodiment of the present disclosure Figure 2 In this embodiment Figure 2 On the basis of the illustrated embodiment, the step of generating text animation, i.e., step S103, is further refined. Exemplarily, the text animation at least includes a sequence frame animation. The text animation generating method includes:
[0079] Step S201: in response to a first user operation, a target text and corresponding reference data are obtained, where the reference data is used to indicate a font effect of a plane special effect text generated based on the target text.
[0080] Step S202: Generate a text image according to the target text and reference data, wherein the text image includes a plane special effect text corresponding to the target text.
[0081] Step S203: obtaining a corresponding depth map according to the text image, wherein the depth map represents the spatial depth of the plane special effect text in the camera coordinate system corresponding to the text image.
[0082] Step S204: Perform three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the two-dimensional special effect text.
[0083] Exemplarily, depth usually refers to the value generated in the depth direction (Z direction) of the camera space due to the different distances from the shooting point of different objects in the photo taken by the camera, that is, the Z coordinate in the camera coordinate system. The depth map can be a dot map or matrix used to represent the spatial depth of the above-mentioned plane special effect text in the camera coordinate system corresponding to the plane text image. In a possible implementation, the size of the depth map is the same as the size of the text image, wherein each point (depth value) in the depth map corresponds to a pixel point in the text image, thereby representing the spatial depth of the plane special effect text.
[0084] Furthermore, since the depth values in the depth map correspond one-to-one to the pixels in the text image, the neighborhood information of the pixels in the text image is completely inherited by the depth map. The depth map can be subsequently combined to realize the three-dimensionalization of the two-dimensional special effect text and obtain the expression of the two-dimensional special effect text in the three-dimensional space, that is, the three-dimensional special effect text model corresponding to the two-dimensional special effect text.
[0085] Exemplarily, the depth map can be obtained by processing the text image using a depth estimation algorithm, and the specific implementation of the depth estimation algorithm will not be described in detail here. In the steps of this embodiment, since the depth map only saves a depth value instead of three coordinate values of the three-dimensional point cloud, the three-dimensional spatial information of the text image matching can be expressed in an orderly manner with less storage space through the depth map. Thereby improving the computational efficiency of the subsequent generation of text animation. Among them, there are multiple implementation methods for the algorithm (2D to 3D algorithm) that converts a two-dimensional image into a three-dimensional model in combination with a depth map, and those skilled in the art can set it as needed, which will not be described here.
[0086] Optionally, after step S203, the following steps may also be included:
[0087] Step S203A: segment the text image to obtain a transparent text image, which includes the plane special effect text and the corresponding transparent background.
[0088] Exemplarily, before generating a three-dimensional special effects text model based on a text image, the text image can be segmented first, and the solid background other than the plane special effects text in the text image can be removed to obtain a transparent text image including only the plane special effects text and the corresponding transparent background. Then, a three-dimensional special effects text model can be generated based on the transparent text image to improve the model quality of the three-dimensional special effects text model. Specifically, the contour of the plane special effects text can be identified by the change of the pixels in the text image, and then the image can be segmented to obtain a transparent text image with a transparent background. The text image can also be processed by, for example, an image processing model such as the open source model U2Net to obtain a transparent text image with a transparent background. The specific implementation method can be set as needed and will not be repeated here.
[0089] Afterwards, after the text image is segmented and a transparent text image is obtained, the corresponding three-dimensional special effects text model can be generated through the transparent text image, that is, the transparent text image is three-dimensionalized based on the depth map to obtain a three-dimensional special effects text model corresponding to the two-dimensional special effects text. Since the solid background in the text image is removed, the contour edge accuracy of the two-dimensional special effects text can be improved, and the background interference can be reduced, thereby improving the model quality of the three-dimensional special effects text model.
[0090] Step S205: Generate a sequence frame animation corresponding to the two-dimensional special effect text based on the three-dimensional special effect text model.
[0091] For example, after obtaining the 3D special effect text model, based on the 3D special effect text model, the 3D special effect text model can be directly mapped in two dimensions to obtain 2D images in different forms and viewing angles, and then arranged in order to obtain sequence frame dynamics. Alternatively, based on a preset 3D model engine or tool, a physical simulation is performed with the 3D special effect text model as input, and batch rendering is performed to generate sequence frame dynamics.
[0092] In one possible implementation, Fig. 9 As shown, the specific implementation of step S205 includes:
[0093] Step S2051: Perform physical simulation on the 3D special effects text model to obtain at least two frames of simulation images, wherein the simulation images include 3D special effects text. The 3D special effects text is a projection of the 3D special effects text model on a two-dimensional plane, and the 3D special effects text in each simulation image has the same type of physical appearance.
[0094] Step S2052: Generate a sequence frame animation based on at least two frames of simulated images.
[0095] Exemplarily, performing physical simulation on a three-dimensional model refers to simulating the appearance of a real object to the appearance of a three-dimensional model, so that the appearance of the three-dimensional model has a real physical visual effect. Specifically, the types of physical simulation include, for example: fluid, cloth, hair, soft body, rigid body, etc. By performing physical modeling on the three-dimensional model, the appearance of the three-dimensional model is made more realistic and the viewing effect is improved. In this embodiment, a three-dimensional special effect text model is physically simulated and two-dimensionally projected (rendered) to generate three-dimensional special effect text with a real physical appearance, and then a sequence frame animation is generated through an orderly combination of multiple three-dimensional special effect texts (corresponding simulated images) of the above-mentioned specific same type of physical appearance. Among them, three-dimensional special effect text refers to special effect text with a three-dimensional visual effect presented in a two-dimensional plane (picture) (see the subsequent Fig.10The process of making a physical model for the three-dimensional special effect text model can be implemented by software or tools with three-dimensional drawing and rendering capabilities, which is not limited here.
[0096] Fig.10 A schematic diagram of generating a sequence frame animation provided by an embodiment of the present disclosure, such as Fig.10 As shown, after obtaining the three-dimensional special effects text model (shown in the figure as the three-dimensional model of the letter "A"), a physical simulation is performed on it through a three-dimensional model rendering tool to generate multiple frames of simulation images, such as the simulation image Pic_1, the simulation image Pic_2 and the simulation image Pic_3 in the figure, wherein the three-dimensional special effects text in each simulation image has added a physical appearance of "water ripples" relative to the three-dimensional special effects text model, but in each simulation image (such as the simulation image Pic_1, the simulation image Pic_2 and the simulation image Pic_3), at least two frames of simulation images are inconsistent, and then based on the multiple frames of simulation images generated above, they are orderly combined to obtain a sequence frame animation, that is, the text animation corresponding to the plane special effects text, thereby achieving the purpose of dynamic display of the special effects text.
[0097] Furthermore, in a possible implementation, the specific implementation of step S2051 includes:
[0098] Step S2051A: Obtain the target number of simulation images to be generated.
[0099] Step S2051B: Perform physical simulation on the three-dimensional special effects text model according to the target quantity, and generate a corresponding simulation image based on the trigger timing of the physical simulation of the three-dimensional special effects text model, wherein the physical appearance of the three-dimensional special effects text in the simulation image is determined by the trigger timing corresponding to the simulation image.
[0100] Exemplarily, the steps of this embodiment provide a more specific implementation method for physically simulating a three-dimensional special effect text model. First, the target number of simulation images to be generated is obtained. The target number can be manually set according to user needs. Then, based on the target number, a three-dimensional model rendering tool is called to perform multiple physical simulations on the three-dimensional special effect text model, that is, multiple renderings, so as to obtain multiple frames of simulation images. At the same time, during the rendering process, the rendering trigger timing is used as an image generation parameter to generate a simulation image corresponding to the trigger timing. For example, when rendering the three-dimensional special effect text, the system time at each trigger rendering is called, and the system time is used as an image generation parameter to generate the corresponding simulation image, so that there is a correlation corresponding to the timing characteristics between the physical appearances of the continuously generated simulation images. Since the trigger timing is continuous, the physical appearances of the continuously generated simulation images show continuous and regular changes.
[0101] Fig.11 A schematic diagram of a process for generating a multi-frame simulation image provided by an embodiment of the present disclosure is shown below in conjunction with Fig.11 The above process is further described. For example, after obtaining a 3D special effect text model (shown as a 3D model of the letter "A" in the figure), a 3D model rendering tool is used to perform physical simulation on it, and multiple frames of simulation images are generated in sequence, such as the simulation image Pic_1, the simulation image Pic_2 and the simulation image Pic_3 in the figure. The 3D special effect text in each of the above simulation images has the same type of physical appearance, that is, the physical appearance of "cracks" (compared to the 3D special effect text model). Among them, the simulation image Pic_1 is rendered at time T1. The simulated image Pic_2 is rendered at time T2, and the simulated image Pic_3 is rendered at time T3. Since time T1 is less than time T2, and time T2 is less than time T3, accordingly, the physical appearance of the 3D special effect text in the simulated image Pic_1 is a physical appearance ap_1 with a small "crack", the physical appearance of the 3D special effect text in the simulated image Pic_2 is a physical appearance ap_2 with a medium "crack", and the physical appearance of the 3D special effect text in the simulated image Pic_3 is a physical appearance ap_3 with a large "crack". That is, the physical appearance of the 3D special effect text generated after the physical simulation is related to the timing of triggering the physical simulation. Afterwards, based on the ordered set of simulated images Pic_1, simulated images Pic_2, and simulated images Pic_3, a dynamic special effect text showing a continuous change of "cracks" can be obtained, that is, a sequence frame animation (text animation).
[0102] In the steps of this embodiment, in the process of performing physical simulation on the three-dimensional special effects text model and generating a sequence frame animation, a corresponding simulated image is generated based on the trigger timing of the physical simulation of the three-dimensional special effects text model. Since the trigger timing is continuous, when the trigger timing is used as an image generation parameter to generate the corresponding simulated image, there is also continuity in content between the multiple frames of simulated images obtained, so that the physical appearance of the three-dimensional special effects text presents a continuously changing visual effect, so that the finally generated sequence frame dynamics (text animation) can show a more realistic physical effect, thereby improving the expressiveness.
[0103] In this embodiment, the implementation method of step S201-step S202 is the same as that of the present disclosure. Figure 2 The implementation methods of step S101 and step S102 in the illustrated embodiment are the same and will not be described in detail here.
[0104] Corresponding to the text animation generation method of the above embodiment, Fig.12 This is a structural block diagram of a text animation generating device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Fig.12, the text animation generating device 3 comprises:
[0105] An interaction module 31, configured to obtain a target text and corresponding reference data in response to a first user operation, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text;
[0106] A processing module 32, for generating a text image according to the target text and the reference data, wherein the text image includes special effect text corresponding to the target text;
[0107] The generation module 33 is used to generate text animation corresponding to the special effect text according to the text image.
[0108] In one embodiment of the present disclosure, the reference data includes a font file based on the target language; the processing module 32 is specifically used to: generate an input image according to the target text and the font file; and generate a text image according to the input image.
[0109] In one embodiment of the present disclosure, the reference data includes texture information, and the texture information represents the texture features of the input image; when the processing module 32 generates the input image according to the target text and font file, it is specifically used to: obtain the glyph outline according to the target text and font file; and perform texture superposition on the glyph outline based on the texture information to generate the input image.
[0110] In one embodiment of the present disclosure, the reference data includes mask information, and the mask information is used to characterize the display area of the input image; when the processing module 32 generates the input image according to the target text and font file, it is specifically used to: obtain a text image according to the target text and font file; generate the input image through the mask map and text image corresponding to the mask information.
[0111] In one embodiment of the present disclosure, the interaction module 31 is further used to: obtain descriptive word information in response to a second user operation; when the processing module 32 generates a text image based on an input image, it is specifically used to: process the descriptive word information and the input image through a pre-trained generative model to generate a text image.
[0112] In one embodiment of the present disclosure, before a pre-trained generative model is used to process description word information and an input image to generate a text image, the interaction module 31 is further used to include: in response to a third user operation, configuring a model plug-in for the generative model, wherein the model plug-in is used to enable the generative model to generate an image having a target image style.
[0113] In one embodiment of the present disclosure, the text animation includes at least two-dimensional skeletal animation, which is used to display the glyph changes of special effect text; the generation module 33 is specifically used to: obtain an initial skeletal animation template, the skeletal animation template includes a skeletal model and at least one key frame, and the key frame is used to characterize the shape of the skeletal model at the corresponding moment; map the text image to the skeletal animation template, bind the special effect text to the skeletal model, and obtain a two-dimensional skeletal animation corresponding to the key frame.
[0114] In one embodiment of the present disclosure, the special effect text in the text image is a plane special effect text; the text animation includes at least a sequence frame animation, and the generation module 33 is specifically used to: obtain a corresponding depth map according to the text image, and the depth map represents the spatial depth of the special effect text in the camera coordinate system corresponding to the text image; perform three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text; based on the three-dimensional special effect text model, generate a sequence frame animation corresponding to the special effect text.
[0115] In one embodiment of the present disclosure, when the generation module 33 generates a sequence frame animation corresponding to the special effect text based on the three-dimensional special effect text model, it is specifically used to: perform physical simulation on the three-dimensional special effect text model to obtain at least two frames of simulation images, the simulation images include three-dimensional special effect text, the three-dimensional special effect text is the projection of the three-dimensional special effect text model on the two-dimensional plane, and the three-dimensional special effect text in each simulation image has the same type of physical appearance; generate a sequence frame animation based on at least two frames of simulation images.
[0116] In one embodiment of the present disclosure, when the generation module 33 performs physical simulation on the three-dimensional special effects text model and obtains at least two frames of simulated images, it is specifically used to: obtain a target number of simulated images to be generated; based on the target number, perform physical simulation on the three-dimensional special effects text model, and based on the trigger timing of the physical simulation on the three-dimensional special effects text model, generate a corresponding simulated image, wherein the physical appearance of the three-dimensional special effects text in the simulated image is determined by the trigger timing corresponding to the simulated image.
[0117] In one embodiment of the present disclosure, the generation module 33 is further used to: segment the text image to obtain a transparent text image, which includes special effect text and a corresponding transparent background; when the generation module 33 performs three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text, it is specifically used to: perform three-dimensional processing on the transparent text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text.
[0118] The interactive module 31, the processing module 32 and the generating module 33 are connected in sequence. The text animation generating device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0119] Fig.13 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.13 As shown, the electronic device 4 includes:
[0120] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0121] The memory 42 stores computer executable instructions;
[0122] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 11 The text animation generation method in the illustrated embodiment.
[0123] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0124] For related instructions, please refer to Figure 2-Figure 11 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.
[0125] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the present invention when executed by a processor. Figure 2-Figure 11 A text animation generation method provided by any one of the corresponding embodiments.
[0126] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0127] refer to Fig.14 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure, and the electronic device 900 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.14The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0128] like Fig.14 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0129] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.14 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0130] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0131] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0132] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0133] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0134] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0137] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0138] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0139] In a first aspect, according to one or more embodiments of the present disclosure, a method for generating a text animation is provided, comprising:
[0140] In response to a first user operation, a target text and corresponding reference data are obtained, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text; a text image is generated based on the target text and the reference data, wherein the text image includes special effect text corresponding to the target text; and a text animation corresponding to the special effect text is generated based on the text image.
[0141] According to one or more embodiments of the present disclosure, the reference data includes a font file based on a target language; generating a text image based on the target text and the reference data includes: generating an input image based on the target text and the font file; generating a text image based on the input image and a generative model.
[0142] According to one or more embodiments of the present disclosure, the reference data includes texture information, and the texture information represents texture features of the input image; generating the input image according to the target text and the font file includes: obtaining a glyph outline according to the target text and the font file; and performing texture superposition on the glyph outline based on the texture information to generate the input image.
[0143] According to one or more embodiments of the present disclosure, the reference data includes mask information, and the mask information is used to characterize the display area of the input image; generating the input image according to the target text and the font file includes: obtaining a text image according to the target text and the font file; generating the input image through a mask map corresponding to the mask information and the text image.
[0144] According to one or more embodiments of the present disclosure, the method further includes: obtaining description word information in response to a second user operation; generating a text image based on the input image and the generative model includes: processing the description word information and the input image through a pre-trained generative model to generate the text image.
[0145] According to one or more embodiments of the present disclosure, before the pre-trained generative model is used to process the description word information and the input image to generate the text image, the method further includes: in response to a third user operation, configuring a model plug-in for the generative model, wherein the model plug-in is used to enable the generative model to generate an image having a target image style.
[0146] According to one or more embodiments of the present disclosure, the text animation includes at least two-dimensional skeletal animation, and the two-dimensional skeletal animation is used to display the glyph changes of the special effect text; generating the text animation corresponding to the special effect text based on the text image includes: obtaining an initial skeletal animation template, the skeletal animation template includes a skeletal model and at least one key frame, and the key frame is used to characterize the shape of the skeletal model at a corresponding moment; mapping the text image to the skeletal animation template, binding the special effect text to the skeletal model, and obtaining a two-dimensional skeletal animation corresponding to the key frame.
[0147] According to one or more embodiments of the present disclosure, the text animation includes at least a sequence frame animation, and generating the text animation corresponding to the special effect text based on the text image includes: obtaining a corresponding depth map based on the text image, the depth map representing the spatial depth of the special effect text in a camera coordinate system corresponding to the text image; performing three-dimensional processing on the text image based on the depth map to obtain a stereoscopic special effect text model corresponding to the special effect text; and generating a sequence frame animation corresponding to the special effect text based on the stereoscopic special effect text model.
[0148] According to one or more embodiments of the present disclosure, generating a sequence frame animation corresponding to the special effect text based on the three-dimensional special effect text model includes: performing physical simulation on the three-dimensional special effect text model to obtain at least two frames of simulation images, the simulation images including three-dimensional special effect text, the three-dimensional special effect text is a projection of the three-dimensional special effect text model on a two-dimensional plane, and the three-dimensional special effect text in each of the simulation images has the same type of physical appearance; generating a sequence frame animation based on the at least two frames of simulation images.
[0149] According to one or more embodiments of the present disclosure, the physical simulation is performed on the three-dimensional special effects text model to obtain at least two frames of simulated images, including: obtaining a target number of simulated images to be generated; based on the target number, the three-dimensional special effects text model is physically simulated, and based on the trigger timing of the physical simulation of the three-dimensional special effects text model, a corresponding simulated image is generated, wherein the physical appearance of the three-dimensional special effects text in the simulated image is determined by the trigger timing corresponding to the simulated image.
[0150] According to one or more embodiments of the present disclosure, the method also includes: segmenting the text image to obtain a transparent text image, wherein the transparent text image includes the special effect text and a corresponding transparent background; performing three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text, including: performing three-dimensional processing on the transparent text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text.
[0151] In a second aspect, according to one or more embodiments of the present disclosure, a text animation generating device is provided, comprising:
[0152] An interaction module, configured to obtain a target text and corresponding reference data in response to a first user operation, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text;
[0153] A processing module, configured to generate a text image according to the target text and the reference data, wherein the text image includes special effect text corresponding to the target text;
[0154] A generation module is used to generate a text animation corresponding to the special effect text according to the text image.
[0155] According to one or more embodiments of the present disclosure, the reference data includes a font file based on a target language; the processing module is specifically used to: generate an input image based on the target text and the font file; and generate a text image based on the input image and a generative model.
[0156] According to one or more embodiments of the present disclosure, the reference data includes texture information, and the texture information represents texture features of the input image; when the processing module generates the input image according to the target text and the font file, it is specifically used to: obtain a glyph outline according to the target text and the font file; and perform texture superposition on the glyph outline based on the texture information to generate the input image.
[0157] According to one or more embodiments of the present disclosure, the reference data includes mask information, and the mask information is used to characterize the display area of the input image; when the processing module generates the input image according to the target text and the font file, it is specifically used to: obtain a text image according to the target text and the font file; generate the input image through the mask map corresponding to the mask information and the text image.
[0158] According to one or more embodiments of the present disclosure, the interaction module is further used to: obtain descriptive word information in response to a second user operation; when the processing module 32 generates a text image based on the input image and the generative model, it is specifically used to: process the descriptive word information and the input image through a pre-trained generative model to generate the text image.
[0159] According to one or more embodiments of the present disclosure, before the description word information and the input image are processed by a pre-trained generative model to generate the text image, the interaction module is also used to include: in response to a third user operation, configuring a model plug-in for the generative model, wherein the model plug-in is used to enable the generative model to generate an image having a target image style.
[0160] According to one or more embodiments of the present disclosure, the text animation includes at least two-dimensional skeletal animation, and the two-dimensional skeletal animation is used to display the glyph changes of the special effect text; the generation module is specifically used to: obtain an initial skeletal animation template, and the skeletal animation template includes a skeletal model and at least one key frame, and the key frame is used to characterize the shape of the skeletal model at a corresponding moment; map the text image to the skeletal animation template, bind the special effect text to the skeletal model, and obtain a two-dimensional skeletal animation corresponding to the key frame.
[0161] According to one or more embodiments of the present disclosure, the text animation includes at least a sequence frame animation, and the generation module is specifically used to: obtain a corresponding depth map based on the text image, and the depth map represents the spatial depth of the special effect text in the camera coordinate system corresponding to the text image; perform three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text; and generate a sequence frame animation corresponding to the special effect text based on the three-dimensional special effect text model.
[0162] According to one or more embodiments of the present disclosure, when the generation module generates a sequence frame animation corresponding to the special effect text based on the three-dimensional special effect text model, it is specifically used to: perform physical simulation on the three-dimensional special effect text model to obtain at least two frames of simulation images, the simulation images include three-dimensional special effect text, the three-dimensional special effect text is the projection of the three-dimensional special effect text model on the two-dimensional plane, and the three-dimensional special effect text in each of the simulation images has the same type of physical appearance; generate a sequence frame animation based on the at least two frames of simulation images.
[0163] According to one or more embodiments of the present disclosure, when the generation module performs physical simulation on the three-dimensional special effects text model and obtains at least two frames of simulated images, it is specifically used to: obtain a target number of simulated images to be generated; based on the target number, perform physical simulation on the three-dimensional special effects text model, and generate a corresponding simulated image based on the trigger timing of the physical simulation on the three-dimensional special effects text model, wherein the physical appearance of the three-dimensional special effects text in the simulated image is determined by the trigger timing corresponding to the simulated image.
[0164] According to one or more embodiments of the present disclosure, the generation module is further used to: segment the text image to obtain a transparent text image, wherein the transparent text image includes the special effect text and a corresponding transparent background; when the generation module performs three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text, the generation module is specifically used to: perform three-dimensional processing on the transparent text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text.
[0165] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0166] The memory stores computer-executable instructions;
[0167] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text animation generation method described in the first aspect and various possible designs of the first aspect.
[0168] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the text animation generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0169] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the text animation generation method as described in the first aspect and various possible designs of the first aspect.
[0170] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0171] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0172] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A text animation generation method, characterized in that: include: In response to a first user operation, acquiring a target text and corresponding reference data, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text; Generate a text image according to the target text and the reference data, wherein the text image includes special effect text corresponding to the target text; A text animation corresponding to the special effect text is generated according to the text image.
2. The method according to claim 1, characterized in that The reference data includes a font file based on a target language; and generating a text image according to the target text and the reference data includes: Generate an input image according to the target text and the font file; A text image is generated according to the input image and the generative model.
3. The method according to claim 2, characterized in that The reference data includes texture information, and the texture information represents texture features of the input image; and generating the input image according to the target text and the font file includes: Obtaining a glyph outline according to the target text and the font file; The glyph outline is texture-superimposed based on the texture information to generate the input image.
4. The method according to claim 2, characterized in that: The reference data includes mask information, and the mask information is used to represent the display area of the input image; generating the input image according to the target text and the font file includes: Obtaining a text image according to the target text and the font file; The input image is generated by using the mask image corresponding to the mask information and the text image.
5. The method according to claim 2, characterized in that: The method further comprises: In response to a second user operation, obtaining description word information; The step of generating a text image according to the input image and the generative model comprises: The description word information and the input image are processed by a pre-trained generative model to generate the text image.
6. The method according to claim 5, characterized in that Before the pre-trained generative model is used to process the description word information and the input image to generate the text image, the method further includes: In response to a third user operation, a model plug-in is configured for the generative model, where the model plug-in is used to enable the generative model to generate an image having a target image style.
7. The method according to claim 1, characterized in that The text animation at least includes a two-dimensional skeleton animation, and the two-dimensional skeleton animation is used to show the font changes of the special effect text; the text animation corresponding to the special effect text is generated according to the text image, including: Acquire an initial skeletal animation template, wherein the skeletal animation template includes a skeletal model and at least one key frame, wherein the key frame is used to characterize the shape of the skeletal model at a corresponding moment; The text image is mapped to the skeletal animation template, the special effect text is bound to the skeletal model, and a two-dimensional skeletal animation corresponding to the key frame is obtained.
8. The method according to claim 1, characterized in that The special effect text in the text image is a plane special effect text; the text animation at least includes a sequence frame animation, and the text animation corresponding to the special effect text is generated according to the text image, including: According to the text image, a corresponding depth map is obtained, where the depth map represents the spatial depth of the special effect text in a camera coordinate system corresponding to the text image; Performing three-dimensional processing on the text image based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text; Based on the three-dimensional special effect text model, a sequence frame animation corresponding to the special effect text is generated.
9. The method according to claim 8, characterized in that The step of generating a sequence frame animation corresponding to the special effect text based on the three-dimensional special effect text model includes: Performing physical simulation on the 3D special effect text model to obtain at least two frames of simulated images, wherein the simulated images include 3D special effect text, and the 3D special effect text is a projection of the 3D special effect text model on a two-dimensional plane, and at least some of the 3D special effect text in the simulated images have the same type of physical appearance; A sequence frame animation is generated according to the at least two frames of simulated images.
10. The method according to claim 9, characterized in that The physical simulation is performed on the three-dimensional special effect text model to obtain at least two frames of simulated images, including: Obtaining a target number of simulation images to be generated; According to the target quantity, the three-dimensional special effects text model is physically simulated, and based on the trigger timing of the physical simulation of the three-dimensional special effects text model, a corresponding simulated image is generated, wherein the physical appearance of the three-dimensional special effects text in the simulated image is determined by the trigger timing corresponding to the simulated image.
11. The method according to claim 8, characterized in that The method further comprises: Segmenting the text image to obtain a transparent text image, wherein the transparent text image includes the special effect text and a corresponding transparent background; The text image is processed into three dimensions based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text, including: The transparent text image is three-dimensionalized based on the depth map to obtain a three-dimensional special effect text model corresponding to the special effect text.
12. A text animation generating device, characterized in that: include: An interaction module, configured to obtain a target text and corresponding reference data in response to a first user operation, wherein the reference data is used to indicate a font effect of a special effect text generated based on the target text; A processing module, configured to generate a text image according to the target text and the reference data, wherein the text image includes special effect text corresponding to the target text; A generating module is used to generate a text animation corresponding to the special effect text according to the text image.
13. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the text animation generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the text animation generation method according to any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the text animation generating method according to any one of claims 1 to 11 is implemented.