CN117151973A - Special effect template generation method and device, electronic equipment and storage medium - Google Patents

Special effect template generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117151973A
CN117151973A CN202311119193.8A CN202311119193A CN117151973A CN 117151973 A CN117151973 A CN 117151973A CN 202311119193 A CN202311119193 A CN 202311119193A CN 117151973 A CN117151973 A CN 117151973A
Authority
CN
China
Prior art keywords
special effect
deformation
liquefaction
template
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311119193.8A
Other languages
Chinese (zh)
Inventor
伍伊慧
尚凤仪
吴越前
李海镔
叶林曦
杨舒云
陈沙利
何国劲
王瑛珂
周洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202311119193.8A priority Critical patent/CN117151973A/en
Publication of CN117151973A publication Critical patent/CN117151973A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure provides a special effect template generation method, a device, electronic equipment and a storage medium, wherein a first editing interface is operated, and a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface; in response to a first operation on the liquefaction signature, causing a first deformation of a signature profile of the liquefaction signature; generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image; based on the first liquefied effect, a target effect template is generated. By controlling the liquefaction mark in the first editing interface, a target special effect template corresponding to the first liquefaction special effect is generated, and the problems that the special effect template is single in style, cannot be adjusted in a personalized mode and the like are solved.

Description

Special effect template generation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of the internet of things, in particular to a special effect template generation method, a special effect template generation device, electronic equipment and a storage medium.
Background
Aiming at the deformed special effect of the appearance of a user, the tool is a special effect function which is most commonly used in video and image special effect function tools, and the visual effects such as image beautification, strangeness and the like are realized by deforming the areas such as the trunk, the face and the like of the user.
In the prior art, the special effect template for deforming the special effect is usually designed and fixedly configured in an image processing tool by a software developer for a user to use, and the user cannot generate a personalized template according to own interests and needs, so that the problems of single special effect template style, incapability of personalized adjustment and the like exist.
Disclosure of Invention
The embodiment of the disclosure provides a special effect template generation method, a device, electronic equipment and a storage medium, which are used for solving the problems that the special effect template is single in style, cannot be adjusted individually and the like.
In a first aspect, an embodiment of the present disclosure provides a method for generating a special effect template, including:
running a first editing interface, wherein a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface; generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo; generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image.
In a second aspect, an embodiment of the present disclosure provides a template generating apparatus, including:
the display module is used for operating a first editing interface, and a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface;
an interaction module for generating a first deformation of an identification profile of the liquefaction identification in response to a first operation on the liquefaction identification;
a processing module for generating a first liquefied special effect at a target area of the template image in response to a first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image;
and the generating module is used for generating a target special effect template based on the first liquefied special effect.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to cause the at least one processor to perform the template generation method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the template generation method according to the first aspect and the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the template generation method according to the first aspect and the various possible designs of the first aspect.
According to the special effect template generation method, the special effect template generation device, the electronic equipment and the storage medium, through running a first editing interface, a sample image and a liquefaction mark in the sample image are displayed in the first editing interface; generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo; generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image; and generating a target special effect template based on the first liquefied special effect. By controlling the liquefaction mark in the first editing interface, first deformation is generated on the sample image, so that the first liquefaction special effect is mapped to generate a target special effect template corresponding to the first liquefaction special effect, personalized special effect template generation based on user operation is realized, and the problems that the special effect template is single in style and cannot be adjusted individually are solved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present disclosure, and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
Fig. 1 is an application scenario diagram of a special effect template generating method provided in an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a special effect template generating method according to an embodiment of the disclosure;
FIG. 3 is a schematic diagram of a first editing interface provided by an embodiment of the present disclosure;
FIG. 4 is a flowchart of a specific implementation of step S102 in the embodiment shown in FIG. 2;
FIG. 5 is a schematic diagram of an adjustment mark profile provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a mirrored liquefaction tag according to an embodiment of the present disclosure;
FIG. 7 is a flowchart of a specific implementation of step S103 in the embodiment shown in FIG. 2;
FIG. 8 is a schematic diagram of a process for generating a first liquefaction special effect provided by embodiments of the present disclosure;
FIG. 9 is a schematic diagram of a process for setting adjustment parameters according to an embodiment of the disclosure;
fig. 10 is a second flowchart of a special effect template generating method according to an embodiment of the present disclosure;
FIG. 11 is a schematic diagram of a superimposed special effect provided by an embodiment of the present disclosure;
fig. 12 is a block diagram of a specific effect template generating apparatus according to an embodiment of the present disclosure;
fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure;
fig. 14 is a schematic hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) related to the present disclosure are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and be provided with corresponding operation entries for the user to select authorization or rejection.
The application scenario of the embodiments of the present disclosure is explained below:
fig. 1 is an application scenario diagram of a special effect template generating method provided by an embodiment of the present disclosure, where the special effect template generating method provided by the embodiment of the present disclosure may be applied to an application program (hereinafter referred to as a special effect editing application) having an image special effect template generating function, and more specifically, may be applied to an application scenario for designing and making a special effect template. The execution body of the embodiment may be a terminal device running the application program with the special effect template generating function, a server running a server corresponding to the application program, or other electronic devices playing similar functions. Referring to fig. 1, taking a terminal device as an example, the terminal device is a smart phone, a user operates a special effect editing application through the terminal device, designs and generates a personalized special effect template (for example, a special effect template #1 shown in the figure) through the special effect editing application, and then, the personalized special effect template generated through the special effect editing application can be further uploaded to a special effect platform server and released on a special effect platform. And then, when other image processing applications need to call the special effect template of the special effect platform, the issued personalized special effect template can be used for adding the image special effect to the image. In another possible application scenario, the personalized special effect template generated by the special effect editing application can also be stored locally in the terminal equipment, and then the terminal runs the image processing application to load the personalized special effect template, so that the purpose of adding the personalized image special effect to the image to be processed is realized.
In the prior art, a special effect template for realizing the special effect of image deformation is usually designed and fixedly configured in an image processing tool by a software developer for users to use, so that the special effect pattern and the shape of the special effect template are fixed, and the visual effect of deformed special effects is the same in all special effect images generated by using the special effect template, and the differences and individuation cannot be shown. Because the user can not generate the personalized template according to the interests and the needs, the problems that the special effect template is single in style, cannot be personalized and adjusted and the like exist.
The embodiment of the disclosure provides a special effect template generation method to solve the problems.
Referring to fig. 2, fig. 2 is a schematic flow chart of a special effect template generating method according to an embodiment of the disclosure. The method of the embodiment can be applied to terminal equipment, and the special effect template generation method comprises the following steps:
step S101: and running a first editing interface, wherein a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface.
Step S102: in response to a first operation on the liquefaction marker, a marker profile of the liquefaction marker is subjected to a first deformation.
Illustratively, referring to the application scenario diagram shown in fig. 1, the first editing interface is an interactive interface for generating personalized special effects templates in the special effects editing application. At least a template image and a liquefaction mark positioned in the template image are displayed in the first editing interface, wherein the template image can be understood as a standard image for representing deformation effects, more specifically, a preset face image, and the effect of a first liquefaction special effect generated later is displayed by deforming (liquefying) the sample image, so that a user can preview the visual effect of the special effect template in real time and correspondingly adjust the visual effect. The liquefaction mark is a graphic mark for receiving user operation for interaction, and more specifically, the liquefaction mark can be a ring, a square or the like, and the position of the liquefaction mark is the position where the deformation special effect is generated in the image.
Further, after the sample image and the liquefaction mark are displayed in the first editing interface, the terminal equipment receives a first operation input by a user for the liquefaction mark, adjusts the mark outline of the liquefaction mark, and enables the mark outline to generate first deformation, wherein the first deformation can be that the length and the money proportion of the liquefaction mark are changed, and the mark outline of the liquefaction mark can be integrally expanded or contracted. Fig. 3 is a schematic diagram of a first editing interface provided by an embodiment of the present disclosure, and referring to fig. 3, a sample image is included in the first editing interface, where the sample image is a face picture; and a liquefying mark positioned on the template image, wherein the contour shape of the liquefying mark is elliptical. In one possible implementation, the initial position of the liquefaction mark is located at the center of the template image, and then, in response to a movement operation of the liquefaction mark by the user, the liquefaction mark may be moved to another position, such as a P1 point position shown in the figure. Further, in response to a first operation on the liquefied logo, for example, a drag operation on a control point of the liquefied logo, deforming a logo outline of the liquefied logo, for example, as shown in the figure, when the first operation is a transverse drag, the length of the liquefied logo is changed from x1 to x2 in an initial state, namely, a transverse deformation of x2-x1 is generated; similarly, when the first operation is a longitudinal drag (not shown in the drawing), the width of the liquefied logo is changed from y1 in the initial state to y2, i.e., longitudinal deformation of y2-y1 is generated. Wherein the first deformation may be a vector characterizing the deformation described above, more specifically, for example, a vector comprising the difference between x2 and x1, the difference between y2 and y 1; or, a set comprising lengths x1, x2 and widths y1, y 2; still alternatively, a set of contour points identifying contours before and after deformation is described. The specific implementation form of the first deformation is not limited here.
In one possible implementation, the liquefaction signature comprises at least one first control point for adjusting the amount of lateral deformation of the liquefaction signature and at least one second control point; the second control point is used to adjust the amount of longitudinal deformation of the liquefaction signature, and further optionally, the liquefaction signature includes at least one third control point for adjusting the overall scaling of the liquefaction signature.
Illustratively, the first operation includes a first sub-operation, a second sub-operation, and a third sub-operation, as shown in fig. 4, a specific implementation of step S102 includes:
step S1021: in response to a first sub-operation for the first control point, the identification profile of the liquefaction identification is laterally deformed.
Step S1022: in response to a second sub-operation for the second control point, the identification profile of the liquefied identification is deformed longitudinally.
Step S1023: in response to a third sub-operation for a third control point, the identification profile of the liquefaction identification is expanded or contracted entirely.
Fig. 5 is a schematic diagram of an adjustment mark contour according to an embodiment of the present disclosure, as shown in fig. 5, a liquefaction mark is an oval interactive mark, and the liquefaction mark has two first control points P1 and P2, two second control points P3 and P4, and four third control points P5 to P8. After the terminal device receives the first sub-operation for the first control points P1 and P2, the mark outline of the liquefied mark is transversely deformed, that is, the oval long axis of the liquefied mark is changed from x1 to x2, wherein x1 and x2 are the distance between the first control points P1 and P2 before responding to the first sub-operation and the distance between the first control points P1 and P2 after responding to the first sub-operation. Similarly, when the terminal device receives the second sub-operation for the second control points P3 and P4, the marker outline of the liquefaction marker is deformed longitudinally, that is, the elliptical short axis of the liquefaction marker is changed from y1 to y2, where y1 and y2 are the distance before the second control points P3 and P4 respond to the first sub-operation and the distance after the second control points P3 and P4 respond to the first sub-operation, respectively. Further, after the terminal device receives the third sub-operation for any one of the third control points P5, P6, P7, and P8, the overall outline of the liquefied logo expands or contracts, that is, the oval major axis and the minor axis of the liquefied logo expand or contract synchronously on the premise that the ratio of the oval major axis to the minor axis of the liquefied logo is unchanged, for example, as shown in the figure, the oval major axis of the liquefied logo is changed from x1 to 2 times x1, and the oval minor axis is changed from y1 to 2 times y1.
The first operations for the first control point, the second control point, and the third control point may be any one or more of the first control point, the second control point, and the third control point, and the order of operating the first control point, the second control point, and the third control point is not limited, and the number of times of operating the first control point, the second control point, and the third control point, that is, the first operations input by the user, may be multiple times, and any one of the first control point, the second control point, and the third control point may be adjusted without order limitation, so as to achieve the purpose of generating a specific first deformation of the identification profile of the liquefaction identification, thereby achieving the purpose of personalized editing of the user.
Further, in one possible implementation manner, after the terminal device receives the setting operation input by the user, the first function parameter component in the first editing interface may set the first function parameter component to an on state, that is, so that another liquefaction identifier, that is, the mirror image liquefaction identifier, is symmetrically displayed in the first editing interface. Wherein the mirrored liquefaction identification is used to generate a second liquefaction effect that is symmetrical to the first liquefaction effect. FIG. 6 is a schematic diagram of a mirror image liquefaction identifier provided in an embodiment of the present disclosure, where, as shown in FIG. 6, a first function parameter component is disposed in a first editing interface, and the first function parameter component defaults to an "Off" state; after the terminal equipment receives the setting operation of the first functional parameter component input by the user, setting the first functional parameter component to be in an On state, displaying a mirror image liquefaction mark in a first editing interface, wherein the mirror image liquefaction mark and the liquefaction mark are symmetrical based On the central axis of the template image, after the first operation of the liquefaction mark is performed to generate first deformation On the liquefaction mark, the mirror image liquefaction mark synchronously generates the same first deformation, and in the following steps, a second liquefaction special effect with the same liquefaction special effect and symmetrical position is generated, and the specific implementation mode is the same as that of the liquefaction mark for generating the first liquefaction special effect, and is not repeated here.
In this embodiment, by symmetrically displaying the mirror image liquefaction identifier in the first editing interface, the purpose of synchronously and conveniently adding the second liquefaction special effect symmetrical to the first liquefaction special effect can be achieved, without separately configuring the second liquefaction special effect, and the consistency and symmetry of the second liquefaction special effect symmetrical to the first liquefaction special effect are ensured, so that the display effect of the generated target special effect template is improved.
Step S103: generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefying identification in the template image.
The first liquefaction special effect is used for generating a second deformation of the image element in the target area, wherein the deformation quantity of the second deformation corresponds to the deformation quantity of the first deformation. After the first deformation is generated on the identification outline of the liquefaction identification, the terminal equipment generates a corresponding liquefaction special effect, namely a first liquefaction special effect, on the sample image according to the deformation amount of the first deformation, wherein the first liquefaction special effect is used for enabling the image elements in the target area to generate second deformation corresponding to the deformation amount of the first deformation. Specifically, for example, the template image is, for example, a face image, and the first liquefaction special effect is used for magnifying an "eye" covered by the liquefaction mark in the face image, that is, generating a second deformation. The second deformation is determined by the first deformation in a proportional manner, namely, the larger the deformation amount of the first deformation is, the larger the deformation amount of the second deformation is, otherwise, the smaller the deformation amount of the first deformation is, and the smaller the deformation amount of the second deformation is.
Further, the mapping relationship between the first deformation and the second deformation may be determined based on a preset deformation function. In one possible implementation, as shown in fig. 7, the specific implementation of step S103 includes:
step S1031: and obtaining the target deformation type.
Step S1032: and obtaining a corresponding deformation function according to the target deformation type.
Step S1033: and calling a deformation function based on deformation parameters of deformation representing the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling the image elements in the corresponding image area to generate second deformation.
Step S1034: and generating a first liquefaction special effect in a target area of the sample image according to the pixel transformation matrix.
Illustratively, the target deformation type is a deformation type of the second deformation, including, for example, scaling, expansion, buckling, waviness, clockwise twist, counterclockwise twist, and the like. The target deformation type may be determined by an operation instruction input by the user, and a specific implementation manner of obtaining the target deformation type is not described herein. And obtaining a corresponding deformation function according to the target deformation type, wherein the deformation function is used for representing the rule of change of pixel points in the image, and the visual effect of image deformation is realized by adjusting the pixel values of the pixel points in the image. Wherein different target deformation types correspond to different deformation functions, e.g., a "fold" type corresponds to deformation function fun_1 (), "clockwise warp" type corresponds to deformation function fun_2 (). Further, the deformation function takes at least a deformation parameter corresponding to the first deformation as an input parameter, so that a deformation corresponding to a pixel transformation matrix output by the deformation function is related to the first deformation. The deformation quantity parameter is a parameter set which is generated based on the first deformation and has a specific data format, and is matched with the deformation function. Illustratively, the deformation parameter comprises at least one of: the amount of lateral deformation, the amount of longitudinal deformation, and the overall scaling. Further, after the first deformation is converted into the deformation quantity parameter, the deformation quantity parameter is input into the deformation function, so that the deformation function generates a pixel change matrix related to the deformation quantity of the first deformation, the pixel change matrix characterizes a mapping relation between an initial image of a target area of the template image and an image generating the second deformation, namely, the image in the target area can generate the second deformation through the pixel change matrix, and therefore the first liquefaction special effect is formed.
Fig. 8 is a schematic diagram of a process for generating a first liquefied special effect according to an embodiment of the present disclosure, and the above process is described below with reference to fig. 8, and referring to fig. 8, after a target deformation type is obtained based on a user instruction, a deformation function func_1 (shown as func_1 ()) corresponding to the target deformation type is obtained, then a deformation parameter para_1 (shown as para_1 in the drawing) corresponding to the first deformation is obtained, at least the deformation parameter para_1 is used as an input parameter of the func_1 function, the func_1 function is called to obtain a corresponding pixel change matrix mat_1, the pixel change matrix mat_1 is used for representing a pattern of a second deformation generated in a target area, and then pixel points in the target area of a template image are processed based on the pixel change matrix mat_1, so as to generate image elements with the second deformation, thereby generating the first liquefied special effect.
Further optionally, the input parameters of the deformation function further include adjustment parameters, where the adjustment parameters are used to characterize the strength of the second deformation generated by the deformation function. Namely, based on deformation parameters of deformation representing the first deformation, invoking a deformation function to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate second deformation, and the method comprises the following steps: and obtaining a pixel transformation matrix based on the deformation parameters and the adjustment parameters.
When the deformation functions are different, the meaning represented by the adjustment parameters is different, for example, when the deformation function is a "fold" type corresponding to the deformation function fun_1 (), the corresponding adjustment parameters represent the number of "folds"; for another example, when the morphing function is a "select clockwise" type corresponding to morphing function fun_2 (), its corresponding adjustment parameter characterizes the angle of "rotation". More specifically, the adjustment parameter may be an integer having a fixed value interval, e.g., the adjustment parameter has a value interval of [0,100], where 0 represents the minimum intensity of the second deformation and 100 represents the maximum intensity of the second deformation. Fig. 9 is a schematic diagram of a process of setting adjustment parameters according to an embodiment of the present disclosure, as shown in fig. 9, a sliding rod for setting adjustment parameters is disposed in a first editing interface, and when a slidable section of a sliding block on the sliding rod is 0 to 100, a target deformation type corresponding to a deformation function is "wave deformation". When the slider is at 15, the corresponding second deformation has a first strength (shown as deformation_1); when the slider is at 60, the corresponding second deformation has a second strength (shown as deformation_2). As shown in the figure, when the slider is positioned at 60, the intensity of the second deformation generated in the image is made larger, i.e., the generated first liquefaction effect makes the image deformed to a higher degree.
Illustratively, the tuning parameters within the first editing interface may be obtained by a user triggering the tuning parameter component. In the step of this embodiment, the deformation parameters and the adjustment parameters are used to determine the corresponding pixel change matrix, so that finer adjustment of the second deformation pattern can be achieved, and the design flexibility and individuation degree of the target special effect template are improved.
Step S104: based on the first liquefied effect, a target effect template is generated.
The first liquefied special effect may be represented based on the pixel change matrix and the set of coordinates of the corresponding target region, after obtaining the first liquefied special effect, which is equivalent to obtaining a special effect pattern generated based on the personalized requirement of the user, and then the template generating component is used to package the pixel change matrix and the coordinates of the corresponding target region, so as to generate the corresponding target special effect template. When the target special effect template is used subsequently, the pixel points in the image area corresponding to the target area in the image to be processed are processed based on the pixel change matrix by describing the related template information of the target area and the pixel change matrix in the target special effect template, so that the image special effect identical to the first liquefying effect appears in the image to be processed. The use of special effect templates is known to those skilled in the art and will not be described in detail herein.
In the embodiment, by running a first editing interface, a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface; in response to a first operation on the liquefaction signature, causing a first deformation of a signature profile of the liquefaction signature; generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the template image, the first liquefaction special effect is used for enabling image elements in the target area to generate second deformation, and the deformation amount of the second deformation corresponds to that of the first deformation; based on the first liquefied effect, a target effect template is generated. By controlling the liquefaction mark in the first editing interface, first deformation is generated on the sample image, so that the first liquefaction special effect is mapped to generate a target special effect template corresponding to the first liquefaction special effect, personalized special effect template generation based on user operation is realized, and the problems that the special effect template is single in style and cannot be adjusted individually are solved.
Referring to fig. 10, fig. 10 is a second flowchart of a special effect template generating method according to an embodiment of the disclosure. The embodiment further refines step S101 and adds steps of generating a superimposed special effect template on the basis of the embodiment shown in fig. 2, and the special effect template generating method includes:
Step S201: and displaying the special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, and the template component is used for displaying a template library comprising at least one pre-generated special effect template.
Step S202: and responding to the triggering operation for the editing component, and running the first editing interface.
For example, referring to the application scenario diagram shown in fig. 1, after the special effects editing application is run, a special effects editing panel, which is an upper level interface of the first editing interface in the embodiment shown in fig. 2, may be displayed first. In the special effect editing panel, at least one template component and an editing component are arranged, wherein on one hand, the template component is used for displaying a template library comprising at least one pre-generated special effect template, in one possible implementation mode, after the template component is triggered based on user operation, a third editing page is popped up, a plurality of different special effect templates are displayed in the third editing page, and in another possible implementation mode, the template component can directly display the pre-generated special effect panel in a designated area in the special effect editing panel, so that a user can directly select the special effect template in the template library from the special effect editing panel. The template component is used for storing the pre-generated special effect templates, so that a user can load different special effect templates to carry out secondary editing or superposition combination by triggering the template component. On the other hand, in response to a triggering operation for the editing component, the first editing interface is operated, so that the subsequent step of generating the personalized template is executed based on the first editing interface.
Step S203: in response to a first operation on the liquefaction marker, a marker profile of the liquefaction marker is subjected to a first deformation.
Step S204: generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the template image, the first liquefaction special effect is used for enabling image elements in the target area to generate second deformation, and deformation amount of the second deformation corresponds to that of the first deformation.
Step S205: based on the first liquefied effect, a target effect template is generated.
Step S205A: setting the first function parameter and/or the second function parameter of the target special effect template in response to the fourth operation;
the first functional parameter is used for starting a symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used for generating 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 for starting a special effect tracking function of the target special effect template, and the special effect tracking function is used for dynamically setting the position of the target area so that the target area tracks target image elements in the image to be processed.
Illustratively, after the target special effects template is generated, the template function of the target special effects template may 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, illustratively, a function control for setting the first function parameter and the second function parameter is set in the special effects editing panel, and in response to the fourth operation, the function control is set to an On (On) state or an Off (Off) state to implement the first function parameter and/or the second function parameter. When the first function parameter is set to a parameter value representing an on state, for example, a symmetrical deformation function of the target special effect template is started, and after the symmetrical deformation function is started, a second liquefaction special effect symmetrical to the first liquefaction special effect is generated in the image to be processed when the target special effect template is used, that is, the liquefaction special effect corresponding to the mirror image liquefaction identifier in the step of the embodiment is generated. The specific implementation manner may be referred to as the description of the second liquefaction special effect in the embodiment shown in fig. 6, and will not be described herein.
Further, 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 started, after the special effect tracking function is started, the camera is used for shooting preview, and when the target special effect template is used, the first liquefied special effect in the target special effect template, or the first liquefied special effect and the second liquefied special effect can automatically track target image elements, such as eyes, cheeks and the like of a human face. Namely, the target area corresponding to the first liquefaction special effect dynamically changes according to the image content of the image to be processed, so that the first liquefaction special effect generates a dynamically following visual effect. The specific implementation manner of performing image recognition according to the image content of the image to be processed and tracking the identified target image element is the prior art, and will not be described herein.
Step S206: and configuring the target special effect template into a template library corresponding to the template component.
Further, after the target special effect template is generated, the target special effect template can be stored in a template library corresponding to the template component in the special effect editing panel in a manual triggering or automatic triggering mode, so that when a user operates the template component, the target special effect template created based on the steps can be obtained from the template library corresponding to the target component.
Step S207: and running a second editing interface.
Step S208: and responding to a second operation, and adding at least two mutually overlapped special effect templates in a second editing interface, wherein the at least two mutually overlapped special effect templates comprise target special effect templates, and each special effect template is positioned on different layers.
Further, after the target special effect template is generated, other special effect templates can be further overlapped based on the generated target special effect template, so that an overlapped special effect template is generated, and an overlapped special effect of mixing various special effects is realized. Specifically, for example, in the special effect editing panel, an editing control for triggering the second editing interface is provided, and after the editing control is triggered in response to a user operation, the second editing interface is operated, and similar to the first editing interface, a sample image for previewing the special effect, for example, a face image is also displayed in the second editing interface. In a possible implementation manner, a loading control for loading the special effect templates is arranged in the second editing interface, after the loading control is triggered, at least two special effect templates can be loaded in sequence, wherein the special effect templates comprise the target special effect templates, the special effect templates are positioned on different layers and are mutually overlapped, after the loading of the at least two special effect templates is completed, a first liquefied special effect (or a second liquefied special effect) corresponding to the target special effect templates and special effects corresponding to other special effect templates are displayed on a sample image, and the special effect formed by overlapping the first liquefied special effect and the special effects corresponding to other special effect templates is an overlapped special effect.
Fig. 11 is a schematic diagram of a superimposed special effect provided in the embodiment of the present disclosure, as shown in fig. 11, after the special effect template template_1 and the special effect template_2 are loaded in the second editing interface, respectively, special effect #1 corresponding to the special effect template template_1 and special effect #2 corresponding to the special effect template template_2 are displayed on the sample image. Wherein, illustratively, effect #1 is the first liquefied effect generated based on the steps of the above embodiments, i.e. the custom effect, for amplifying the "mouth"; effect #2 is an in-application preset effect for changing the shape of a face (e.g., "thin-face effect"); after the effects #1 and #2 are superimposed, a visual effect of the superimposed effects as shown in the figure may be generated.
Optionally, after step S208, the method further includes:
step S209: and setting the layer sequence and/or transparency of each special effect template in response to a third operation aiming at the second editing interface.
For example, after adding the special effect templates, the special effect templates may be further set, so that the generated superimposed special effects exhibit different visual effects, and specifically, the terminal device sets transparency of each special effect template in response to a third operation for the second editing interface, for example, a third operation for a slide bar (slider) control in the second editing interface; and setting an image sequence of each special effect template aiming at the editable text box corresponding to each special effect template in the second editing interface. In the step of this embodiment, the layer sequence and transparency of each special effect template are further set in response to the third operation for the second editing interface, so that the superimposed special effect has a richer and more various visual effects, and the visual expressive force of the superimposed special effect template is improved.
Step S210: and generating a superimposed special effect template based on at least two mutually superimposed special effect templates.
Further, after the special effect template is loaded and adjusted, a superimposed special effect template can be generated based on a plurality of mutually superimposed special effect templates, the use mode of the superimposed special effect template is the same as that of the target special effect template generated in the previous step, namely, a corresponding superimposed special effect synthesized by superimposing a plurality of special effects can be added in the image to be processed by calling the superimposed special effect template, and the specific implementation mode is repeated.
Further, similar to the target special effect template, after the overlapped special effect template is generated, the overlapped special effect template can be stored in a template library corresponding to a template component in the special effect editing panel in a manual triggering or automatic triggering mode, so that other special effect templates are further overlapped on the basis of the overlapped special effect template, and the overlapped special effect template with more abundant styles is realized.
In this embodiment, the implementation manner of step S203 to step S205 is the same as the implementation manner of step S102 to step S104 in the embodiment shown in fig. 2 of the present disclosure, and will not be described in detail here.
Corresponding to the special effect template generation method of the above embodiment, fig. 12 is a block diagram of the structure of the special effect template generation apparatus provided by the embodiment of the present disclosure. For ease of illustration, only portions relevant to embodiments of the present disclosure are shown. Referring to fig. 12, the special effect template generating apparatus 3 includes:
The display module 31 is used for running a first editing interface, and the first editing interface displays a template image and a liquefaction mark in the template image;
an interaction module 32 for, in response to a first operation on the liquefaction signature, generating a first deformation of the signature profile of the liquefaction signature;
a processing module 33 for generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the template image, the first liquefaction special effect is used for enabling image elements in the target area to generate second deformation, and the deformation amount of the second deformation corresponds to that of the first deformation;
the generating module 34 is configured to generate a target special effect template based on the first liquefied special effect.
In one embodiment of the present disclosure, the liquefaction signature includes at least one first control point for adjusting a lateral deformation of the liquefaction signature and at least one second control point; the second control point is used for adjusting the longitudinal deformation amount of the liquefaction mark; the interaction module 32 is specifically configured to: in response to a first operation for the first control point and/or the second control point, the identification profile of the liquefied identification is laterally deformed and/or longitudinally deformed.
In one embodiment of the present disclosure, the liquefaction signature includes at least one third control point for adjusting the overall scale of the liquefaction signature; the interaction module 32 is specifically configured to: in response to a first operation for a third control point, the identification profile of the liquefaction identification is expanded or contracted entirely.
In one embodiment of the present disclosure, the display module 31 is specifically configured to: displaying a special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, and the template component is used for displaying a template library comprising at least one pre-generated special effect template; and responding to the triggering operation for the editing component, and running the first editing interface.
In one embodiment of the present disclosure, the generating module 34 is further configured to: after the target special effect template is generated, the target special effect template is configured into a template library corresponding to the template component.
In one embodiment of the present disclosure, the display module 31 is further configured to: operating a second editing interface, wherein a sample image is displayed in the second editing interface; the generating module 34 is further configured to: responding to a second operation, and adding at least two mutually overlapped special effect templates in a second editing interface, wherein the at least two mutually overlapped special effect templates comprise target special effect templates, and each special effect template is positioned on different layers; and generating a superimposed special effect template based on at least two mutually superimposed special effect templates.
In one embodiment of the present disclosure, the generating module 34 is further configured to: and setting the layer sequence and/or transparency of each special effect template in response to a third operation aiming at the second editing interface.
In one embodiment of the present disclosure, the generating module 34 is further configured to: setting the first function parameter and/or the second function parameter of the target special effect template in response to the fourth operation; the first functional parameter is used for starting a symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used for generating 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 for starting a special effect tracking function of the target special effect template, and the special effect tracking function is used for dynamically setting the position of the target area so that the target area tracks target image elements in the image to be processed.
In one embodiment of the present disclosure, the processing module 33 is specifically configured to: obtaining a target deformation type; obtaining a corresponding deformation function according to the target deformation type; based on deformation parameters representing deformation of the first deformation, invoking a deformation function to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate second deformation; and generating a first liquefaction special effect in a target area of the sample image according to the pixel transformation matrix.
In one embodiment of the present disclosure, the processing module 33 is further configured to: obtaining an adjustment parameter corresponding to the deformation function, wherein the adjustment parameter is used for representing the strength of the second deformation generated by the deformation function; the processing module 33 invokes a deformation function based on deformation parameters representing deformation amounts of the first deformation to obtain a corresponding pixel transformation matrix, where the pixel transformation matrix is specifically configured to: and obtaining a pixel transformation matrix based on the deformation parameters and the adjustment parameters.
In one embodiment of the present disclosure, the deformation parameters include at least one of: the amount of lateral deformation, the amount of longitudinal deformation, and the overall scaling.
The display module 31, the interaction module 32, the processing module 33 and the generating module 34 are sequentially connected. The special effect template generating device 3 provided in this embodiment may execute the technical scheme of the foregoing method embodiment, and its implementation principle and technical effect are similar, and this embodiment will not be described herein again.
Fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, as shown in fig. 12, where the electronic device 4 includes:
a processor 41 and a memory 42 communicatively connected to the processor 41;
Memory 42 stores computer-executable instructions;
processor 41 executes computer-executable instructions stored in memory 42 to implement the special effects template generation method in the embodiment shown in fig. 2-11.
Wherein optionally the processor 41 and the memory 42 are connected by a bus 43.
The relevant descriptions and effects corresponding to the steps in the embodiments corresponding to fig. 2 to 11 may be understood correspondingly, and are not described in detail herein.
The embodiments of the present disclosure provide a computer readable storage medium, in which computer executable instructions are stored, where the computer executable instructions, when executed by a processor, are configured to implement the special effect template generating method provided in any one of the embodiments corresponding to fig. 2 to 11 of the present disclosure.
In order to achieve the above embodiments, the embodiments of the present disclosure further provide an electronic device.
Referring to fig. 14, there is shown a schematic structural diagram of an electronic device 900 suitable for use in implementing embodiments of the present disclosure, which electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (Personal Digital Assistant, PDA for short), a tablet (Portable Android Device, PAD for short), a portable multimedia player (Portable Media Player, PMP for short), an in-vehicle terminal (e.g., an in-vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 14 is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 14, the electronic apparatus 900 may include a processing device (e.g., a central processor, a graphics processor, or the like) 901, which may 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 (Random Access Memory, RAM) 903. In the RAM 903, various programs and data necessary 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 through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
In general, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 907 including, for example, a liquid crystal display (Liquid Crystal Display, LCD for short), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device 900 to communicate wirelessly or by wire with other devices to exchange data. While fig. 14 shows an electronic device 900 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When executed by the processing device 901, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above-described embodiments.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (Local Area Network, LAN for short) or a wide area network (Wide Area Network, WAN for short), or it may be connected to an external computer (e.g., connected via the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a special effect template generating method, including:
running a first editing interface, wherein a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface; generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo; generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image, the first liquefaction special effect is used for enabling image elements in the target area to generate second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation; and generating a target special effect template based on the first liquefied special effect.
According to one or more embodiments of the present disclosure, the liquefaction signature includes at least one first control point and at least one second control point, the first control point being for adjusting a lateral deformation amount of the liquefaction signature; the second control point is used for adjusting the longitudinal deformation amount of the liquefaction mark; the generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo, comprising: in response to a first operation for the first control point and/or the second control point, the identification profile of the liquefaction identification is laterally deformed and/or longitudinally deformed.
According to one or more embodiments of the present disclosure, the liquefaction signature includes at least one third control point for adjusting an overall scale of the liquefaction signature; the generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo, comprising: in response to a first operation for the third control point, the identification profile of the liquefaction identification is expanded or contracted entirely.
According to one or more embodiments of the present disclosure, the running 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, and the template component is used for displaying a template library comprising at least one pre-generated special effect template; and responding to the triggering operation for the editing component, and running a first editing interface.
According to one or more embodiments of the present disclosure, the method further comprises: after the target special effect template is generated, the target special effect template is configured into a template library corresponding to the template component.
According to one or more embodiments of the present disclosure, the method further comprises: operating a second editing interface; responding to a second operation, and adding at least two mutually overlapped special effect templates in the second editing interface, wherein the at least two mutually overlapped special effect templates comprise the target special effect templates, and each special effect template is positioned on different layers; and generating a superimposed special effect template based on the at least two mutually superimposed special effect templates.
According to one or more embodiments of the present disclosure, the method further comprises: and setting a layer sequence and/or transparency of each special effect template in response to a third operation for the second editing interface.
According to one or more embodiments of the present disclosure, the method further comprises: setting the first function parameter and/or the second function parameter of the target special effect template in response to a fourth operation; the first function parameter is used for starting a symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used for generating a second liquefaction special effect symmetrical to the first liquefaction special effect based on an image to be processed; the second function parameter is used for starting a special effect tracking function of the target special effect template, and the special effect tracking function is used for dynamically setting the position of the target area so that the target area tracks target image elements in an image to be processed.
According to one or more embodiments of the present disclosure, the generating a first liquefaction effect at a target region of the template image in response to the first deformation of the identification profile includes: obtaining a target deformation type; obtaining a corresponding deformation function according to the target deformation type; invoking the deformation function based on deformation parameters representing deformation of the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate the second deformation; and generating a first liquefaction special effect in a target area of the sample image according to the pixel transformation matrix.
According to one or more embodiments of the present disclosure, the method further comprises: acquiring adjustment parameters corresponding to the deformation function, wherein the adjustment parameters are used for representing the strength of the second deformation generated by the deformation function; the step of calling the deformation function based on deformation parameters of deformation representing the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate the second deformation, and the step of generating the second deformation comprises the following steps: and obtaining a pixel transformation matrix based on the deformation parameter and the adjustment parameter.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a special effect template generating apparatus, including:
the display module is used for operating a first editing interface, and a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface;
an interaction module for generating a first deformation of an identification profile of the liquefaction identification in response to a first operation on the liquefaction identification;
a processing module for generating a first liquefied special effect at a target area of the template image in response to a first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image, the first liquefaction special effect is used for enabling image elements in the target area to generate second deformation, and the deformation amount of the second deformation corresponds to the deformation amount of the first deformation;
And the generating module is used for generating a target special effect template based on the first liquefied special effect.
According to one or more embodiments of the present disclosure, the liquefaction signature includes at least one first control point and at least one second control point, the first control point being for adjusting a lateral deformation amount of the liquefaction signature; the second control point is used for adjusting the longitudinal deformation amount of the liquefaction mark; the interaction module is specifically configured to: in response to a first operation for the first control point and/or the second control point, the identification profile of the liquefaction identification is laterally deformed and/or longitudinally deformed.
According to one or more embodiments of the present disclosure, the liquefaction signature includes at least one third control point for adjusting an overall scale of the liquefaction signature; the interaction module is specifically configured to: in response to a first operation for the third control point, the identification profile of the liquefaction identification is expanded or contracted entirely.
According to one or more embodiments of the present disclosure, the display module is specifically configured to: displaying a special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, and the template component is used for displaying a template library comprising at least one pre-generated special effect template; and responding to the triggering operation for the editing component, and running a first editing interface.
According to one or more embodiments of the present disclosure, the generating module is further configured to: after the target special effect template is generated, the target special effect template is configured into a template library corresponding to the template component.
According to one or more embodiments of the present disclosure, the display module is further configured to: operating a second editing interface, wherein a sample image is displayed in the second editing interface; the generating module is further configured to: responding to a second operation, and adding at least two mutually overlapped special effect templates in the second editing interface, wherein the at least two mutually overlapped special effect templates comprise the target special effect templates, and each special effect template is positioned on different layers; and generating a superimposed special effect template based on the at least two mutually superimposed special effect templates.
According to one or more embodiments of the present disclosure, the generating module is further configured to: and setting a layer sequence and/or transparency of each special effect template in response to a third operation for the second editing interface.
According to one or more embodiments of the present disclosure, the generating module is further configured to: setting the first function parameter and/or the second function parameter of the target special effect template in response to a fourth operation; the first function parameter is used for starting a symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used for generating a second liquefaction special effect symmetrical to the first liquefaction special effect based on an image to be processed; the second function parameter is used for starting a special effect tracking function of the target special effect template, and the special effect tracking function is used for dynamically setting the position of the target area so that the target area tracks target image elements in an image to be processed.
According to one or more embodiments of the present disclosure, the processing module is specifically configured to: obtaining a target deformation type; obtaining a corresponding deformation function according to the target deformation type; invoking the deformation function based on deformation parameters representing deformation of the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate the second deformation; and generating a first liquefaction special effect in a target area of the sample image according to the pixel transformation matrix.
According to one or more embodiments of the present disclosure, the processing module is further configured to: acquiring adjustment parameters corresponding to the deformation function, wherein the adjustment parameters are used for representing the strength of the second deformation generated by the deformation function; the processing module invokes the deformation function to obtain a corresponding pixel transformation matrix based on deformation parameters representing deformation of the first deformation, where the pixel transformation matrix is used to generate the second deformation for image elements in a corresponding image area, and the processing module is specifically configured to: and obtaining a pixel transformation matrix based on the deformation parameter and the adjustment parameter.
According to one or more embodiments of the present disclosure, the deformation parameters include at least one of: the amount of lateral deformation, the amount of longitudinal deformation, and the overall scaling.
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 memory;
the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory, causing the at least one processor to perform the special effects template generation method as described above in the first aspect and the various possible designs of the first aspect.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the special effects template generation method as described above in the first aspect and the various possible designs of the first aspect.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the special effect template generation method according to the first aspect and the various possible designs of the first aspect.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to 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 example forms of implementing the claims.

Claims (15)

1. The special effect template generation method is characterized by comprising the following steps of:
running a first editing interface, wherein a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface;
generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo;
generating a first liquefied special effect at a target area of the template image in response to the first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image;
and generating a target special effect template based on the first liquefied special effect.
2. The method of claim 1, wherein the liquefaction signature comprises at least one first control point and at least one second control point, the first control point being used to adjust the amount of lateral deformation of the liquefaction signature; the second control point is used for adjusting the longitudinal deformation amount of the liquefaction mark;
The generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo, comprising:
in response to a first operation for the first control point and/or the second control point, the identification profile of the liquefaction identification is laterally deformed and/or longitudinally deformed.
3. The method of claim 1, wherein the liquefaction signature comprises at least one third control point for adjusting an overall scale of the liquefaction signature;
the generating a first deformation of the logo outline of the liquefaction logo in response to a first operation on the liquefaction logo, comprising:
in response to a first operation for the third control point, the identification profile of the liquefaction identification is expanded or contracted entirely.
4. The method of claim 1, wherein the running the first editing interface comprises:
displaying a special effect editing panel, wherein the special effect editing panel is provided with at least one template component and an editing component, and the template component is used for displaying a template library comprising at least one pre-generated special effect template;
and responding to the triggering operation for the editing component, and running a first editing interface.
5. The method according to claim 4, wherein the method further comprises:
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 claim 1, wherein the method further comprises:
operating a second editing interface;
responding to a second operation, and adding at least two mutually overlapped special effect templates in the second editing interface, wherein the at least two mutually overlapped special effect templates comprise the target special effect templates, and each special effect template is positioned on different layers;
and generating a superimposed special effect template based on the at least two mutually superimposed special effect templates.
7. The method of claim 6, wherein the method further comprises:
and setting a layer sequence and/or transparency of each special effect template in response to a third operation for the second editing interface.
8. The method according to claim 1, wherein the method further comprises:
setting the first function parameter and/or the second function parameter of the target special effect template in response to a fourth operation;
the first function parameter is used for starting a symmetrical deformation function of the target special effect template, and the symmetrical deformation function is used for generating a second liquefaction special effect symmetrical to the first liquefaction special effect based on an image to be processed;
The second function parameter is used for starting a special effect tracking function of the target special effect template, and the special effect tracking function is used for dynamically setting the position of the target area so that the target area tracks target image elements in an image to be processed.
9. The method of claim 1, wherein the first liquefaction effect is used to produce a second deformation of the image element within the target region, the second deformation having an amount of deformation corresponding to an amount of deformation of the first deformation; said generating a first liquefied special effect at a target area of said template image in response to a first deformation of said identification profile, comprising:
obtaining a target deformation type;
obtaining a corresponding deformation function according to the target deformation type;
invoking the deformation function based on deformation parameters representing deformation of the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate the second deformation;
and generating a first liquefaction special effect in a target area of the sample image according to the pixel transformation matrix.
10. The method according to claim 9, wherein the method further comprises:
Acquiring adjustment parameters corresponding to the deformation function, wherein the adjustment parameters are used for representing the strength of the second deformation generated by the deformation function;
the step of calling the deformation function based on deformation parameters of deformation representing the first deformation to obtain a corresponding pixel transformation matrix, wherein the pixel transformation matrix is used for enabling image elements in a corresponding image area to generate the second deformation, and the step of generating the second deformation comprises the following steps:
and obtaining a pixel transformation matrix based on the deformation parameter and the adjustment parameter.
11. The method of claim 9, wherein the deformation parameters include at least one of:
the amount of lateral deformation, the amount of longitudinal deformation, and the overall scaling.
12. A special effect template generating apparatus, comprising:
the display module is used for operating a first editing interface, and a sample image and a liquefaction mark positioned in the sample image are displayed in the first editing interface;
an interaction module for generating a first deformation of an identification profile of the liquefaction identification in response to a first operation on the liquefaction identification;
a processing module for generating a first liquefied special effect at a target area of the template image in response to a first deformation of the identification profile; the target area is an image area covered by the identification outline of the liquefaction identification in the sample image;
And the generating module is used for generating a target special effect template based on the first liquefied special effect.
13. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory, causing the processor to perform the special effects template generation method of any one of claims 1 to 11.
14. A computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the special effect template generation method of any one of claims 1 to 11.
15. A computer program product comprising a computer program which, when executed by a processor, implements the special effect template generation method of any one of claims 1 to 11.
CN202311119193.8A 2023-08-31 2023-08-31 Special effect template generation method and device, electronic equipment and storage medium Pending CN117151973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311119193.8A CN117151973A (en) 2023-08-31 2023-08-31 Special effect template generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311119193.8A CN117151973A (en) 2023-08-31 2023-08-31 Special effect template generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117151973A true CN117151973A (en) 2023-12-01

Family

ID=88905631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311119193.8A Pending CN117151973A (en) 2023-08-31 2023-08-31 Special effect template generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117151973A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117371387A (en) * 2023-12-08 2024-01-09 浙江集迈科微电子有限公司 Integrated circuit device layout parameterization construction method and device, storage medium and terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117371387A (en) * 2023-12-08 2024-01-09 浙江集迈科微电子有限公司 Integrated circuit device layout parameterization construction method and device, storage medium and terminal
CN117371387B (en) * 2023-12-08 2024-02-13 浙江集迈科微电子有限公司 Integrated circuit device layout parameterization construction method and device, storage medium and terminal

Similar Documents

Publication Publication Date Title
CN110058685B (en) Virtual object display method and device, electronic equipment and computer-readable storage medium
CN110069191B (en) Terminal-based image dragging deformation implementation method and device
CN112035041B (en) Image processing method and device, electronic equipment and storage medium
CN111210485B (en) Image processing method and device, readable medium and electronic equipment
CN112489169B (en) Portrait image processing method and device
CN110568982B (en) Picture clipping method and device in online presentation, storage medium and equipment
CN117151973A (en) Special effect template generation method and device, electronic equipment and storage medium
US20220353587A1 (en) Method and apparatus for generating music poster, electronic device, and medium
CN110070585A (en) Image generating method, device and computer readable storage medium
CN114693876B (en) Digital person generation method, device, storage medium and electronic equipment
CN110288532B (en) Method, apparatus, device and computer readable storage medium for generating whole body image
WO2024131652A1 (en) Special effect processing method and apparatus, and electronic device and storage medium
CN109598672B (en) Map road rendering method and device
CN110059739B (en) Image synthesis method, image synthesis device, electronic equipment and computer-readable storage medium
CN110334163B (en) Map background optimization method, device, equipment and storage medium for big data
CN108536510B (en) Implementation method and device based on human-computer interaction application program
CN113838163A (en) Region graph drawing plug-in, method and device, electronic equipment, system and medium
CN111402116A (en) Method and device for processing human waist body beautification in picture and electronic equipment
US20180321828A1 (en) Personalizing perceivability settings of graphical user interfaces of computers
CN112395826B (en) Text special effect processing method and device
CN118446884A (en) Image processing method, device, equipment and medium
CN110363860B (en) 3D model reconstruction method and device and electronic equipment
CN117392280A (en) Image processing method, apparatus, device, computer readable storage medium, and product
CN118245023A (en) Method and device for displaying component profile, electronic equipment and storage medium
CN117348868A (en) Interactive style template generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination