Special effect generation method, device, equipment and storage medium

By generating multi-layer special effect lines and superimposing them onto the original image, the problem of single image stroke effect in the prior art is solved, the multi-layer stroke effect of the image is realized, and the display richness of the image is improved.

CN114943788BActive Publication Date: 2025-06-24BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210775464.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2025-06-24
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

In the prior art, the stroke effect added by the image is mainly single layer, with a single effect, which cannot meet the user's demand for image display richness.

Method used

By generating multiple line entities, receiving line attribute information set by the user, and generating multi-layer special effects lines based on this information and segmentation mask diagram. Finally, these special effects lines are superimposed on the original image to obtain an image with multi-layer stroke effect.

Benefits of technology

The multi-layer stroke effect of the image is realized, the richness and aesthetics of the image display are improved, and the diverse needs of users for image processing are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943788B_ABST
    Figure CN114943788B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a special effect generation method, apparatus, device, and storage medium. Generate a plurality of line entities based on set special effect attribute information; receive line attribute information set by a user for one or more of the plurality of line entities; generate multiple layers of special effect lines in a preset order based on the line attribute information and an obtained segmentation mask image, where the segmentation mask image is obtained by segmenting a target object in an original image; superimpose the multiple layers of special effect lines onto the original image to obtain a special effect image. This technical solution can generate an image with a "multi-layer stroke" special effect, improving the richness of image display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of image processing technologies, and in particular, to a special effect generation method, apparatus, device, and storage medium. Background Art

[0002] Smart terminals have become an indispensable tool in users' lives. Through smart terminals, users can carry out a series of entertainment activities, such as adding special effects to images to enhance the entertainment. Among them, adding a special effect edge (abbreviated as stroke) to an image is one of the image special effect processing methods.

[0003] In related technologies, most support simple single-layer strokes, and the effects are single. Summary of the Invention

[0004] Embodiments of the present disclosure provide a special effect generation method, apparatus, device, and storage medium, which can generate an image with a "multi-layer stroke" special effect and improve the richness of image display.

[0005] In a first aspect, embodiments of the present disclosure provide a special effect generation method, including:

[0006] Generating a plurality of line entities based on set special effect attribute information;

[0007] Receiving line attribute information set by a user for one or more of the plurality of line entities;

[0008] Generating multi-layer special effect lines in a preset order based on the line attribute information and an obtained segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in the original image;

[0009] Superimposing the multi-layer special effect lines onto the original image to obtain a special effect image.

[0010] In a second aspect, embodiments of the present disclosure further provide a special effect generation apparatus, including:

[0011] A line entity generation module, configured to generate a plurality of line entities based on set special effect attribute information;

[0012] A line attribute information setting module, configured to receive line attribute information set by a user for one or more of the plurality of line entities;

[0013] A multi-layer special effect line generation module, configured to generate multi-layer special effect lines in a preset order based on the line attribute information and an obtained segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in the original image;

[0014] A special effect image obtaining module, configured to superimpose the multi-layer special effect lines onto the original image to obtain a special effect image.

[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes:

[0016] One or more processors;

[0017] A storage device for storing one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the special effect generation method as described in any embodiment of the present disclosure.

[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the special effect generation method as described in any embodiment of the present disclosure when executed by a computer processor.

[0020] Embodiments of the present disclosure disclose a special effect generation method, apparatus, device, and storage medium. Generate a plurality of line entities based on set special effect attribute information; receive line attribute information set by a user for one or more of the plurality of line entities; generate multiple layers of special effect lines in a preset order based on the line attribute information and an obtained segmentation mask image, where the segmentation mask image is obtained by segmenting a target object in an original image; superimpose the multiple layers of special effect lines onto the original image to obtain a special effect image. The special effect generation method provided by the embodiments of the present disclosure can generate multiple layers of special effect lines based on the line attribute information input by the user and the segmentation mask image, and can generate an image with a "multi-layer stroke" special effect, improving the richness of image display. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the original elements and elements are not necessarily drawn to scale.

[0022] Figure 1 It is a schematic flowchart of a special effect generation method provided by an embodiment of the present disclosure;

[0023] Figure 2 It is an example diagram of a generation interface of multiple line entities of a special effect generation method provided by an embodiment of the present disclosure;

[0024] Figure 3 It is an example diagram of a segmentation mask image of a special effect generation method provided by an embodiment of the present disclosure;

[0025] Figure 4 It is another schematic flowchart of a special effect generation method provided by an embodiment of the present disclosure;

[0026] Figure 5 It is an example diagram of an edge line mask for a special effect generation method provided by an embodiment of the present disclosure;

[0027] Figure 6 It is an example diagram of a blurred segmentation mask for a special effect generation method provided by an embodiment of the present disclosure;

[0028] Figure 7 It is an example diagram of a special effect line for line rendering based on the transparency value of a target material in a special effect generation method provided by an embodiment of the present disclosure;

[0029] Figure 8 It is a schematic structural diagram of a special effect generation device provided by an embodiment of the present disclosure;

[0030] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0032] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0033] As used herein, the term "including" and its variations are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0034] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependent relationships.

[0035] It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".

[0036] The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0037] It can be understood that before using the technical solutions disclosed in the embodiments of this disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0038] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of this disclosure according to the prompt message.

[0039] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0040] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manners of this disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of this disclosure.

[0041] It can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0042] Figure 1 It is a schematic flowchart of a special effect generation method provided by an embodiment of this disclosure. The embodiments of this disclosure are applicable to the situation of generating special effects for the original image of a target object (such as a person or an animal, etc.). This method can be executed by the special effect generation device provided by the embodiments of this disclosure. This device can be implemented in the form of software and / or hardware. Optionally, it is implemented by an electronic device, and this electronic device can be a mobile terminal, a PC terminal or a server, etc.

[0043] As Figure 1 shown, the method includes:

[0044] S110. Generate a plurality of line entities based on the set special effect attribute information.

[0045] Among them, the embodiments of the present disclosure can be executed by a special effect editing tool. The set special effect attribute information can be the number of lines set by the user or predefined by the tool in advance. A line entity can be understood as a container for editing a line graph and can hold multiple components related to the line graph. The line entity can be generated by running an edited program script based on the set special effect attribute information.

[0046] In the embodiments of the present disclosure, when the user enters the special effect editing tool, the set special effect attribute information is input in the panel of the special effect editing tool, and the special effect editing tool runs the edited program script to generate a plurality of line entities. The number of line entities is related to the number of generated line layers.

[0047] In the embodiments of the present disclosure, optionally, generating a plurality of line entities based on the set special effect attribute information includes: generating a plurality of empty entities based on the set special effect attribute information; respectively adding the set components to the plurality of empty entities to obtain a plurality of line entities; where the set components include a position component, a mesh rendering component, and a script component, and the script component is mounted with a set special effect script.

[0048] Among them, an empty entity can be understood as a container to which set components can be added. The plurality of line entities can be obtained by adding the set components to a plurality of empty entity containers. The set components can be components configured with initial parameters and can be configured according to actual needs. In this embodiment, the set components can include components such as a position component (transform), a mesh rendering component (meshrenderer), and a script component (scriptcomponent). The position component can be understood as a component including position coordinate parameters and is used to determine the position of the line in the world. The mesh rendering component can be understood as a component including mesh parameters (mesh) and material parameters (material). The script component can be used to mount the set special effect script.

[0049] In the embodiments of the present disclosure, optionally, respectively adding the set components to the plurality of empty entities to obtain line entities includes: running the set special effect script to obtain set special effect parameters; and configuring the set special effect parameters in the position component and the mesh rendering component to obtain a plurality of line entities.

[0050] Among them, the set special effect script can be understood as the underlying code called, which can be pre-edited. The set special effect parameters can be understood as the special effect parameters obtained by running the set special effect script mounted in the script component, and can be used to configure the position component and the mesh rendering component. In the embodiments of the present disclosure, the special effect editing tool can obtain a plurality of line entities by configuring the set special effect parameters in the position component and the mesh rendering component.

[0051] In the embodiments of the present disclosure, the special effect editing tool generates a plurality of empty entities based on the set special effect attributes; adds set components such as the position component, the mesh rendering component, and the script component to the plurality of empty entities respectively, so as to obtain a plurality of line entities; runs the set special effect script mounted in the script component to obtain the set special effect parameters. Run the set special effect script to obtain the set special effect parameters, and configure the set special effect parameters in the position component and the network rendering component, so as to obtain a plurality of line entities. Through such settings in the embodiments of the present disclosure, a plurality of line entities can be generated based on the set special effect attribute information, so as to facilitate the setting of multiple lines of the "multi-layer stroke" special effect for the image.

[0052] Exemplarily, an example diagram of the generation interface of a plurality of line entities is as Figure 2 shown. On the left, it can be understood as a plurality of line entities such as line entity 1, line entity 2, line entity 3, and line entity 4. The right interface can be understood as the settings of various set components, which can be set according to the actual needs of the user.

[0053] In the embodiments of the present disclosure, optionally, the method further includes: after running the set special effect script, it further includes:

[0054] Generating a line attribute panel corresponding to the set special effect script.

[0055] Among them, the line attribute panel can be a panel interface for setting line attribute information; the line attribute panel can be generated corresponding to running the set special effect script. Specifically, the line attribute panel can set attributes such as line width, line color, line transparency, set special effect material, and position change. In the embodiments of the present disclosure, the special effect editing tool can run the set special effect script to generate a line attribute panel, which is beneficial for users to set line attribute information and improves the flexibility of editing.

[0056] S120. Receive the line attribute information set by the user in one or more of the plurality of line entities.

[0057] Among them, the line attribute information may include at least one of the following: line width, line color, line transparency, set special effect material, and position transformation. In the embodiments of the present disclosure, one or more line attribute information can be set in multiple line entities. It can be understood that the line width is the specific width value of the line. The line color can be colors such as red, blue, yellow, and green, which can be set according to the actual needs of the user and are not limited here. The line transparency is the transparency value of the line, which can be set according to the actual needs of the user. For example, when the line transparency value is set to 0, the line is not displayed; when the transparency value is 1, the line is fully displayed. The set special effect material may include a set ordinary material and a glow material; the set special effect material may also include a material color and a material transparency. In this embodiment, a switch of "glow material" can be set in the line attribute panel. If the user turns on this switch, it indicates that the glow material is selected. If this switch is turned off, it indicates that the ordinary material is selected. The position transformation information may include at least one of the following: translation information, rotation information, scaling information, and flipping information. Exemplarily, the position transformation may be position transformations such as translation to the left, translation to the right, scaling of the size, and horizontal and vertical flipping.

[0058] In the embodiments of the present disclosure, the special effect editing tool can receive one or more line attribute information such as line width, line color, line transparency, set special effect material, and position transformation set by the user in multiple line entities respectively.

[0059] Optionally, the process of receiving the line attribute information set by the user in the multiple line entities may be: receiving the line attribute information input by the user through the line attribute panel.

[0060] Among them, the line attribute panel can be a panel interface for setting line attribute information. The line attribute information can be the information input by the user through the line attribute panel and can be input according to the user's needs. In the embodiments of the present disclosure, the special effect editing tool can receive the line attribute information input by the user through the line attribute panel. Through such a setting in the embodiments of the present disclosure, the line attribute information can be input and set according to the actual needs of the user, which is more flexible.

[0061] S130. Generate multiple layers of special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image. Among them, the segmentation mask image is obtained by segmenting the target object in the original image;

[0062] Among them, the segmentation mask image can be understood as an image obtained by segmenting the target object in the original image. The original image can be understood as the original image corresponding to the segmentation mask processing operation of the image. The target object can be understood as the target area to be segmented in the original image. Exemplarily, Figure 3is an example diagram of a segmentation mask image obtained by an embodiment of the present disclosure, such as Figure 3 As shown, the segmentation mask image is a mask image obtained by segmenting a human portrait. In this embodiment, there is no limitation on the segmentation object in the segmentation mask image, for example, it can be: animals, plants or buildings.

[0063] The preset order can be set by the user or can be random, the order of multiple line entities from inside to outside or from outside to inside, and is exemplarily sorted in the order of generated line entities. The order of line entities can determine the order of generating special effect lines and the hierarchical order of lines. The special effect lines corresponding to the front line entities are generated first and at a higher level. Multi-layer special effect lines can be understood as multiple special effect lines displayed in a hierarchical relationship.

[0064] In the embodiment of the present disclosure, the special effects editing tool can generate multiple layers of special effects lines in sequence according to the order of multiple line entities based on the line attribute information and the acquired segmentation mask image.

[0065] S140: superimpose the multiple layers of special effect lines onto the original image to obtain a special effect image.

[0066] The original image can be understood as the original image corresponding to the segmentation mask processing operation. The special effect image can be understood as the special effect image obtained by superimposing multiple layers of special effect lines on the original image corresponding to the segmentation mask image.

[0067] In the disclosed embodiment, the special effects editing tool superimposes multiple layers of special effects lines onto the original image corresponding to the segmentation mask image, thereby obtaining a special effects image.

[0068] The technical solution of the disclosed embodiment generates multiple line entities based on set special effect attribute information; receives line attribute information set by a user for one or more of the multiple line entities; generates multiple layers of special effect lines in a preset order based on the line attribute information and the acquired segmentation mask map; wherein the segmentation mask map is obtained by segmenting the target object in the original image; and superimposes the multiple layers of special effect lines on the original image to obtain a special effect map. This technical solution can generate an image with a "multi-layer stroke" special effect, thereby improving the richness of image display.

[0069] Figure 4A flowchart of another special effect generation method provided by an embodiment of the present disclosure; this embodiment is optimized based on the optional solutions provided in the above embodiments. Specifically, the optimization is as follows: generating multiple layers of special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image, including: for each layer of special effect lines, determining an edge extraction step size based on the line width; performing edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image; generating special effect lines based on at least one of line color, line transparency, set special effect material, and position transformation information and the edge line mask image.

[0070] As Figure 4 shown, the method includes:

[0071] S410. Generate a plurality of line entities based on set special effect attribute information.

[0072] S420. Receive line attribute information set by a user for one or more of the plurality of line entities.

[0073] S430. For each layer of special effect lines, determine an edge extraction step size based on the line width.

[0074] Among them, there can be multiple layers of special effect lines, and different settings can be made for each layer of special effect lines according to user requirements. The edge extraction step size can be extracted using any edge extraction algorithm. The edge extraction step size can be determined based on the line width and can be obtained by multiplying the line width by a preset set coefficient (for example: 0.01) to obtain the corresponding edge extraction step size. In the embodiment of the present disclosure, for each layer of special effect lines, the special effect editing tool can determine the edge extraction step size based on the line width.

[0075] S440. Perform edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image.

[0076] Among them, the edge line mask image can be understood as an image obtained by performing edge extraction on the segmentation mask image according to the edge extraction step size. In the embodiment of the present disclosure, the Laplace edge extraction algorithm can be used to perform edge extraction on the segmentation mask image according to the edge extraction step size to obtain the edge line mask image. Exemplarily, in the embodiment of the present disclosure, the edge calculated by the four-neighborhood Laplace algorithm using different step sizes can be used, and an example diagram of the edge line mask image is as Figure 5 shown.

[0077] S450. Generate special effect lines based on at least one of line color, line transparency, set special effect material, and position transformation information and the edge line mask image.

[0078] Among them, the special effect line can be generated based on at least one of line color, line transparency, set special effect material, and position transformation information, as well as the edge line mask image.

[0079] Exemplarily, the special effect line in the embodiments of the present disclosure can be a special effect line generated based on line color, line transparency, and the edge line mask image; it can also be a special effect line generated based on the set special effect material and the edge line mask image; it can also be a special effect line generated based on line color, position transformation information, and the edge line mask image; the required information can be set according to the actual needs of the user to generate the special effect line. Through such a setting in the embodiments of the present disclosure, different settings can be made for each layer of special effect line according to the user's needs, so as to generate an image with a "multi-layer stroke" special effect, further improving the richness of image display.

[0080] S460. Superimpose the multi-layer special effect line onto the original image to obtain a special effect image.

[0081] In the embodiments of the present disclosure, optionally, the segmentation mask image includes a target object area and a background area; the method of determining the edge extraction step size based on the line width can be: determining a first edge extraction step size and a second edge extraction step size based on the line width; the method of obtaining the edge line mask image by performing edge extraction on the segmentation mask image according to the edge extraction step size can be: performing edge extraction on the target object area according to the first edge extraction step size, and performing edge extraction on the background area according to the second edge extraction step size to obtain the edge line mask image.

[0082] Among them, the segmentation mask image can include a target object area and a background area. The target object area can be understood as the area where the segmented target object is located, such as Figure 3 the portrait area in. The background area can be understood as the area other than the target object area. The first edge extraction step size and the second edge extraction step size can be determined based on the line width, and can be understood as the edge extraction step sizes for the inner and outer sides of the segmentation mask image respectively. In the embodiments of the present disclosure, the first edge extraction step size can be used to perform edge extraction on the target object area; the second edge extraction step size can be used to perform edge extraction on the background area.

[0083] Specifically, the first edge extraction step size and the second edge extraction step size can be obtained by multiplying the line width by a set coefficient; among them, the set coefficient can be set according to the actually extracted step size. Exemplarily, the set coefficient can be set to coefficients such as 0.01, 0.02, and 0.03. The first edge extraction step size and the second edge extraction step size are not equal.

[0084] In the embodiments of the present disclosure, the first edge extraction step size and the second edge extraction step size can be determined based on the line width; the edge of the target object area is extracted according to the first edge extraction step size, and the edge of the background area is extracted according to the second edge extraction step size, so as to obtain an edge line mask map. Through such a setting in the embodiments of the present disclosure, different edge step sizes can be extracted for the target object area and the background area according to actual needs, which can improve the display effect.

[0085] In the embodiments of the present disclosure, optionally, the method for generating a special effect line based on the line color and the edge line mask map may be: fusing the color value of the line color with the pixel value of the pixel point in the edge line mask map to obtain the target color of the special effect line; performing line rendering based on the target color to obtain the special effect line.

[0086] Among them, the color value may be the RGB value of the line color. For example, it may include the corresponding color values of red, green, and blue. The line color in the embodiments of the present disclosure can be a color input by the user according to personal needs. The pixel value may be the pixel value corresponding to the pixel point in the edge line mask map; exemplarily, it may be a value between 0 and 1. The edge mask map may be represented by black and white. If it is a black area, the pixel value corresponding to the pixel point is 0; if it is a white area, the pixel value corresponding to the pixel point is 1.

[0087] In the embodiments of the present disclosure, fusing the color value of the line color with the pixel value of the pixel point in the edge line mask map can be understood as multiplying the color value of the line color by the pixel value of the pixel point in the edge mask map to obtain a value. The target color may be the color obtained by multiplying the color value of the line color by the pixel value of the pixel point in the edge line mask map. The special effect line can be understood as the special effect line obtained by rendering the line based on the target color, so that the special effect line displays the target color.

[0088] In the embodiments of the present disclosure, the target color of the special effect line can be obtained by multiplying the color value of the line color by the pixel value of the pixel point in the edge line mask map; and line rendering is performed based on the target color, so as to obtain the special effect line. Through such a setting in the embodiments of the present disclosure, a special effect line can be generated according to the line color in the line attributes and the edge line mask map.

[0089] In the embodiments of the present disclosure, optionally, generating a special effect line based on the line transparency and the edge line mask map includes: performing a blur process on the edge line mask map to obtain a blurred line mask map; fusing the line transparency value with the pixel value of the pixel point in the blurred line mask map to obtain the target transparency; performing line rendering based on the target transparency to obtain the special effect line.

[0090] Among them, the blurring process can be understood as performing mean blurring (e.g., mean blurring process of 7*7) or Gaussian blurring on the edge pre-mask image, etc., which is not limited here. Optionally, in this embodiment, mean blurring process is adopted. The principle of mean blurring is to calculate the average value of a pixel and its surrounding pixels through a graphic filter. The blurred line mask image can be a blurred line mask image obtained by blurring the edge line mask image. The line transparency value can be obtained according to the set transparency value (which can also be called the feathering value). The line transparency value can be input by the user according to personal actual needs.

[0091] Optionally, fusing the line transparency value with the pixel value of the pixel point in the blurred line mask image to obtain the target transparency includes: if the line transparency value is within the first set range, fusing the line transparency value with the pixel value of the pixel point in the blurred line mask image based on the first set value to obtain the target transparency; if the line transparency value is within the second set range, fusing the line transparency value with the pixel value of the pixel point in the blurred line mask image based on the second set value to obtain the target transparency.

[0092] Among them, the first set range can be the range from -1 to 0, and the first set value can be 1. When the line transparency value x is within the first set range from -1 to 0, fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image based on the first set value. That is, when the line transparency value x input by the user is within the first set range, the line transparency value and the pixel value of the pixel point in the blurred line mask image are fused using the formula y=(x + 1)*r - x*1.0, where x represents the feathering value of the line transparency, r represents the pixel value of the pixel point in the blurred line mask image, and y represents the target transparency value. The second set range can be the numerical range from 0 to 1, and the second set value can be 0. When the line transparency value x input by the user is within the second set range, the line transparency value and the pixel value of the pixel point in the blurred line mask image are calculated using the following formula: y=(1.0 - x)*r.

[0093] In the embodiment of the present disclosure, a blurred line mask image can be obtained by blurring the edge line mask image; the line transparency value and the pixel value of the pixel point in the blurred line mask image are fused in different set values according to the set range to obtain the target transparency; based on the target transparency, line rendering is performed to obtain a special effect line, which can make the generated special effect line present a "feathering" effect.

[0094] In an embodiment of the present disclosure, optionally, the set special effect material includes a material color and a material transparency. Generating a special effect line based on the set special effect material and the edge line mask image includes: fusing the material color value with the pixel value of the pixel point in the edge line mask image to obtain a target material color value; blurring the segmentation mask image to obtain a blurred segmentation mask image; fusing the material transparency value with the pixel value of the pixel point in the blurred segmentation mask image to obtain a target material transparency value; performing line rendering based on the target material color value and the target material transparency value to obtain a special effect line.

[0095] Among them, the set special effect material may include a material color and a material transparency. The target material color value can be obtained by fusing the material color value with the pixel value of the pixel point in the edge line mask image. Specifically, the target material color value can be obtained by multiplying the material color value with the pixel value of the pixel point in the edge line mask image. The blurred segmentation mask image can be obtained by blurring the segmentation mask image. Exemplarily, an example diagram of the blurred segmentation mask image obtained by blurring the segmentation mask image is as Figure 6 shown.

[0096] In an embodiment of the present disclosure, optionally, fusing the material transparency value with the pixel value of the pixel point in the blurred segmentation mask image to obtain a target material transparency value includes: linearly superimposing the material transparency value with the pixel value of the corresponding pixel point in the blurred segmentation mask image to obtain a first intermediate transparency value; performing a set exponential operation on the first intermediate transparency value to obtain a second intermediate transparency value; performing a linear transformation on the second intermediate transparency value to obtain a target material transparency value.

[0097] Among them, the first intermediate transparency value can be obtained by linearly superimposing the material transparency value with the pixel value of the corresponding pixel point in the blurred segmentation mask image. Specifically, when the pixel value of the corresponding pixel point in the blurred segmentation mask image is greater than 0.5, the first intermediate transparency value can be determined by the following formula: y1 = clamp(0.5, 1, R + 0.5 - L * 0.5), where L represents the material transparency value, R represents the pixel value of the corresponding pixel point in the blurred segmentation mask image, y1 represents the first intermediate transparency value, and the clamp() function represents restricting the value of R + 0.5 - L * 0.5 between 0.5 and 1. When the pixel value of the corresponding pixel point in the blurred segmentation mask image is less than 0.5, the first intermediate transparency value can be determined by the following formula: y1 = (0, 0.5, R - 0.5 + L * 0.5), where L represents the material transparency value, R represents the pixel value of the corresponding pixel point in the blurred segmentation mask image, y1 represents the first intermediate transparency value, and the clamp() function represents restricting the value of R + 0.5 - L * 0.5 between 0 and 0.5.

[0098] Among them, the set exponential operation can be an exponential operation for setting the first intermediate transparency value. Other power setting exponential operations such as squaring or cubing the first intermediate transparency value can be set, and can be set according to actual needs. The set exponential operation for the first intermediate transparency value can adopt the following formula: y2 = [(0.5 - y1) * 2]^2, where y2 represents the second intermediate transparency value. The target material transparency value can be obtained by linearly transforming the second intermediate transparency value. Specifically, the linear transformation of the second intermediate transparency value can adopt the following formula: Y = 1 - y2, that is, a linear transformation obtained by subtracting 1.0 from the second intermediate transparency value.

[0099] In the embodiments of the present disclosure, by fusing the material color value with the pixel value of the pixel point in the edge line mask image, a target material color value is obtained; the segmentation mask image is blurred to obtain a blurred segmentation mask image; the material transparency value is linearly superimposed with the pixel value of the corresponding pixel point in the blurred segmentation mask image to obtain a first intermediate transparency value; a set exponential operation is performed on the first intermediate transparency value to obtain a second intermediate transparency value; a linear transformation is performed on the second intermediate transparency value to obtain a target material transparency value; based on the target material color value and the target material transparency value, line rendering is performed, and a special effect line with a "glow" special effect can be obtained.

[0100] Exemplarily, in the embodiments of the present disclosure, based on the target material transparency value, line rendering is performed to obtain an example diagram of the special effect line, such as Figure 7 as shown.

[0101] In the embodiments of the present disclosure, optionally, generating a special effect line based on the position transformation information and the edge line mask image includes: performing a position transformation on the pixel points in the edge mask image based on the position transformation information to obtain a transformed edge mask image; where the position transformation information includes at least one of the following: translation information, rotation information, scaling information, and flipping information; performing line rendering based on the transformed edge mask image to obtain a special effect line.

[0102] Among them, the position transformation information may include at least one of the following: translation information, rotation information, scaling information, and flipping information. The transformed edge mask image may be obtained by performing a position change on the pixel points in the edge mask image based on the position change information.

[0103] In the present disclosure, a transformed edge mask image can be obtained by performing a position transformation on the pixel points in the edge mask image based on the position change information, and line rendering is performed based on the transformed edge mask image, thereby obtaining a special effect line.

[0104] Optionally, in the embodiments of the present disclosure, line rendering may also be performed based on at least one of a target transparency, a target material color value, a target material transparency value, and a transformed edge mask image to obtain special effect lines.

[0105] Figure 8 FIG. 4 is a schematic structural diagram of a special effect generation device provided by an embodiment of the present disclosure. As Figure 8 shown, the device includes: a line entity generation module 810, a line attribute information setting module 820, a multi-layer special effect line generation module 830, and a special effect map acquisition module 840. As Figure 8 shown, the device may include:

[0106] The line entity generation module 810 is configured to generate a plurality of line entities based on set special effect attribute information;

[0107] The line attribute information setting module 820 is configured to receive line attribute information set by a user for one or more of the plurality of line entities;

[0108] The multi-layer special effect line generation module 830 is configured to generate multi-layer special effect lines in a preset order based on the line attribute information and an acquired segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in an original image;

[0109] The special effect map acquisition module 840 is configured to superimpose the multi-layer special effect lines on the original image to obtain a special effect map.

[0110] Optionally, the line entity generation module 810 includes:

[0111] An empty entity generation unit configured to generate a plurality of empty entities based on set special effect attribute information;

[0112] A line entity acquisition unit configured to add set components to the plurality of empty entities respectively to obtain a plurality of line entities; wherein, the set components include a position component, a mesh rendering component, and a script component, and a set special effect script is mounted on the script component.

[0113] Optionally, the line entity acquisition unit is specifically configured to:

[0114] Run the set special effect script to obtain set special effect parameters;

[0115] And configure the set special effect parameters in the position component and the mesh rendering component to obtain a plurality of line entities.

[0116] Optionally, the line entity generation module 810 further includes: a line attribute panel generation unit configured to:

[0117] After running the set special effect script, a line attribute panel corresponding to the set special effect script is generated;

[0118] The line attribute information setting module 820 is used for:

[0119] Receiving line attribute information input by the user through the line attribute panel.

[0120] Optionally, the line attribute information includes at least one of the following: line width, line color, line transparency, set special effect material, and position transformation.

[0121] Optionally, the multi-layer special effect line generation module 830 includes:

[0122] An edge extraction step unit for determining an edge extraction step based on the line width for each layer of special effect line;

[0123] An edge line mask map acquisition unit for performing edge extraction on the segmentation mask map according to the edge extraction step to obtain an edge line mask map;

[0124] A special effect line generation unit for generating a special effect line based on at least one of line color, line transparency, set special effect material, and position transformation information and the edge line mask map.

[0125] Optionally, the segmentation mask map includes a target object area and a background area; the edge extraction step unit is used for:

[0126] Determining a first edge extraction step and a second edge extraction step based on the line width;

[0127] Performing edge extraction on the segmentation mask map according to the edge extraction step to obtain an edge line mask map, including:

[0128] Performing edge extraction on the target object area according to the first edge extraction step and performing edge extraction on the background area according to the second edge extraction step to obtain an edge line mask map.

[0129] Optionally, the first special effect line generation unit is used for:

[0130] Fusing the color value of the line color with the pixel value of the pixel point in the edge line mask map to obtain the target color of the special effect line;

[0131] Performing line rendering based on the target color to obtain a special effect line.

[0132] Optionally, the second special effect line generation unit is used for:

[0133] Performing a blur process on the edge line mask map to obtain a blurred line mask map;

[0134] Fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image to obtain a target transparency;

[0135] Perform line rendering based on the target transparency to obtain a special effect line.

[0136] Optionally, the second special effect line generation unit is specifically configured to:

[0137] If the line transparency value is within a first set range, fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image based on a first set value to obtain a target transparency;

[0138] If the line transparency value is within a second set range, fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image based on a second set value to obtain a target transparency.

[0139] Optionally, the third special effect line generation unit is configured to:

[0140] Fuse the material color value with the pixel value of the pixel point in the edge line mask image to obtain a target material color value;

[0141] Blur the segmentation mask image to obtain a blurred segmentation mask image;

[0142] Fuse the material transparency value with the pixel value of the pixel point in the blurred segmentation mask image to obtain a target material transparency value;

[0143] Perform line rendering based on the target material color value and the target material transparency value to obtain a special effect line.

[0144] Optionally, the third special effect line generation unit is specifically configured to:

[0145] Linearly superimpose the material transparency value with the pixel value of the corresponding pixel point in the blurred segmentation mask image to obtain a first intermediate transparency value;

[0146] Perform a set exponential operation on the first intermediate transparency value to obtain a second intermediate transparency value;

[0147] Perform a linear transformation on the second intermediate transparency value to obtain a target material transparency value.

[0148] Optionally, the fourth special effect line generation unit is configured to:

[0149] Perform position transformation on the pixel points in the edge mask map based on the position transformation information to obtain a transformed edge mask map; wherein, the position transformation information includes at least one of the following: translation information, rotation information, scaling information, and flipping information;

[0150] Perform line rendering based on the transformed edge mask map to obtain special effect lines.

[0151] An special effect generation device provided by an embodiment of the present disclosure can execute an special effect generation method provided by any embodiment of the present disclosure, and has function modules and beneficial effects corresponding to the execution of the method.

[0152] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present disclosure.

[0153] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Referring below to Figure 9 , which shows a schematic structural diagram of an electronic device 500 suitable for implementing an embodiment of the present disclosure (such as Figure 9 the terminal device or server in). The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0154] As Figure 9 shown, the electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The editing / output (I / O) interface 505 is also connected to the bus 504.

[0155] Typically, the following devices can be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and a communication device 509. The communication device 509 can allow the electronic device 500 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 the electronic device 500 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.

[0156] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.

[0157] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0158] The electronic device provided by the embodiment of the present disclosure and a special effect generation method provided by the above embodiment belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0159] The embodiment of the present disclosure provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, a special effect generation method provided by the above embodiment is implemented.

[0160] It should be noted that the computer-readable medium described above in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0161] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0162] The above computer-readable medium may be included in the above electronic device; or it may exist separately without being assembled into the electronic device.

[0163] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:

[0164] The above computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: generate a plurality of line entities based on set special effect attribute information; receive line attribute information set by a user for one or more of the plurality of line entities; generate multiple layers of special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image, where the segmentation mask image is obtained by segmenting a target object in an original image; and superimpose the multiple layers of special effect lines onto the original image to obtain a special effect image.

[0165] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" 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 type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations 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 diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0167] The units described in the embodiments of the present disclosure may be implemented in software or in hardware. Wherein, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".

[0168] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0169] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0170] According to one or more embodiments of the present disclosure, there is provided a special effect generation method, including:

[0171] Generating a plurality of line entities based on set special effect attribute information;

[0172] Receiving line attribute information set by a user for one or more of the plurality of line entities;

[0173] Generating multiple layers of special effect lines in a preset order based on the line attribute information and an obtained segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in an original image;

[0174] Superimposing the multiple layers of special effect lines onto the original image to obtain a special effect image.

[0175] Optionally, generating a plurality of line entities based on set special effect attribute information includes:

[0176] Generating a plurality of empty entities based on set special effect attribute information;

[0177] Adding set components to the plurality of empty entities respectively to obtain a plurality of line entities; wherein, the set components include a position component, a grid rendering component, and a script component, and a set special effect script is mounted on the script component.

[0178] Optionally, add the setting components to the multiple empty entities respectively to obtain multiple line entities, including:

[0179] Run the set special effect script to obtain set special effect parameters;

[0180] And configure the set special effect parameters in the position component and the mesh rendering component to obtain multiple line entities.

[0181] Optionally, after running the set special effect script, it further includes:

[0182] Generate a line attribute panel corresponding to the set special effect script;

[0183] Receive the line attribute information set by the user in the multiple line entities, including:

[0184] Receive the line attribute information input by the user through the line attribute panel.

[0185] Optionally, the line attribute information includes at least one of the following: line width, line color, line transparency, set special effect material, and position transformation.

[0186] Optionally, generate multiple layers of special effect lines based on the line attribute information and the obtained segmentation mask image in a preset order, including:

[0187] For each layer of special effect line, determine the edge extraction step size based on the line width;

[0188] Perform edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image;

[0189] Generate a special effect line based on at least one of the line color, line transparency, set special effect material, and position transformation information and the edge line mask image.

[0190] Optionally, the segmentation mask image includes a target object area and a background area; determining the edge extraction step size based on the line width includes:

[0191] Determine a first edge extraction step size and a second edge extraction step size based on the line width;

[0192] Performing edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image includes:

[0193] Perform edge extraction on the target object area according to the first edge extraction step size, and perform edge extraction on the background area according to the second edge extraction step size to obtain an edge line mask image.

[0194] Optionally, generating a special effect line based on the line color and the edge line mask image includes:

[0195] Fuse the color value of the said line color with the pixel value of the pixel points in the edge line mask image to obtain the target color of the special effect line;

[0196] Perform line rendering based on the said target color to obtain the special effect line.

[0197] Optionally, generating a special effect line based on the line transparency and the edge line mask image includes:

[0198] Blur the edge line mask image to obtain a blurred line mask image;

[0199] Fuse the line transparency value with the pixel value of the pixel points in the blurred line mask image to obtain the target transparency;

[0200] Perform line rendering based on the target transparency to obtain the special effect line.

[0201] Optionally, fusing the line transparency value with the pixel value of the pixel points in the blurred line mask image to obtain the target transparency includes:

[0202] If the line transparency value is within the first set range, fuse the line transparency value with the pixel value of the pixel points in the blurred line mask image based on the first set value to obtain the target transparency;

[0203] If the line transparency value is within the second set range, fuse the line transparency value with the pixel value of the pixel points in the blurred line mask image based on the second set value to obtain the target transparency.

[0204] Optionally, the set special effect material includes material color and material transparency. Generating a special effect line based on the set special effect material and the edge line mask image includes:

[0205] Fuse the material color value with the pixel value of the pixel points in the edge line mask image to obtain the target material color value;

[0206] Blur the segmentation mask image to obtain a blurred segmentation mask image;

[0207] Fuse the material transparency value and the pixel value of the pixel points in the blurred segmentation mask image to obtain the target material transparency value;

[0208] Perform line rendering based on the target material color value and the target material transparency value to obtain the special effect line.

[0209] Optionally, fusing the material transparency value and the pixel value of the pixel points in the blurred segmentation mask map to obtain a target material transparency value, including:

[0210] Linearly superimposing the material transparency value and the pixel value of the corresponding pixel point in the blurred segmentation mask map to obtain a first intermediate transparency value;

[0211] Performing a set exponential operation on the first intermediate transparency value to obtain a second intermediate transparency value;

[0212] Performing a linear transformation on the second intermediate transparency value to obtain a target material transparency value.

[0213] Optionally, generating a special effect line based on the position transformation information and the edge line mask map, including:

[0214] Performing a position transformation on the pixel points in the edge mask map based on the position transformation information to obtain a transformed edge mask map; wherein, the position transformation information includes at least one of the following: translation information, rotation information, scaling information, and flipping information;

[0215] Performing line rendering based on the transformed edge mask map to obtain a special effect line.

[0216] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0217] In addition, although the operations are depicted in a specific order, this should not be construed as requiring that the operations be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although 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 described in the context of a single embodiment can also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0218] 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. On the contrary, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A special effect generation method, characterized in that, Including: Generating a plurality of line entities based on set special effect attribute information; Receiving line attribute information set by a user for one or more of the plurality of line entities; Generating multiple layers of special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in an original image; Superimposing the multiple layers of special effect lines onto the original image to obtain a special effect image; The line attribute information includes at least one of the following: line width, line color, line transparency, set special effect material, and position transformation information; Generating multiple layers of special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image, including: For each layer of special effect line, determining an edge extraction step size based on the line width; Performing edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image; Generating a special effect line based on at least one of the line color, the line transparency, the set special effect material, and the position transformation information and the edge line mask image.

2. The method according to claim 1, wherein Generating a plurality of line entities based on set special effect attribute information, including: Generating a plurality of empty entities based on set special effect attribute information; Adding set components to the plurality of empty entities respectively to obtain a plurality of line entities; wherein, the set components include a position component, a mesh rendering component, and a script component, and a set special effect script is mounted on the script component.

3. The method according to claim 2, wherein Adding set components to the plurality of empty entities respectively to obtain line entities, including: Running the set special effect script to obtain set special effect parameters; And configuring the set special effect parameters in the position component and the mesh rendering component to obtain a plurality of line entities.

4. The method according to claim 3, characterized in that, After running the set special effect script, further including: Generating a line attribute panel corresponding to the set special effect script; Receiving line attribute information set by a user in the plurality of line entities, including: Receiving line attribute information input by the user through the line attribute panel.

5. The method according to claim 1, wherein The segmentation mask image includes a target object area and a background area; determining an edge extraction step size based on the line width, including: Determining a first edge extraction step size and a second edge extraction step size based on the line width; Performing edge extraction on the segmentation mask image according to the edge extraction step size to obtain an edge line mask image, including: Performing edge extraction on the target object area according to the first edge extraction step size and performing edge extraction on the background area according to the second edge extraction step size to obtain an edge line mask image.

6. The method according to claim 1, wherein Generating a special effect line based on the line color and the edge line mask image, including: Fusing the color value of the line color with the pixel value of a pixel point in the edge line mask image to obtain a target color of the special effect line; Performing line rendering based on the target color to obtain a special effect line.

7. The method according to claim 1, characterized in that, Generating a special effect line based on the line transparency and the edge line mask image, including: Performing a blur process on the edge line mask image to obtain a blurred line mask image; Fusing the line transparency value with the pixel value of a pixel point in the blurred line mask image to obtain a target transparency; Render lines based on the target transparency to obtain special effect lines.

8. The method according to claim 7, characterized in that Fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image to obtain the target transparency, including: If the line transparency value is within the first set range, fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image based on the first set value to obtain the target transparency; If the line transparency value is within the second set range, fuse the line transparency value with the pixel value of the pixel point in the blurred line mask image based on the second set value to obtain the target transparency.

9. The method according to claim 1, wherein The set special effect material includes material color and material transparency. Generating special effect lines based on the set special effect material and the edge line mask image includes: Fuse the material color value with the pixel value of the pixel point in the edge line mask image to obtain the target material color value; Blur the segmentation mask image to obtain a blurred segmentation mask image; Fuse the material transparency value with the pixel value of the pixel point in the blurred segmentation mask image to obtain the target material transparency value; Render lines based on the target material color value and the target material transparency value to obtain special effect lines.

10. The method according to claim 9, wherein Fuse the material transparency value with the pixel value of the pixel point in the blurred segmentation mask image to obtain the target material transparency value, including: Linearly superimpose the material transparency value with the pixel value of the corresponding pixel point in the blurred segmentation mask image to obtain a first intermediate transparency value; Perform a set exponential operation on the first intermediate transparency value to obtain a second intermediate transparency value; Perform a linear transformation on the second intermediate transparency value to obtain the target material transparency value.

11. The method according to claim 1, characterized in that Generating special effect lines based on the position transformation information and the edge line mask image includes: Perform a position transformation on the pixel points in the edge line mask image based on the position transformation information to obtain a transformed edge line mask image; wherein, the position transformation information includes at least one of the following: translation information, rotation information, scaling information, and flipping information; Render lines based on the transformed edge line mask image to obtain special effect lines.

12. An special effect generating device, characterized in that, Includes: A line entity generation module for generating a plurality of line entities based on set special effect attribute information; A line attribute information setting module for receiving line attribute information set by a user for one or more of the plurality of line entities; A multi-layer special effect line generation module for generating multi-layer special effect lines in a preset order based on the line attribute information and the obtained segmentation mask image; wherein, the segmentation mask image is obtained by segmenting a target object in an original image; A special effect image acquisition module for superimposing the multi-layer special effect lines onto the original image to obtain a special effect image; The line attribute information includes at least one of the following: line width, line color, line transparency, set special effect material, and position transformation information; The multi-layer special effect line generation module includes: An edge extraction step unit for determining an edge extraction step for each layer of special effect lines based on the line width; An edge line mask map obtaining unit, configured to perform edge extraction on the segmentation mask map according to the edge extraction step length to obtain an edge line mask map; A special effect line generating unit, configured to generate a special effect line based on at least one of the line color, the line transparency, the set special effect material, and the position transformation information and the edge line mask map.

13. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the special effect generation method according to any one of claims 1-11.

14. A storage medium containing computer-executable instructions, the computer-executable instructions being used to execute the special effect generation method according to any one of claims 1-11 when executed by a computer processor.