Special effect template generation method and apparatus, and electronic device and storage medium
By responding to user operations in the special effects editing interface, deform the identification profile of the liquefied logo, generate a liquefied special effect, and generate a target special effect template based on this, the problem of single style of the special effect template in the prior art is solved, and the generation of personalized special effect templates is realized.
Patent Information
- Application Number
- PCT/CN2024/115776
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-31
- Filing Date
- 2024-08-30
- Publication Date
- 2025-03-06
AI Technical Summary
In the prior art, users are unable to generate personalized special effect templates based on their own interests and needs, resulting in a single style of the special effect template and cannot be personalized.
By running the first editing interface, the sample image and the liquefied mark are displayed, and the identification profile of the liquefied mark is deformed in response to user operations, thereby generating a liquefied special effect in the target area of the sample image, and a target special effect template is generated based on this.
It realizes the ability of users to generate personalized special effect templates according to their own needs, solves the problem of single style of the special effect template and cannot be adjusted in personalized manner, and improves the design flexibility and personalization of the special effect templates.
Smart Images

Figure CN2024115776_06032025_PF_FP_ABST
Abstract
Description
Special effects template generation method, device, electronic device and storage medium
[0001] This application claims priority to Chinese patent application No. 202311119193.8 filed on August 31, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The embodiments of the present disclosure relate to a method, device, electronic device and storage medium for generating a special effect template. Background Art
[0003] The deformation effect for the user's appearance is the most commonly used special effect function in video and image special effect tools. By deforming the user's torso, face and other areas, it can achieve visual effects such as image beautification and funny effects.
[0004] The special effects templates of the above-mentioned deformation special effects are usually designed by software developers and fixedly configured in image processing tools for users to use. Users cannot generate personalized templates according to their own interests and needs. Therefore, there are problems such as the special effects templates being of a single style and unable to be personalized.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a special effect template generation method, device, electronic device, and storage medium to overcome the problems of a single special effect template style and the inability to be personalized.
[0007] In a first aspect, an embodiment of the present disclosure provides a method for generating a special effect template, comprising:
[0008] Run a first editing interface, in which a template image and a liquefaction marker located in the template image are displayed; in response to a first operation on the liquefaction marker, a marker outline of the liquefaction marker undergoes a first deformation; in response to the first deformation of the marker outline, a first liquefaction special effect is generated in a target area of the template image; wherein the target area is an image area in the template image covered by the marker outline of the liquefaction marker.
[0009] In a second aspect, an embodiment of the present disclosure provides a template generation device, comprising:
[0010] A display module, configured to run a first editing interface, wherein the first editing interface displays a template image and a liquefaction mark located within the template image;
[0011] an interaction module, configured to cause a first deformation of a marker outline of the liquefied marker in response to a first operation on the liquefied marker;
[0012] a processing module, configured to generate a first liquefaction effect in a target area of the template image in response to the first deformation of the marker outline; wherein the target area is an image area within the template image covered by the marker outline of the liquefied marker;
[0013] A generation module is used to generate a target special effect template based on the first liquefaction special effect.
[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0015] The memory stores computer-executable instructions;
[0016] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the template generation method described in the first aspect and various possible designs of the first aspect.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the template generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0018] 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 template generation method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, a brief introduction to the drawings required for use in the embodiments will be given 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 any creative work.
[0020] FIG1 is a diagram of an application scenario of a special effect template generation method provided by an embodiment of the present disclosure;
[0021] FIG2 is a flow chart of a method for generating a special effect template according to an embodiment of the present disclosure;
[0022] FIG3 is a schematic diagram of a first editing interface provided by an embodiment of the present disclosure;
[0023] FIG4 is a flowchart of a specific implementation of step S102 in the embodiment shown in FIG2 ;
[0024] FIG5 is a schematic diagram of adjusting a logo outline according to an embodiment of the present disclosure;
[0025] FIG6 is a schematic diagram of a mirror liquefaction mark provided by an embodiment of the present disclosure;
[0026] FIG7 is a flowchart of a specific implementation of step S103 in the embodiment shown in FIG2 ;
[0027] FIG8 is a schematic diagram of a process for generating a first liquefaction special effect provided by an embodiment of the present disclosure;
[0028] FIG9 is a schematic diagram of a process for setting adjustment parameters provided by an embodiment of the present disclosure;
[0029] FIG10 is a second flow chart of a method for generating a special effect template according to an embodiment of the present disclosure;
[0030] FIG11 is a schematic diagram of a superimposed special effect provided by an embodiment of the present disclosure;
[0031] FIG12 is a structural block diagram of a device for generating special effect templates according to an embodiment of the present disclosure;
[0032] FIG13 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure; and
[0033] FIG14 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0035] 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.
[0036] The following explains the application scenarios of the embodiments of the present disclosure:
[0037] Figure 1 is an application scenario diagram of the special effect template generation method provided by the embodiment of the present disclosure. The special effect template generation method provided by the embodiment of the present disclosure can be applied to an application with an image special effect template generation function (hereinafter referred to as a special effect editing application). More specifically, it can be applied to the application scenario of designing and making special effect templates. The execution subject of this embodiment can be a terminal device that runs the above-mentioned application with the special effect template generation function, or a server that runs the service end corresponding to the above-mentioned application, or other electronic devices that perform similar functions. Referring to Figure 1, taking the terminal device as an example, the terminal device is, for example, a smart phone. The user operates the terminal device to run the special effect editing application, and uses the special effect editing application to design and generate a personalized special effect template (such as the special effect template #1 shown in the figure). Afterwards, the personalized special effect template generated by the special effect editing application can be further uploaded to the special effect platform server and published on the special effect platform. Afterwards, when other image processing applications need to call the special effect template of the special effect platform, they can use the published personalized special effect template to add image special effects to the image. In another possible application scenario, the personalized special effects template generated by the special effects editing application can also be saved locally on the terminal device. Afterwards, the image processing application is run through the terminal to load the personalized special effects template to achieve the purpose of adding personalized image special effects to the image to be processed.
[0038] Special effects templates used to achieve image deformation effects are typically designed by software developers and fixed within image processing tools for user use. Consequently, the style and shape of these special effects templates are fixed, resulting in the same visual effects for all special effects images generated using the template, lacking differentiation and personalization. Since users cannot customize templates based on their own interests and needs, special effects templates suffer from a monotonous style and lack of customization.
[0039] The embodiments of the present disclosure provide a method for generating a special effect template to solve the above problems.
[0040] Referring to FIG2 , FIG2 is a flow chart of a method for generating a special effect template according to an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the method for generating a special effect template includes:
[0041] Step S101: running a first editing interface, wherein a template image and a liquefaction mark located in the template image are displayed in the first editing interface.
[0042] Step S102 : in response to a first operation on the liquefied mark, causing a first deformation of the mark outline of the liquefied mark.
[0043] Exemplarily, referring to the application scenario diagram shown in FIG1 , the first editing interface is an interactive interface for generating personalized special effects templates in a special effects editing application. In the first editing interface, at least a sample image and a liquefaction mark located in the sample image are displayed, wherein the sample image can be understood as a standard image used to express a deformation effect, more specifically, for example, a preset face image, and by deforming (liquefying) the sample image, the effect of the subsequently generated first liquefaction special effect is displayed, so that the user can preview the visual effect of the special effects template in real time and make corresponding adjustments. The liquefaction mark is a graphic mark used to receive user operations for interaction, more specifically, for example, it can be a circle, a square, etc. The location of the liquefaction mark is the location where the deformation special effect is generated in the image.
[0044] Furthermore, after the template image and the liquefied logo are displayed in the first editing interface, the terminal device receives the first operation input by the user for the liquefied logo, adjusts the logo outline of the liquefied logo, and causes the logo outline to undergo a first deformation, wherein the first deformation may refer to a change in the length and width ratio of the liquefied logo, or the overall expansion or contraction of the logo outline of the liquefied logo. Figure 3 is a schematic diagram of a first editing interface provided by an embodiment of the present disclosure. Referring to Figure 3, the first editing interface includes a template image, the sample image is a face picture; and a liquefied logo located above the template image, the outline shape of the liquefied logo being an ellipse. In one possible implementation, the initial position of the liquefied logo is located at the center of the template image. Thereafter, in response to the user's movement operation on the liquefied logo, the liquefied logo can be moved to other positions, such as the P1 point position shown in the figure. Furthermore, in response to a first operation on the liquefied marker, such as a drag operation on the control point of the liquefied marker, the marker outline of the liquefied marker is deformed. For example, as shown in the figure, when the first operation is a horizontal drag, the length of the liquefied marker changes from x1 in the initial state to x2, that is, a horizontal deformation of x2-x1 occurs; similarly, when the first operation is a vertical drag (not shown in the figure), the width of the liquefied marker changes from y1 in the initial state to y2, that is, a vertical deformation of y2-y1 occurs. The first deformation can be a vector representing the above deformation, more specifically, for example, a vector including the difference between x2 and x1, and the difference between y2 and y1; or, a set including lengths x1, x2 and widths y1, y2; or, a set of contour points describing the marker outline before and after deformation. The specific implementation form of the first deformation is not limited here.
[0045] In one possible implementation, the liquefaction marker includes at least one first control point and at least one second control point, the first control point is used to adjust the lateral deformation of the liquefaction marker; the second control point is used to adjust the longitudinal deformation of the liquefaction marker. Further, optionally, the liquefaction marker includes at least one third control point, and the third control point is used to adjust the overall scaling ratio of the liquefaction marker.
[0046] Exemplarily, the first operation includes a first sub-operation, a second sub-operation, and a third sub-operation. As shown in FIG4 , a specific implementation of step S102 includes:
[0047] Step S1021 : In response to the first sub-operation on the first control point, the outline of the liquefied logo is deformed horizontally.
[0048] Step S1022: In response to the second sub-operation on the second control point, the outline of the liquefied logo is deformed longitudinally.
[0049] Step S1023: In response to the third sub-operation on the third control point, the outline of the liquefied mark is expanded or reduced as a whole.
[0050] FIG5 is a schematic diagram of adjusting the outline of a logo provided by an embodiment of the present disclosure. As shown in FIG5 , the liquefied logo is an elliptical interactive logo, and the liquefied logo has two first control points P1 and P2, two second control points P3 and P4, and four third control points P5 to P8. When the terminal device receives the first sub-operation for the first control points P1 and P2, the logo outline of the liquefied logo undergoes a horizontal deformation, that is, the major axis of the ellipse of the liquefied logo changes from x1 to x2, where x1 and x2 are the distances of the first control points P1 and P2 before and after responding to the first sub-operation, respectively. Similarly, when the terminal device receives the second sub-operation for the second control points P3 and P4, the logo outline of the liquefied logo undergoes a longitudinal deformation, that is, the minor axis of the ellipse of the liquefied logo changes from y1 to y2, where y1 and y2 are the distances of the second control points P3 and P4 before and after responding to the first sub-operation, respectively. Furthermore, when the terminal device receives the third sub-operation for any of the third control points P5, P6, P7, and P8, the overall outline of the liquefied marker is expanded or reduced, that is, under the premise that the ratio of the major axis and minor axis of the ellipse of the liquefied marker remains unchanged, the major axis and minor axis of the ellipse are expanded or reduced synchronously. For example, as shown in the figure, the major axis of the ellipse of the liquefied marker is changed from x1 to 2 times x1, and the minor axis of the ellipse is changed from y1 to 2 times y1.
[0051] It should be noted that the above-mentioned first operation on the first control point, the second control point and the third control point can be individually targeted at any one or more of the first control point, the second control point and the third control point, and there is no restriction on the order of operating the first control point, the second control point and the third control point, nor is there any restriction on the number of times the first control point, the second control point and the third control point are operated. That is, the first operation input by the user can adjust any one of the first control point, the second control point and the third control point multiple times and without order restrictions to achieve the purpose of making the logo outline of the liquefied logo produce a specific first deformation, thereby achieving the purpose of personalized editing by the user.
[0052] Furthermore, in one possible implementation, after the terminal device receives a setting operation input by the user, the first function parameter component in the first editing interface can be set to an on state, i.e., another liquefaction icon, i.e., a mirrored liquefaction icon, is symmetrically displayed in the first editing interface. The mirrored liquefaction icon is used to generate a second liquefaction effect that is symmetrical to the first liquefaction effect. Figure 6 is a schematic diagram of a mirror liquefaction marker provided by an embodiment of the present disclosure. As shown in Figure 6, a first function parameter component is provided in the first editing interface, and the first function parameter component is in the "Off" state by default; after the terminal device receives the setting operation for the first function parameter component input by the user, the first function parameter component is set to the "On" state, and then the mirror liquefaction marker is displayed in the first editing interface. The mirror liquefaction marker and the liquefaction marker are symmetrical based on the central axis of the template image. After the above-mentioned first operation on the liquefaction marker causes the liquefaction marker to produce a first deformation, the mirror liquefaction marker will synchronously produce the same first deformation, and in the subsequent steps, a second liquefaction effect with the same liquefaction effect and symmetrical position is generated. The specific implementation method is the same as the implementation method of the liquefaction marker producing the first liquefaction effect, which will not be repeated here.
[0053] In this embodiment, by symmetrically displaying the mirrored liquefaction mark in the first editing interface, the purpose of synchronously and conveniently adding a second liquefaction effect symmetrical to the first liquefaction effect can be achieved without the need to separately configure the second liquefaction effect, thereby ensuring the consistency and symmetry of the second liquefaction effect symmetrical to the first liquefaction effect, thereby improving the display effect of the generated target special effects template.
[0054] Step S103: In response to the first deformation of the marker outline, generating a first liquefaction effect in a target area of the template image; wherein the target area is an image area in the template image covered by the marker outline of the liquefied marker.
[0055] Exemplarily, the first liquefaction effect is used to cause the image elements in the target area to produce a second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation. After the logo outline of the liquefaction logo produces the first deformation, the terminal device generates a corresponding liquefaction effect on the template image according to the deformation amount of the first deformation, that is, the first liquefaction effect, and the first liquefaction effect is used to cause the image elements in the target area to produce a second deformation corresponding to the deformation amount of the first deformation. Specifically, for example, the template image is a face image, and the first liquefaction effect is used to enlarge the "eyes" covered by the liquefaction logo in the face image, that is, to produce a second deformation. The second deformation is determined in direct proportion to the first deformation, that is, the larger the deformation amount of the first deformation, the larger the deformation amount of the second deformation, and conversely, the smaller the deformation amount of the first deformation, the smaller the deformation amount of the second deformation.
[0056] Furthermore, the mapping relationship between the first deformation and the second deformation can be determined based on a preset deformation function. In a possible implementation, as shown in FIG7 , the specific implementation of step S103 includes:
[0057] Step S1031: Obtain the target deformation type.
[0058] Step S1032: Obtain a corresponding deformation function according to the target deformation type.
[0059] Step S1033: Based on the deformation variable parameter representing the deformation variable of the first deformation, a deformation function is called to obtain a corresponding pixel transformation matrix, where the pixel transformation matrix is used to cause the image elements in the corresponding image area to generate a second deformation.
[0060] Step S1034: generating a first liquefaction effect in the target area of the template image according to the pixel transformation matrix.
[0061] Exemplarily, the target deformation type is the deformation type of the second deformation, including, for example, scaling, expansion, wrinkling, waving, clockwise twisting, counterclockwise twisting, and so on. The target deformation type can be determined by user input, and the specific implementation of obtaining the target deformation type is not detailed here. Subsequently, a corresponding deformation function is obtained based on the target deformation type. The deformation function is used to characterize the pattern of pixel changes in the image and adjusts the pixel values of the pixels in the image to achieve the visual effect of image deformation. Different target deformation types correspond to different deformation functions. For example, the "wrinkle" type corresponds to the deformation function fun_1(), and the "clockwise twist" type corresponds to the deformation function fun_2(). Furthermore, the deformation function uses at least the deformation variable parameters corresponding to the first deformation as input parameters, so that the deformation variable corresponding to the pixel transformation matrix output by the deformation function is related to the first deformation. The deformation variable parameters are a set of parameters generated based on the first deformation and having a specific data format, which are compatible with the deformation function. Exemplarily, the deformation variable parameters include at least one of the following: a horizontal deformation variable, a vertical deformation variable, and an overall scaling ratio. Furthermore, after converting the first deformation into deformation variable parameters, the deformation variable parameters are input into a deformation function, causing the deformation function to generate a pixel change matrix associated with the deformation variable of the first deformation. This pixel change matrix represents the mapping relationship between the initial image of the target area of the template image and the image resulting in the second deformation. Specifically, this pixel change matrix can be used to induce the second deformation in the image within the target area, thereby forming the first liquefaction effect.
[0062] Figure 8 is a schematic diagram of a process for generating a first liquefaction special effect provided by an embodiment of the present disclosure. The above process is explained below in conjunction with Figure 8. Referring to Figure 8, after obtaining the target deformation type based on user instructions, the deformation function Func_1 (shown as Func_1() in the figure) corresponding to the target deformation type is obtained. Then, the deformation variable parameter para_1 (shown as para_1 in the figure) corresponding to the first deformation is obtained. At least the deformation variable parameter para_1 is used as the input parameter of the Func_1 function. The Func_1 function is called to obtain the corresponding pixel change matrix Mat_1. The pixel change matrix Mat_1 is used to characterize the style of the second deformation generated in the target area. Then, the pixel points in the target area of the template image are processed based on the pixel change matrix Mat_1 to generate image elements with the second deformation, thereby generating the first liquefaction special effect.
[0063] Furthermore, optionally, the input parameters of the deformation function also include an adjustment parameter, which is used to characterize the intensity of the second deformation generated by the deformation function. Specifically, based on the deformation variable parameter that characterizes the deformation variable of the first deformation, the deformation function is invoked to obtain a corresponding pixel transformation matrix, where the pixel transformation matrix is used to cause the second deformation of image elements within the corresponding image region. This includes obtaining the pixel transformation matrix based on the deformation variable parameter and the adjustment parameter.
[0064] Among them, when the deformation function is different, the meaning represented by the adjustment parameter is different. For example, when the deformation function is a "wrinkle" type corresponding to the deformation function fun_1(), its corresponding adjustment parameter represents the number of "wrinkles"; for another example, when the deformation function is a "clockwise selection" type corresponding to the deformation function fun_2(), its corresponding adjustment parameter represents the angle of "rotation". More specifically, the adjustment parameter can be an integer value with a fixed value range. For example, the value range of the adjustment parameter is [0,100], where 0 indicates that the intensity of the second deformation is the smallest, and 100 indicates that the intensity of the second deformation is the largest. Figure 9 is a schematic diagram of a process for setting adjustment parameters provided by an embodiment of the present disclosure. As shown in Figure 9, a slider for setting adjustment parameters is provided in the first editing interface. When the sliding range of the slider on the slider is 0 to 100, the target deformation type corresponding to the deformation function is "wave deformation". When the slider is at 15, the corresponding second deformation intensity is the first intensity (shown as Deform_1 in the figure); when the slider is at 60, the corresponding second deformation intensity is the second intensity (shown as Deform_2 in the figure). As shown in the figure, when the slider is at 60, the intensity of the second deformation in the image is greater, that is, the generated first liquefaction effect causes a greater degree of deformation in the image.
[0065] For example, the adjustment parameter component within the first editing interface can be triggered by the user to obtain the adjustment parameter. In this embodiment, the corresponding pixel change matrix is determined by combining the deformation parameter and the adjustment parameter, enabling more precise adjustments to the second deformation style, thereby increasing the design flexibility and personalization of the target special effect template.
[0066] Step S104: Generate a target special effect template based on the first liquefaction special effect.
[0067] Exemplarily, the first liquefaction special effect can be represented based on the above-mentioned pixel change matrix and the set of coordinates of the corresponding target area. After obtaining the above-mentioned first liquefaction special effect, it is equivalent to obtaining a special effect style generated based on the user's personalized needs. After that, the pixel change matrix and the coordinates of the corresponding target area are encapsulated using the template generation component to generate the corresponding target special effect template. When the target special effect template is subsequently used, the relevant template information of the target area and the pixel change matrix described in the target special effect template is used to process the pixel points in the image area corresponding to the target area in the image to be processed based on the pixel change matrix, so that the image special effect identical to the first liquefaction effect appears in the image to be processed. The use process of the special effect template will not be repeated here.
[0068] In this embodiment, by running a first editing interface, a template image and a liquefaction marker located within the template image are displayed within the first editing interface; in response to a first operation on the liquefaction marker, a first deformation is generated in the marker outline of the liquefaction marker; in response to the first deformation of the marker outline, a first liquefaction effect is generated in a target area of the template image; wherein the target area is the image area within the template image that is covered by the marker outline of the liquefaction marker, and the first liquefaction effect is used to cause the image elements within the target area to produce a second deformation, the deformation amount of the second deformation corresponding to the deformation amount of the first deformation; based on the first liquefaction effect, a target special effects template is generated. By controlling the liquefaction marker within the first editing interface, a first deformation is generated on the sample image, thereby mapping it to the first liquefaction effect, and generating a target special effects template corresponding to the first liquefaction effect, thereby realizing personalized special effects template generation based on user operations, and solving problems such as the single style of special effects templates and the inability to personalize and adjust them.
[0069] Referring to Figure 10, Figure 10 is a second flow chart of the special effect template generation method provided by the embodiment of the present disclosure. Based on the embodiment shown in Figure 2, this embodiment further refines step S101 and adds steps such as generating a superimposed special effect template. The special effect template generation method includes:
[0070] Step S201: displaying a special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, wherein the template component is used to display a template library including at least one pre-generated special effect template.
[0071] Step S202: In response to a triggering operation on the editing component, running the first editing interface.
[0072] Exemplarily, referring to the application scenario diagram shown in FIG1 , after running the special effects editing application, the special effects editing panel can be displayed first. The special effects editing panel is the upper interface of the first editing interface in the embodiment shown in FIG2 . In the special effects editing panel, at least one template component and an editing component are provided, wherein, on the one hand, the template component is used to display a template library including at least one pre-generated special effects template. In one possible implementation, after the template component is triggered based on a user operation, a third editing page will pop up, and a plurality of different special effects templates will be displayed in the third editing page. In another possible implementation, the template component can directly display the pre-generated special effects panel in a designated area within the special effects editing panel, so that the user can directly select a special effects template from the template library from the special effects editing panel. The pre-generated special effects templates are stored by the template component, so that the user can load different special effects templates for secondary editing or superposition combination by triggering the template component. On the other hand, in response to the triggering operation on the editing component, the first editing interface is run, thereby executing the subsequent steps of generating personalized templates based on the first editing interface.
[0073] Step S203 : in response to the first operation on the liquefied mark, causing a first deformation of the mark outline of the liquefied mark.
[0074] Step S204: In response to the first deformation of the marker outline, a first liquefaction effect is generated in the target area of the template image; wherein the target area is the image area covered by the marker outline of the liquefied marker in the template image, and the first liquefaction effect is used to cause the image elements in the target area to produce a second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation.
[0075] Step S205: Generate a target special effect template based on the first liquefaction special effect.
[0076] Step S205A: In response to the fourth operation, setting the first function parameter and / or the second function parameter of the target special effect template;
[0077] Among them, the first function parameter is used to turn on the symmetrical deformation function of the target special effects template, and the symmetrical deformation function is used to generate a second liquefaction special effect symmetrical to the first liquefaction special effect based on the image to be processed; the second function parameter is used to turn on the special effects tracking function of the target special effects template, and the special effects tracking function is used to dynamically set the position of the target area so that the target area tracks the target image element in the image to be processed.
[0078] Exemplarily, after generating the target special effects template, the template function of the target special effects template can be further set. Specifically, in response to the fourth operation, the first function parameter and / or the second function parameter of the target special effects template are set. Exemplarily, a function control for setting the first function parameter and the second function parameter is provided in the special effects editing panel. By setting the function control to the on (On) state or the off (Off) state in response to the fourth operation, the first function parameter and / or the second function parameter are realized. Among them, exemplarily, when the first function parameter is set to a parameter value representing the on state, the symmetrical deformation function of the target special effects template is turned on. After the symmetrical deformation function is turned on, when the target special effects template is used, a second liquefaction effect symmetrical to the first liquefaction effect will be generated in the image to be processed, that is, the liquefaction effect corresponding to the mirror liquefaction identifier in the steps of the above embodiment. For the specific implementation method, please refer to the relevant introduction to the second liquefaction effect in the embodiment shown in Figure 6, which will not be repeated here.
[0079] Furthermore, when the second function parameter is set to a parameter value representing the on state, the special effect tracking function of the target special effect template is turned on. After the special effect tracking function is turned on, when the camera is used for shooting preview and the target special effect template is used, the first liquefaction special effect, or the first liquefaction special effect and the second liquefaction special effect in the target special effect template will automatically track the target image elements, such as the eyes and cheeks of a person's face. That is, the target area corresponding to the first liquefaction special effect will dynamically change according to the image content of the image to be processed, so that the first liquefaction special effect produces a dynamic following visual effect. Among them, the specific implementation method of performing image recognition according to the image content of the image to be processed and tracking the identified target image elements will not be repeated here.
[0080] Step S206: configuring the target special effect template into the template library corresponding to the template component.
[0081] Furthermore, after generating the target special effects template, the target special effects template can be stored in the template library corresponding to the template component in the special effects editing panel by manual triggering or automatic triggering, so that when the user operates the template component, the target special effects template created based on the above steps can be obtained from the template library corresponding to the target component.
[0082] Step S207: running the second editing interface.
[0083] Step S208: In response to the second operation, at least two superimposed special effect templates are added in the second editing interface, wherein the at least two superimposed special effect templates include a target special effect template, and each special effect template is located in a different layer.
[0084] Furthermore, after generating a target special effect template, other special effect templates can be further superimposed based on the generated target special effect template to generate a superimposed special effect template, thereby achieving a superimposed special effect with a mixture of multiple special effects. Specifically, for example, an editing control for triggering a second editing interface is provided in the special effect editing panel. After the editing control is triggered in response to a user operation, the second editing interface is run. Similar to the first editing interface, the second editing interface also displays a sample image for previewing the special effect visual effect, such as a facial image. In one possible implementation, a loading control for loading special effect templates is provided in the second editing interface. After the loading control is triggered, at least two special effect templates can be loaded in sequence, including the target special effect template. Each special effect template is located in a different layer and superimposed on each other. After the at least two special effect templates are loaded, the sample image displays the first liquefaction special effect (or also the second liquefaction special effect) corresponding to the target special effect template and the special effects corresponding to the other special effect templates. The special effect formed by superimposing the first liquefaction special effect and the special effects corresponding to the other special effect templates is the superimposed special effect.
[0085] Figure 11 is a schematic diagram of a superimposed special effect provided by an embodiment of the present disclosure. As shown in Figure 11, after loading special effect templates template_1 and template_2 in the second editing interface, special effect #1 corresponding to special effect template template_1 and special effect #2 corresponding to special effect template template_2 are displayed on the sample image. For example, special effect #1 is a first liquefaction special effect generated based on the steps of the above embodiment, i.e., a custom special effect for enlarging the "mouth"; special effect #2 is an in-app preset special effect for changing facial shape (e.g., a "slim face" special effect); superimposing special effect #1 and special effect #2 may produce the visual effect of the superimposed special effect shown in the figure.
[0086] Optionally, after step S208, the method further includes:
[0087] Step S209: In response to the third operation on the second editing interface, the layer sequence and / or transparency of each special effect template is set.
[0088] For example, after adding a special effect template, each special effect template can be further configured so that the generated superimposed special effect presents different visual effects. Specifically, the terminal device sets the transparency of each special effect template in response to a third operation on the second editing interface, such as a third operation on a slider control within the second editing interface; and sets the image sequence of each special effect template for the editable text box corresponding to each special effect template within the second editing interface. In the steps of this embodiment, by further configuring the layer sequence and transparency of each special effect template in response to the third operation on the second editing interface, the superimposed special effect has richer and more diverse visual effects, thereby enhancing the visual expressiveness of the superimposed special effect template.
[0089] Step S210: generating a superimposed special effect template based on at least two superimposed special effect templates.
[0090] Furthermore, after the special effects template is loaded and adjusted, an overlay special effects template can be generated based on multiple superimposed special effects templates. The overlay special effects template is used in the same way as the target special effects template generated in the previous step, that is, by calling the overlay special effects template, the corresponding overlay special effects synthesized by superimposing multiple special effects can be added to the image to be processed. The specific implementation steps are omitted.
[0091] Furthermore, similar to the target special effects template, after generating the overlay special effects template, the overlay special effects template can be stored in the template library corresponding to the template component in the special effects editing panel by manual triggering or automatic triggering, so as to achieve further superposition of other special effects templates on the basis of the overlay special effects template, and realize a more style-rich overlay special effects template.
[0092] In this embodiment, the implementation of steps S203 to S205 is the same as the implementation of steps S102 to S104 in the embodiment shown in FIG. 2 of the present disclosure, and will not be described in detail here.
[0093] Corresponding to the special effect template generation method of the above embodiment, FIG12 is a structural block diagram of the special effect template generation device provided by the embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Referring to FIG12, the special effect template generation device 3 includes:
[0094] The display module 31 is used to run a first editing interface, in which a sample image and a liquefaction mark located in the sample image are displayed;
[0095] The interaction module 32 is configured to generate a first deformation of the outline of the liquefied mark in response to a first operation on the liquefied mark;
[0096] a processing module 33 configured to generate a first liquefaction effect in a target area of the template image in response to the first deformation of the marker outline; wherein the target area is an image area within the template image covered by the marker outline of the liquefied marker, and the first liquefaction effect is configured to cause a second deformation of image elements within the target area, the deformation amount of the second deformation corresponding to the deformation amount of the first deformation;
[0097] The generating module 34 is configured to generate a target special effect template based on the first liquefaction special effect.
[0098] In one embodiment of the present disclosure, the liquefaction mark includes at least one first control point and at least one second control point, the first control point is used to adjust the lateral deformation of the liquefaction mark; the second control point is used to adjust the longitudinal deformation of the liquefaction mark; the interaction module 32 is specifically used to: in response to a first operation on the first control point and / or the second control point, cause the mark outline of the liquefaction mark to produce a lateral deformation and / or a longitudinal deformation.
[0099] In one embodiment of the present disclosure, the liquefied marker includes at least one third control point, which is used to adjust the overall scaling ratio of the liquefied marker; the interactive module 32 is specifically used to: in response to a first operation on the third control point, expand or shrink the marker outline of the liquefied marker as a whole.
[0100] In one embodiment of the present disclosure, the display module 31 is specifically used to: display a special effect editing panel, the special effect editing panel is provided with at least one template component and an editing component, wherein the template component is used to display a template library including at least one pre-generated special effect template; in response to a trigger operation on the editing component, run a first editing interface.
[0101] In one embodiment of the present disclosure, the generating module 34 is further configured to: after generating the target special effect template, configure the target special effect template into a template library corresponding to the template component.
[0102] In one embodiment of the present disclosure, the display module 31 is further used to: run a second editing interface, in which a template image is displayed; the generation module 34 is further used to: in response to a second operation, add at least two superimposed special effects templates in the second editing interface, wherein the at least two superimposed special effects templates include a target special effects template, and each special effects template is located in a different layer; and generate a superimposed special effects template based on the at least two superimposed special effects templates.
[0103] In one embodiment of the present disclosure, the generating module 34 is further configured to: in response to a third operation on the second editing interface, set the layer sequence and / or transparency of each special effect template.
[0104] In one embodiment of the present disclosure, the generation module 34 is further used to: in response to the fourth operation, set the first functional parameter and / or the second functional parameter of the target special effects template; wherein the first functional parameter is used to turn on the symmetrical deformation function of the target special effects template, and the symmetrical deformation function is used to generate a second liquefaction special effect symmetrical to the first liquefaction special effect based on the image to be processed; the second functional parameter is used to turn on the special effects tracking function of the target special effects template, and the special effects tracking function is used to dynamically set the position of the target area so that the target area tracks the target image element in the image to be processed.
[0105] In one embodiment of the present disclosure, the processing module 33 is specifically used to: obtain a target deformation type; obtain a corresponding deformation function according to the target deformation type; call the deformation function based on the deformation variable parameter representing the deformation variable of the first deformation to obtain a corresponding pixel transformation matrix, and the pixel transformation matrix is used to cause the image elements in the corresponding image area to produce a second deformation; and generate a first liquefaction effect in the target area of the template image according to the pixel transformation matrix.
[0106] In one embodiment of the present disclosure, the processing module 33 is further used to: obtain adjustment parameters corresponding to the deformation function, the adjustment parameters are used to characterize the intensity of the second deformation generated by the deformation function; the processing module 33 calls the deformation function based on the deformation variable parameters that characterize the deformation variable of the first deformation to obtain the corresponding pixel transformation matrix, and the pixel transformation matrix is used to cause the image elements in the corresponding image area to produce the second deformation, and is specifically used to: obtain the pixel transformation matrix based on the deformation variable parameters and the adjustment parameters.
[0107] In one embodiment of the present disclosure, the deformation parameter includes at least one of the following: a lateral deformation, a longitudinal deformation, and an overall scaling ratio.
[0108] The display module 31, interaction module 32, processing module 33 and generation module 34 are connected in sequence. The special effect template generation 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 repeated in this embodiment.
[0109] FIG13 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG12 , the electronic device 4 includes:
[0110] A processor 41, and a memory 42 communicatively connected to the processor 41;
[0111] Memory 42 stores computer-executable instructions;
[0112] The processor 41 executes the computer-executable instructions stored in the memory 42 to implement the special effect template generation method in the embodiments shown in Figures 2 to 11.
[0113] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .
[0114] The relevant explanations can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to Figures 2 to 11, and no further details will be given here.
[0115] An embodiment of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the special effects template generation method provided in any of the embodiments corresponding to Figures 2 to 11 of the present disclosure.
[0116] In order to implement the above embodiment, the embodiment of the present disclosure further provides an electronic device.
[0117] Referring to FIG14 , there is shown a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure. 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, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG14 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0118] As shown in FIG14 , 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 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. 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.
[0119] Typically, the following devices can be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 can allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG14 shows an electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0120] 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 includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the 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 performed.
[0121] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, 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 that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport 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 thereof.
[0122] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0123] 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.
[0124] 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 a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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).
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two 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 box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0127] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and 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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0128] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can 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 can 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.
[0129] In a first aspect, according to one or more embodiments of the present disclosure, a method for generating a special effect template is provided, comprising:
[0130] Run a first editing interface, in which a template image and a liquefaction marker located in the template image are displayed; in response to a first operation on the liquefaction marker, the marker outline of the liquefaction marker undergoes a first deformation; in response to the first deformation of the marker outline, a first liquefaction special effect is generated in a target area of the template image; wherein, the target area is an image area in the template image covered by the marker outline of the liquefaction marker, and the first liquefaction special effect is used to cause the image elements in the target area to undergo a second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation; based on the first liquefaction special effect, a target special effect template is generated.
[0131] According to one or more embodiments of the present disclosure, the liquefaction mark includes at least one first control point and at least one second control point, the first control point is used to adjust the lateral deformation of the liquefaction mark; the second control point is used to adjust the longitudinal deformation of the liquefaction mark; the response to the first operation on the liquefaction mark causes the mark contour of the liquefaction mark to produce a first deformation, including: responding to the first operation on the first control point and / or the second control point, causing the mark contour of the liquefaction mark to produce a lateral deformation and / or a longitudinal deformation.
[0132] According to one or more embodiments of the present disclosure, the liquefied logo includes at least one third control point, and the third control point is used to adjust the overall scaling ratio of the liquefied logo; the response to the first operation on the liquefied logo causes the logo outline of the liquefied logo to produce a first deformation, including: responding to the first operation on the third control point, causing the logo outline of the liquefied logo to expand or shrink as a whole.
[0133] According to one or more embodiments of the present disclosure, running the first editing interface includes: displaying a special effect editing panel, the special effect editing panel being provided with at least one template component and an editing component, wherein the template component is used to display a template library including at least one pre-generated special effect template; and running the first editing interface in response to a triggering operation on the editing component.
[0134] According to one or more embodiments of the present disclosure, the method further includes: after generating the target special effect template, configuring the target special effect template into a template library corresponding to the template component.
[0135] According to one or more embodiments of the present disclosure, the method also includes: running a second editing interface; in response to a second operation, adding at least two superimposed special effects templates in the second editing interface, wherein the at least two superimposed special effects templates include the target special effects template, and each of the special effects templates is located in a different layer; based on the at least two superimposed special effects templates, generating a superimposed special effects template.
[0136] According to one or more embodiments of the present disclosure, the method further includes: setting the layer sequence and / or transparency of each of the special effect templates in response to a third operation on the second editing interface.
[0137] According to one or more embodiments of the present disclosure, the method further includes: in response to a fourth operation, setting a first functional parameter and / or a second functional parameter of the target special effects template; wherein the first functional parameter is used to turn on the symmetrical deformation function of the target special effects template, and the symmetrical deformation function is used to generate a second liquefaction special effect symmetrical to the first liquefaction special effect based on the image to be processed; the second functional parameter is used to turn on the special effects tracking function of the target special effects template, and the special effects tracking function is used to dynamically set the position of the target area so that the target area tracks the target image element in the image to be processed.
[0138] According to one or more embodiments of the present disclosure, generating a first liquefaction effect in a target area of the template image in response to the first deformation of the identification contour includes: obtaining a target deformation type; obtaining a corresponding deformation function according to the target deformation type; calling the deformation function based on a deformation variable parameter representing the deformation variable of the first deformation to obtain a corresponding pixel transformation matrix, the pixel transformation matrix being used to cause image elements in a corresponding image area to produce the second deformation; and generating a first liquefaction effect in the target area of the template image according to the pixel transformation matrix.
[0139] According to one or more embodiments of the present disclosure, the method further includes: obtaining an adjustment parameter corresponding to the deformation function, the adjustment parameter being used to characterize the intensity of the second deformation generated by the deformation function; calling the deformation function based on the deformation variable parameter characterizing the first deformation to obtain a corresponding pixel transformation matrix, the pixel transformation matrix being used to cause the image elements in the corresponding image area to generate the second deformation, including: obtaining a pixel transformation matrix based on the deformation variable parameter and the adjustment parameter.
[0140] In a second aspect, according to one or more embodiments of the present disclosure, a special effect template generation device is provided, comprising:
[0141] A display module, configured to run a first editing interface, wherein the first editing interface displays a template image and a liquefaction mark located within the template image;
[0142] an interaction module, configured to cause a first deformation of a marker outline of the liquefied marker in response to a first operation on the liquefied marker;
[0143] a processing module configured to generate a first liquefaction effect in a target area of the template image in response to the first deformation of the marker outline; wherein the target area is an image area within the template image covered by the marker outline of the liquefied marker, and the first liquefaction effect is configured to cause image elements within the target area to generate a second deformation, wherein the deformation amount of the second deformation corresponds to the deformation amount of the first deformation;
[0144] A generation module is used to generate a target special effect template based on the first liquefaction special effect.
[0145] According to one or more embodiments of the present disclosure, the liquefaction mark includes at least one first control point and at least one second control point, the first control point is used to adjust the lateral deformation of the liquefaction mark; the second control point is used to adjust the longitudinal deformation of the liquefaction mark; the interaction module is specifically used to: in response to a first operation on the first control point and / or the second control point, cause the mark contour of the liquefaction mark to produce a lateral deformation and / or a longitudinal deformation.
[0146] According to one or more embodiments of the present disclosure, the liquefied logo includes at least one third control point, and the third control point is used to adjust the overall scaling ratio of the liquefied logo; the interactive module is specifically used to: in response to a first operation on the third control point, expand or reduce the logo outline of the liquefied logo as a whole.
[0147] According to one or more embodiments of the present disclosure, the display module is specifically used to: display a special effect editing panel, the special effect editing panel is provided with at least one template component and an editing component, wherein the template component is used to display a template library including at least one pre-generated special effect template; and run a first editing interface in response to a trigger operation on the editing component.
[0148] According to one or more embodiments of the present disclosure, the generation module is further configured to: after generating the target special effect template, configure the target special effect template into a template library corresponding to the template component.
[0149] According to one or more embodiments of the present disclosure, the display module is further used to: run a second editing interface, in which a template image is displayed; the generation module is further used to: in response to a second operation, add at least two superimposed special effects templates in the second editing interface, wherein the at least two superimposed special effects templates include the target special effects template, and each of the special effects templates is located in a different layer; and generate a superimposed special effects template based on the at least two superimposed special effects templates.
[0150] According to one or more embodiments of the present disclosure, the generating module is further configured to: in response to a third operation on the second editing interface, set the layer sequence and / or transparency of each special effect template.
[0151] According to one or more embodiments of the present disclosure, the generation module is further used to: in response to a fourth operation, set the first functional parameter and / or second functional parameter of the target special effects template; wherein the first functional parameter is used to turn on the symmetrical deformation function of the target special effects template, and the symmetrical deformation function is used to generate a second liquefaction special effect symmetrical to the first liquefaction special effect based on the image to be processed; the second functional parameter is used to turn on the special effects tracking function of the target special effects template, and the special effects tracking function is used to dynamically set the position of the target area so that the target area tracks the target image element in the image to be processed.
[0152] According to one or more embodiments of the present disclosure, the processing module is specifically used to: obtain a target deformation type; obtain a corresponding deformation function based on the target deformation type; call the deformation function based on a deformation variable parameter that characterizes the deformation variable of the first deformation to obtain a corresponding pixel transformation matrix, and the pixel transformation matrix is used to cause the image elements in the corresponding image area to produce the second deformation; and generate a first liquefaction effect in the target area of the template image based on the pixel transformation matrix.
[0153] According to one or more embodiments of the present disclosure, the processing module is further used to: obtain adjustment parameters corresponding to the deformation function, and the adjustment parameters are used to characterize the intensity of the second deformation generated by the deformation function; the processing module calls the deformation function based on the deformation variable parameters that characterize the deformation variable of the first deformation to obtain the corresponding pixel transformation matrix, and the pixel transformation matrix is used to cause the image elements in the corresponding image area to produce the second deformation, and is specifically used to: obtain the pixel transformation matrix based on the deformation variable parameters and the adjustment parameters.
[0154] According to one or more embodiments of the present disclosure, the deformation parameter includes at least one of the following: a lateral deformation, a longitudinal deformation, and an overall scaling ratio.
[0155] 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;
[0156] The memory stores computer-executable instructions;
[0157] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the special effect template generation method described in the first aspect and various possible designs of the first aspect.
[0158] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the special effects template generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0159] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the special effects template generation method described in the first aspect and various possible designs of the first aspect.
[0160] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. 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 the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0161] 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 have been 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.
[0162] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for generating a special effect template, comprising: Running a first editing interface, wherein a template image and a liquefaction mark located in the template image are displayed in the first editing interface; In response to a first operation on the liquefied mark, causing a mark outline of the liquefied mark to generate a first deformation; In response to the first deformation of the logo outline, generating a first liquefaction effect in a target area of the template image, wherein the target area is an image area in the template image covered by the logo outline of the liquefied logo; Based on the first liquefaction special effect, a target special effect template is generated.
2. The method according to claim 1, wherein: The liquefaction mark includes at least one first control point and at least one second control point, wherein the first control point is used to adjust the lateral deformation amount of the liquefaction mark; and the second control point is used to adjust the longitudinal deformation amount of the liquefaction mark; The step of causing a first deformation of a logo outline of the liquefied logo in response to a first operation on the liquefied logo comprises: In response to a first operation on the first control point and / or the second control point, a logo contour of the liquefied logo is deformed horizontally and / or vertically.
3. The method according to claim 1, wherein: The liquefaction mark includes at least one third control point, and the third control point is used to adjust the overall scaling ratio of the liquefaction mark; The step of causing a first deformation of a logo outline of the liquefied logo in response to a first operation on the liquefied logo comprises: In response to the first operation on the third control point, the outline of the liquefied mark is expanded or reduced as a whole.
4. The method according to any one of claims 1 to 3, wherein: The running of the first editing interface includes: Displaying a special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, wherein the template component is used to display a template library including at least one pre-generated special effect template; In response to a trigger operation on the editing component, a first editing interface is run.
5. The method according to claim 4, further comprising: After the target special effect template is generated, the target special effect template is configured into a template library corresponding to the template component.
6. The method according to any one of claims 1 to 5, further comprising: Run the second editing interface; In response to the second operation, at least two superimposed special effect templates are added in the second editing interface, wherein the at least two superimposed special effect templates include the target special effect template, and each of the special effect templates is located in a different layer; Based on the at least two mutually superimposed special effect templates, a superimposed special effect template is generated.
7. The method according to claim 6, further comprising: In response to a third operation on the second editing interface, a layer sequence and / or transparency of each of the special effect templates is set.
8. The method according to any one of claims 1 to 7, further comprising: In response to the fourth operation, setting the first function parameter and / or the second function parameter of the target special effect template; The first function parameter is used to enable the symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used to generate a second liquefaction special effect symmetrical to the first liquefaction special effect based on the image to be processed; The second function parameter is used to enable the special effect tracking function of the target special effect template, and the special effect tracking function is used to dynamically set the position of the target area so that the target area tracks the target image element in the image to be processed.
9. The method according to any one of claims 1 to 8, wherein: The first liquefaction special effect is used to cause the image elements in the target area to generate a second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation; The step of generating a first liquefaction effect in a target area of the template image in response to the first deformation of the logo outline comprises: Get the target deformation type; According to the target deformation type, a corresponding deformation function is obtained; Based on a deformation variable parameter representing the deformation variable of the first deformation, calling the deformation function to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used to cause the image elements in the corresponding image area to generate the second deformation; A first liquefaction effect is generated in a target area of the template image according to the pixel transformation matrix.
10. The method according to claim 9, further comprising: Acquire an adjustment parameter corresponding to the deformation function, where the adjustment parameter is used to characterize the intensity of the second deformation generated by the deformation function; The step of calling the deformation function based on the deformation parameter representing the deformation of the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used to cause the image elements in the corresponding image area to generate the second deformation, comprises: A pixel transformation matrix is obtained based on the deformation amount parameters and the adjustment parameters.
11. The method according to claim 9, wherein: The deformation parameter includes at least one of the following: Horizontal deformation, vertical deformation, overall scaling.
12. A special effect template generating device, comprising: A display module is configured to run a first editing interface, wherein the first editing interface displays a template image and a liquefaction mark located in the template image; An interaction module is configured to cause a first deformation of a logo outline of the liquefied logo in response to a first operation on the liquefied logo; A processing module, configured to generate a first liquefaction effect in a target area of the template image in response to a first deformation of the logo outline, wherein the target area is an image area in the template image covered by the logo outline of the liquefied logo; The generation module is configured to generate a target special effect template based on the first liquefaction special effect.
13. An electronic device comprising a processor and a memory, wherein: The memory stores computer-executable instructions; When the processor executes the computer-executable instructions stored in the memory, the processor executes the special effect template generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing computer-executable instructions, wherein: When the processor executes the computer-executable instruction, the special effect template generation method as described in any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the special effect template generation method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Mouth shape adjustment method and device, live broadcast method and device, electronic equipment and storage medium
CN111652023A
Special effect data packet generation method and device, image processing method and device, equipment and storage medium
CN113709549A
Special effect prop processing method and device, electronic equipment and storage medium
CN115379136A
Special effect template generation method and device, electronic equipment and storage medium
CN117151973A
Data generation method, image processing method, apparatuses, device, and storage medium
WO2023030550A1