Method, device, equipment, storage medium and program product for generating makeup effects
By receiving color adjustment operations and determining the target color, a second makeup effect can be generated directly based on the first makeup effect, solving the problems of cumbersome operation and high difficulty, and improving the production efficiency and user experience of makeup effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-03-11
- Publication Date
- 2026-04-28
AI Technical Summary
The production of beauty and special effects using existing technologies is cumbersome and difficult, resulting in low production efficiency.
By receiving color adjustment operations, determining the target color, and adjusting the color of the first makeup effect to generate the second makeup effect, the production process of makeup effects is simplified.
There's no need to redraw makeup effect materials; adjustments can be made directly based on the existing makeup effects, simplifying production, increasing efficiency, and improving user experience.
Smart Images

Figure CN114723600B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for generating beauty effects. Background Technology
[0002] Currently, creators need to draw makeup textures on a baseline model image and import them into special effects creation tools to create makeup effects. However, this method of creating makeup effects is relatively cumbersome and difficult, resulting in low production efficiency. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, storage medium, and program product for generating beauty effects, to simplify the operations required for creating beauty effects and reduce the difficulty of creating beauty effects.
[0004] In a first aspect, embodiments of this disclosure provide a method for generating beauty effects, including:
[0005] Receive color adjustment requests for the first makeup effect;
[0006] In response to the color adjustment operation, a target color corresponding to the color adjustment operation is determined, and the first beauty effect is color-adjusted according to the target color to generate a second beauty effect.
[0007] Secondly, this disclosure also provides a device for generating beauty effects, comprising:
[0008] The operation receiving module is used to receive color adjustment operations for the first beauty effect;
[0009] The color adjustment module is used to respond to the color adjustment operation, determine the target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate the second beauty effect.
[0010] Thirdly, embodiments of this disclosure also provide an electronic device, including:
[0011] One or more processors;
[0012] Memory, used to store one or more programs.
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating beauty effects as described in the embodiments of this disclosure.
[0014] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating beauty effects as described in embodiments of this disclosure.
[0015] Fifthly, this disclosure also provides a computer program product that, when executed by a computer, enables the computer to implement the method for generating beauty effects as described in this disclosure.
[0016] The beauty effect generation method, apparatus, device, storage medium, and program product provided in this disclosure receive a color adjustment operation for a first beauty effect; in response to the color adjustment operation, determine a target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate a second beauty effect. By adopting the above technical solution, this disclosure directly adjusts the first beauty effect to obtain the second beauty effect, without needing to redraw the beauty effect materials, thus simplifying the production difficulty of beauty effects, improving the production efficiency of beauty effects, and enhancing the user experience. Attached Figure Description
[0017] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. 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 originals and elements are not necessarily drawn to scale.
[0018] Figure 1 A flowchart illustrating a method for generating beauty effects according to an embodiment of this disclosure;
[0019] Figure 2 A flowchart illustrating another method for generating beauty effects provided in this disclosure embodiment;
[0020] Figure 3 A structural block diagram of a device for generating beauty effects provided in an embodiment of this disclosure;
[0021] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0022] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0023] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0024] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "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". Definitions of other terms will be given in the description below.
[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only 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 interdependencies.
[0026] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0027] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0028] Figure 1 This is a flowchart illustrating a method for generating beauty effects according to an embodiment of this disclosure. The method can be executed by a beauty effects generation device, which can be implemented by software and / or hardware and can be configured in an electronic device, typically a mobile phone or tablet. The beauty effects generation method provided in this disclosure is applicable to scenarios involving the creation of special effects, and is particularly suitable for scenarios where new special effects are created based on existing ones. Figure 1 As shown, the method for generating beauty effects provided in this embodiment may include:
[0029] S101, Receive color adjustment operation for the first beauty effect.
[0030] The first makeup effect refers to a completed makeup effect, which can be either a released or unreleased effect. This first makeup effect can be a video effect, such as one applied to a video. Correspondingly, the color adjustment operation refers to adjusting the color of a specific makeup effect (i.e., the first makeup effect), such as selecting a color on the effect adjustment page of the first makeup effect. This color adjustment operation can be performed by the effect user or the effect creator. For example, while using a makeup effect (such as the first makeup effect), a user can adjust the color of the makeup effect by performing the color adjustment operation and use the adjusted new makeup effect to process the video; or, after completing the creation of a makeup effect (such as the first makeup effect), a user can further adjust the color of the makeup effect by performing the color adjustment operation to obtain a new makeup effect.
[0031] Specifically, when a user (such as a special effects user and / or special effects creator) wants to adjust the color of a first makeup effect, they can perform a color adjustment operation for that first makeup effect. For example, they can switch to the special effects adjustment page of the first makeup effect and select the color they want to use for the color adjustment. Correspondingly, the electronic device can receive the color adjustment operation performed by the user.
[0032] S102. In response to the color adjustment operation, determine the target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate the second beauty effect.
[0033] The target color can be the color corresponding to the color adjustment operation, such as the color selected by the user through the color adjustment operation. The second makeup effect can be a new makeup effect created by the user based on the first makeup effect, such as a new makeup effect obtained by adjusting the color and / or position of the first makeup effect.
[0034] Specifically, when the electronic device receives a color adjustment command for the first makeup effect, it can determine the target color selected by the user and adjust the color of the first makeup effect accordingly. For example, it can determine the target color information that a corresponding pixel needs to be adjusted to based on the color information of the target color and the initial color information of each pixel in the first makeup effect, and then adjust the color of each pixel based on the target color information. Therefore, after the user completes the adjustment, they can instruct the electronic device to generate a second makeup effect by executing an effect generation operation, so as to publish the second makeup effect or use the second makeup effect for video processing.
[0035] In addition, when users adjust the first beauty effect, the electronic device can also display a real-time preview of the adjusted first beauty effect. For example, it can process the preset screen or the screen captured by the camera in real time using the adjusted first beauty effect and display the processed preview screen for users to view.
[0036] In this embodiment, users can adjust the completed makeup effects. For example, users can re-import the makeup effects into the effects creation tool for adjustments before or after the effects are released. This eliminates the need to repeatedly redraw the makeup effect materials and import them into the effects creation tool to view the effect before creating the effects. Compared to the previous approach where users had to redraw the makeup effect materials and import them into the effects creation tool to view the effect, and then re-import the redrawn effects into the effects creation tool if they were not satisfied with the effect, this approach simplifies the creation of makeup effects, improves the efficiency of effects creation, and enhances the user experience.
[0037] In one embodiment, adjusting the color of the first makeup effect based on the target color includes: determining a current adjustment coefficient corresponding to the current color component based on the target color for at least some color components of at least some pixels in the first makeup effect; and adjusting the color component value of the current color component using the current adjustment coefficient and the current transparency coefficient of the first makeup effect. Therefore, when adjusting the color, both the target color and the original color of the makeup effect can be comprehensively considered, improving the color adjustment effect of the makeup effect.
[0038] The current color component can be the color component whose color is currently being adjusted, i.e., the color component of the current pixel whose adjustment coefficient needs to be determined, such as the red, green, or blue color component of the current pixel. The current adjustment coefficient can be the adjustment coefficient of the current color component. The current transparency coefficient can be the transparency coefficient of the first makeup effect at the current moment. It can be the initial transparency coefficient of the first makeup effect, or it can be the transparency coefficient adjusted by the user, meaning that the user can adjust the transparency coefficient of the first makeup effect by performing a transparency coefficient adjustment operation.
[0039] For example, when adjusting the color of the first makeup effect, for at least some pixels in the first makeup effect, firstly, the adjustment coefficient corresponding to the corresponding color component is determined according to the target color and the color component value of the pixel in at least some color channels; then, the target color component value to which the corresponding color channel needs to be adjusted is determined according to the adjustment coefficient and the current transparency coefficient of the first makeup effect, and the color of the pixel is adjusted according to the target color component value.
[0040] Preferably, the color component value of each pixel in the first makeup effect can be adjusted. Here, assuming the initial color component values of the pixel in each color channel before adjustment are (r0, g0, b0), and the current transparency coefficient of the first makeup effect is G0, the determined adjustment coefficients for each color component of the pixel are (c...). r c g c b If the target color component value that the pixel needs to be adjusted to in each color channel is (r0c), then the target color component value that the pixel needs to be adjusted to is (r0c). r G0, g0c g G0, b0c b G0).
[0041] In one implementation, the user can also adjust the addition position of the first beauty effect. Accordingly, when the first beauty effect is a portrait beauty effect, the method further includes: adjusting the addition position of the first beauty effect on the corresponding portrait part in response to the position adjustment operation of the first beauty effect.
[0042] Among them, portrait makeup effects can be understood as makeup effects added to the image of a person in the picture, such as makeup effects applied to the face or body. The following explanation uses the first makeup effect applied to the face as an example. Correspondingly, the portrait part can be the face or the body. The position adjustment operation can be the operation of adjusting the relative position of the first makeup effect and its corresponding portrait part, such as dragging the first makeup effect or scaling the position of the first makeup effect.
[0043] For example, when a user wants to adjust the placement of the first makeup effect, they can perform a position adjustment operation on the first makeup effect, such as dragging or adjusting the scaling factor. Upon receiving the user's position adjustment operation, the electronic device can determine the target position to which the first makeup effect needs to be adjusted, which will be the placement location for the first makeup effect. The device can then add the first makeup effect at that location, allowing the user to preview the adjusted effect.
[0044] In the above implementation, users can adjust the placement of the first makeup effect through a position adjustment operation. For example, if there is a deviation between the placement of the first makeup effect and the display position of its corresponding portrait part, the first makeup effect can be adjusted to align with the display position of its corresponding portrait part. Alternatively, if the placement of the first makeup effect is already aligned with the display position of its corresponding portrait part, the first makeup effect can be adjusted to be misaligned. This eliminates the need to repeatedly redraw the makeup effect material and import it into the effects creation tool to view the effect and create the makeup effect. Therefore, this not only simplifies the creation of makeup effects and improves the efficiency of makeup effect creation, but also meets the personalized needs of different users and enhances the user experience.
[0045] In one embodiment, adjusting the addition position of the first makeup effect on the corresponding portrait part includes: adjusting the key points corresponding to the first makeup effect on the corresponding portrait part; and determining the addition position of the first makeup effect based on the adjusted key points.
[0046] In this context, the key points corresponding to the first makeup effect in the corresponding portrait area can be understood as the key points for positioning the first makeup effect when adding it to that area. That is, the addition position of the first makeup effect can be determined based on these key points. Therefore, in this embodiment, the addition position of the first makeup effect in the corresponding portrait area can be adjusted by modifying the key points corresponding to it.
[0047] For example, the relative position of the first makeup effect and the corresponding part of the portrait can be adjusted according to the position adjustment operation. Based on the relative position, the key points corresponding to the adjusted first makeup effect in the corresponding part of the portrait are determined, and the addition position of the first makeup effect is determined based on the position of the key points. For example, when processing a video with the adjusted first makeup effect, the corresponding key points in the image of the person displayed in the video can be identified, and the first makeup effect can be added at the position corresponding to the key points. This allows for adjustment of the addition position of the makeup effect to meet the user's personalized needs.
[0048] This embodiment provides a method for generating beauty effects, which receives a color adjustment operation for a first beauty effect; in response to the color adjustment operation, determines the target color corresponding to the color adjustment operation, and adjusts the color of the first beauty effect according to the target color to generate a second beauty effect. This embodiment, by adopting the above technical solution, directly adjusts the first beauty effect to obtain the second beauty effect, without needing to redraw the beauty effect materials, thus simplifying the production difficulty of beauty effects, improving the production efficiency of beauty effects, and enhancing the user experience.
[0049] Figure 2 This is a flowchart illustrating another method for generating beauty effects according to an embodiment of this disclosure. The solution in this embodiment can be combined with one or more optional solutions in the above embodiments. Optionally, determining the current adjustment coefficient corresponding to the current color component based on the target color includes: determining a first sub-adjustment coefficient corresponding to the current color component and a second sub-adjustment coefficient corresponding to the current pixel based on the target color; and calculating the current adjustment coefficient corresponding to the current color component based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
[0050] Optionally, the position adjustment operation is a scaling factor adjustment operation. Adjusting the key points corresponding to the first makeup effect in the corresponding portrait part includes: scaling the three-dimensional model corresponding to the first makeup effect according to the target scaling factor corresponding to the scaling factor adjustment operation, so as to adjust the key points corresponding to the first makeup effect in the three-dimensional model, wherein the key points in the three-dimensional model correspond to the key points in the corresponding portrait part.
[0051] Correspondingly, such as Figure 2 As shown, the method for generating beauty effects provided in this embodiment may include:
[0052] S201, Receive color adjustment operation for the first beauty effect.
[0053] S202. In response to the color adjustment operation, determine the target color corresponding to the color adjustment operation, and determine the first sub-adjustment coefficient corresponding to the current color component and the second sub-adjustment coefficient corresponding to the current pixel based on the target color.
[0054] The first sub-adjustment coefficient can be the sub-adjustment coefficient corresponding to the current color component of the current pixel, and it can correspond only to the current color component. The second sub-adjustment coefficient can be the sub-adjustment coefficient corresponding to the current pixel, and it can correspond to each color component of the current pixel (i.e., the red color component, green color component, and blue color component of the current pixel). That is, each color component of the current pixel can share a second sub-adjustment coefficient.
[0055] For example, the first sub-adjustment coefficient corresponding to the current color component can be determined based on the color component value of the corresponding color component in the target color, and the second sub-adjustment coefficient corresponding to the current pixel can be calculated based on the gray value corresponding to the target color or the average / median value of each color component value of the target color.
[0056] In one embodiment, determining the first sub-adjustment coefficient corresponding to the current color component and the second sub-adjustment coefficient corresponding to the current pixel based on the target color includes: determining the first sub-adjustment coefficient corresponding to the current color component based on the color component value of the corresponding color component of the target color; and determining the second sub-adjustment coefficient corresponding to the current pixel based on the first grayscale value of the target pixel corresponding to the current pixel in the target grayscale image and the second grayscale value corresponding to the target color, wherein the pixel in the target grayscale image corresponds to the pixel in the first beauty effect.
[0057] The target grayscale image can be a grayscale image used for color adjustment of the first makeup effect. It can be set by the creator or user of the first makeup effect. The pixels in the target grayscale image correspond to the pixels in the first makeup effect, preferably in a one-to-one correspondence, to achieve pixel-by-pixel color adjustment of the first makeup effect. Correspondingly, the target pixel can be the pixel in the target grayscale image that corresponds to the current pixel in the first makeup effect. The first grayscale value can be the grayscale value of the target pixel. The second grayscale value can be the grayscale value corresponding to the target color, that is, the grayscale value obtained by grayscale conversion of the target color.
[0058] For example, when determining the first sub-adjustment coefficient, the color component values of the corresponding color components of the target color can be normalized to obtain the first sub-adjustment coefficient of the current color component. For example, assuming that the color component values of the target color in the red, green, and blue color channels are (r1, g1, b1), then when the current color component is the red color component, the first sub-adjustment coefficient corresponding to the current color component is r1 / 255; when the current color component is the green color component, the first sub-adjustment coefficient corresponding to the current color component is g1 / 255; and when the current color component is the blue color component, the first sub-adjustment coefficient corresponding to the current color component is b1 / 255.
[0059] When determining the second sub-adjustment coefficient, the first gray value and the second gray value can be normalized respectively, and their product can be used as the second sub-adjustment coefficient corresponding to the current pixel. For example, if the first gray value of the target pixel corresponding to the current pixel in the target grayscale image is G0 and the second gray value corresponding to the target color is G1, then the second sub-adjustment coefficient corresponding to the current pixel is (G0 / 255)×(G1 / 255).
[0060] In this embodiment, the colors of the makeup effects can be further adjusted pixel by pixel using grayscale images to achieve special effects such as local weakening, local enhancement, and / or shadows. This improves the efficiency of creating makeup effects, meets different user needs, enhances the visual effect of the makeup effects, and improves the user experience.
[0061] S203. Calculate the current adjustment coefficient corresponding to the current color component based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
[0062] For example, after obtaining the first sub-adjustment coefficient corresponding to the current color component of the current pixel and the second sub-adjustment coefficient corresponding to the current pixel, the product of the first sub-adjustment coefficient and the second sub-adjustment coefficient can be calculated as the current adjustment coefficient corresponding to the current color component of the current pixel.
[0063] It is understandable that when the first makeup effect does not have a corresponding target grayscale image, the color of the first makeup effect can be adjusted based solely on the first sub-adjustment coefficient. That is, the first sub-adjustment coefficient corresponding to the current color component of the current pixel can be directly used as the current adjustment coefficient of the current color component of the current pixel. When the first makeup effect has a corresponding target grayscale image, the second sub-adjustment coefficient corresponding to the current pixel can also be determined based solely on the target grayscale image. For example, the second sub-adjustment coefficient corresponding to the current pixel can be determined based on the grayscale value of the target pixel corresponding to the current pixel in the target grayscale image. This embodiment does not limit this.
[0064] S204. Adjust the color component value of the current color component using the current adjustment coefficient and the current transparency coefficient of the first beauty effect.
[0065] For example, suppose the initial color component values of the current pixel in the red, green, and blue color channels before adjustment are (r0, g0, b0), the grayscale value of the pixel corresponding to the current pixel in the target grayscale image is G0, the color component values of the target color in each color channel are (r1, g1, b1), the grayscale value corresponding to the target color is G1, the current transparency coefficient of the first makeup effect is c0, and suppose the adjustment coefficients corresponding to each color component of the current pixel are (c r c g c b If the target color component value that the current pixel needs to be adjusted to in each color channel is (r2, g2, b2), then:
[0066] c r =(r1 / 255)×(G0 / 255)×(G1 / 255);
[0067] c g =(g1 / 255)×(G0 / 255)×(G1 / 255);
[0068] c b =(b1 / 255)×(G0 / 255)×(G1 / 255);
[0069] The target color component values that the current pixel needs to be adjusted to in each color channel are as follows:
[0070] r2=r0c r G0=r0×(r1 / 255)×(G0 / 255)×(G1 / 255)×G0;
[0071] g2=g0c g G0=g0×(g1 / 255)×(G0 / 255)×(G1 / 255)×G0;
[0072] b2=b0c b G0=b0×(b1 / 255)×(G0 / 255)×(G1 / 255)×G0.
[0073] S205. In response to the scaling factor adjustment operation for the first makeup effect, the three-dimensional model corresponding to the first makeup effect is scaled according to the target scaling factor corresponding to the scaling factor adjustment operation, so as to adjust the key points corresponding to the first makeup effect in the three-dimensional model, wherein the key points in the three-dimensional model correspond to the key points in the corresponding human portrait parts.
[0074] The 3D model corresponding to the first makeup effect can be the model used for texture rendering of the first makeup effect. It can be obtained by using a preset keypoint recognition algorithm to identify keypoints, and then using the identified keypoints as mesh vertices for mesh division. This keypoint recognition algorithm can be the same as the keypoint recognition algorithm used for the corresponding human body parts, and can also be the same keypoint recognition algorithm used by the creator of the first makeup effect when identifying keypoints on the base model image when drawing the effect materials. The keypoints in the 3D model can be the mesh vertices of the 3D model. The scaling factor adjustment operation is the operation to adjust the scaling factor of the first makeup effect. Correspondingly, the target scaling factor is the scaling factor adjusted to by this scaling factor adjustment operation.
[0075] In this embodiment, the key points corresponding to the first makeup effect in the 3D model can be adjusted by scaling the 3D model corresponding to the first makeup effect, thereby adjusting the key points corresponding to the first makeup effect in the corresponding portrait part. That is, the mesh covered by the first makeup effect in the 3D model can be adjusted by scaling the 3D model, thereby adjusting the addition position of the first makeup effect in the corresponding portrait part.
[0076] For example, a preset point (such as the center of the 3D model or a point on the boundary of the 3D model) can be used as the origin, and the 3D model can be scaled according to the target scaling factor adjusted by the scaling factor adjustment operation. For example, for each mesh vertex in the 3D model, assuming the coordinates of the mesh vertex are (v x v y ), the origin coordinates are (v x0 v y0 The target scaling factor is (s) x s y If ), then the coordinates of the grid vertex after scaling are ([(v x -v x0 )×s x ]+v x0 ,[(v y -v y0 )×s y ]+v y0 ).
[0077] S206. Determine the addition position of the first beauty effect according to the adjusted correspondence to generate the second beauty effect.
[0078] It should be noted that the above-described order of response to color adjustment and scaling factor adjustment operations is merely an illustrative example and does not restrict the execution order of each step. For example, the user may perform the scaling factor adjustment operation first and then the color adjustment operation, or perform multiple color adjustment operations and multiple scaling factor adjustment operations in a cross-cutting manner. In this case, the electronic device can respond to each trigger operation according to the order of the user's execution, thereby ultimately obtaining the second beauty effect.
[0079] The method for generating beauty effects provided in this embodiment adjusts the color of the first beauty effect according to the first sub-adjustment coefficient and the second sub-adjustment coefficient, and adjusts the addition position of the first beauty effect by scaling the corresponding three-dimensional model. This not only improves the creation efficiency of beauty effects, but also meets different user needs and enhances the user experience.
[0080] Figure 3 This is a structural block diagram of a makeup effect generation device provided in an embodiment of this disclosure. The device can be implemented by software and / or hardware, and can be configured in an electronic device, typically a mobile phone or tablet computer. It can create new effects based on existing effects by executing a makeup effect generation method. Figure 3 As shown, the makeup effect generation device provided in this embodiment may include: an operation receiving module 301 and a color adjustment module 302, wherein,
[0081] The operation receiving module 301 is used to receive color adjustment operations for the first beauty effect;
[0082] Color adjustment module 302 is used to respond to the color adjustment operation, determine the target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate the second beauty effect.
[0083] This embodiment provides a device for generating beauty effects. It receives a color adjustment operation for a first beauty effect via an operation receiving module; the color adjustment module responds to the color adjustment operation, determines the target color corresponding to the operation, and adjusts the first beauty effect according to the target color to generate a second beauty effect. This embodiment, by employing the above technical solution, directly adjusts the first beauty effect to obtain the second beauty effect, eliminating the need to redraw the beauty effect materials. This simplifies the production difficulty of beauty effects, improves production efficiency, and enhances the user experience.
[0084] In the above scheme, the color adjustment module 302 may include: a coefficient determination unit, used to determine the current adjustment coefficient corresponding to the current color component based on the target color for at least some color components of at least some pixels in the first beauty effect; and a color adjustment unit, used to adjust the color component value of the current color component using the current adjustment coefficient and the current transparency coefficient of the first beauty effect.
[0085] In the above scheme, the coefficient determination unit may include: a first coefficient determination subunit, used to determine a first sub-adjustment coefficient corresponding to the current color component and a second sub-adjustment coefficient corresponding to the current pixel based on the target color; and a second coefficient determination subunit, used to calculate the current adjustment coefficient corresponding to the current color component based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
[0086] In the above scheme, the first coefficient determining subunit can be used to: determine the first sub-adjustment coefficient corresponding to the current color component based on the color component value of the corresponding color component of the target color; and determine the second sub-adjustment coefficient corresponding to the current pixel based on the first gray value of the target pixel corresponding to the current pixel in the target grayscale image and the second gray value corresponding to the target color, wherein the pixel in the target grayscale image corresponds to the pixel in the first beauty effect.
[0087] In the above scheme, the first beauty effect can be a portrait beauty effect. The beauty effect generation device provided in this embodiment may further include: a position adjustment module, used to adjust the addition position of the first beauty effect on the corresponding portrait part in response to the position adjustment operation of the first beauty effect.
[0088] In the above scheme, the position adjustment module may include: a key point adjustment unit, used to adjust the key points corresponding to the first beauty effect in the corresponding portrait part; and a position determination unit, used to determine the addition position of the first beauty effect based on the adjusted key points.
[0089] In the above scheme, the position adjustment operation can be a scaling factor adjustment operation, and the key point adjustment unit can be used to: scale the three-dimensional model corresponding to the first beauty effect according to the target scaling factor corresponding to the scaling factor adjustment operation, so as to adjust the key points corresponding to the first beauty effect in the three-dimensional model, wherein the key points in the three-dimensional model correspond to the key points in the corresponding human portrait parts.
[0090] The makeup effect generation apparatus provided in this disclosure can execute the makeup effect generation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the makeup effect generation method. Technical details not described in detail in this embodiment can be found in the makeup effect generation method provided in any embodiment of this disclosure.
[0091] The following is for reference. Figure 4 This illustration shows a structural diagram of an electronic device (e.g., a terminal device) 400 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0092] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0093] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0094] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.
[0095] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. 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, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can 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 connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0096] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0097] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0098] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a color adjustment operation for a first beauty effect; and, in response to the color adjustment operation, determine a target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate a second beauty effect.
[0099] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0101] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of modules do not, in some cases, constitute a limitation on the unit itself.
[0102] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0103] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction 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 be, 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 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 fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0104] According to one or more embodiments of this disclosure, Example 1 provides a method for generating beauty effects, including:
[0105] Receive color adjustment requests for the first makeup effect;
[0106] In response to the color adjustment operation, a target color corresponding to the color adjustment operation is determined, and the first beauty effect is color-adjusted according to the target color to generate a second beauty effect.
[0107] According to one or more embodiments of this disclosure, Example 2, based on the method described in Example 1, includes adjusting the color of the first beauty effect according to the target color, comprising:
[0108] For at least some color components of at least some pixels in the first beauty effect, determine the current adjustment coefficient corresponding to the current color component based on the target color;
[0109] The color component value of the current color component is adjusted using the current adjustment coefficient and the current transparency coefficient of the first beauty effect.
[0110] According to one or more embodiments of this disclosure, Example 3 describes the method described in Example 2, wherein determining the current adjustment coefficient corresponding to the current color component based on the target color includes:
[0111] Based on the target color, determine the first sub-adjustment coefficient corresponding to the current color component and the second sub-adjustment coefficient corresponding to the current pixel;
[0112] The current adjustment coefficient corresponding to the current color component is calculated based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
[0113] According to one or more embodiments of this disclosure, Example 4 describes the method described in Example 3, wherein determining the first sub-adjustment coefficient corresponding to the current color component and the second sub-adjustment coefficient corresponding to the current pixel based on the target color includes:
[0114] The first sub-adjustment coefficient corresponding to the current color component is determined based on the color component value of the corresponding color component of the target color; and,
[0115] Based on the first grayscale value of the target pixel corresponding to the current pixel in the target grayscale image and the second grayscale value corresponding to the target color, a second sub-adjustment coefficient corresponding to the current pixel is determined, wherein the pixel in the target grayscale image corresponds to the pixel in the first beauty effect.
[0116] According to one or more embodiments of this disclosure, Example 5 describes the method according to any one of Examples 1-4, wherein the first beauty effect is a portrait beauty effect, and the method further includes:
[0117] In response to the position adjustment operation for the first beauty effect, the addition position of the first beauty effect on the corresponding portrait part is adjusted.
[0118] According to one or more embodiments of this disclosure, Example 6, based on the method described in Example 5, includes adjusting the addition position of the first beauty effect on the corresponding portrait part, comprising:
[0119] Adjust the key points corresponding to the first beauty effect in the corresponding portrait parts;
[0120] The location for adding the first beauty effect is determined based on the adjusted key points.
[0121] According to one or more embodiments of this disclosure, Example 7 describes the method described in Example 6, wherein the position adjustment operation is a scaling factor adjustment operation, and adjusting the key points corresponding to the first makeup effect in the corresponding portrait part includes:
[0122] The three-dimensional model corresponding to the first beauty effect is scaled according to the target scaling factor corresponding to the scaling factor adjustment operation, so as to adjust the key points corresponding to the first beauty effect in the three-dimensional model, wherein the key points in the three-dimensional model correspond to the key points in the corresponding human portrait parts.
[0123] According to one or more embodiments of this disclosure, Example 8 provides an apparatus for generating beauty effects, including:
[0124] The operation receiving module is used to receive color adjustment operations for the first beauty effect;
[0125] The color adjustment module is used to respond to the color adjustment operation, determine the target color corresponding to the color adjustment operation, and adjust the color of the first beauty effect according to the target color to generate the second beauty effect.
[0126] According to one or more embodiments of this disclosure, Example 9 provides an electronic device, including:
[0127] One or more processors;
[0128] Memory, used to store one or more programs.
[0129] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating beauty effects as described in any of Examples 1-7.
[0130] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a method for generating beauty effects as described in any of Examples 1-7.
[0131] According to one or more embodiments of this disclosure, Example 11 provides a computer program product that, when executed by a computer, causes the computer to implement a method for generating beauty effects as described in any of Examples 1-7.
[0132] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0133] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0134] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method of generating a makeup effect, characterized by, The method comprises: receiving a color adjustment operation for a first makeup effect; the first makeup effect is a finished makeup effect, and the first makeup effect comprises a published makeup effect or an unpublished makeup effect; in response to the color adjustment operation, determining a target color corresponding to the color adjustment operation, and adjusting the color of the first makeup effect according to the target color to generate a second makeup effect; the target color is a color selected in the effect adjustment page of the first makeup effect through the color adjustment operation; the second makeup effect is used for publishing; wherein, the color adjustment of the first makeup effect according to the target color comprises: for at least part of the color components of at least part of the pixels in the first makeup effect, determining a current adjustment coefficient corresponding to the current color component according to the target color; adjusting the color component value of the current color component by using the current adjustment coefficient and the current transparency coefficient of the first makeup effect; the target color component value to which the current color component needs to be adjusted is determined based on the product of the color component value before the current color component is adjusted, the current adjustment coefficient and the current transparency coefficient.
2. The method of claim 1, wherein, The method comprises: determining a first sub-adjustment coefficient corresponding to the current color component and a second sub-adjustment coefficient corresponding to the current pixel according to the target color; the color components of the current pixel share the second sub-adjustment coefficient; calculating the current adjustment coefficient corresponding to the current color component based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
3. The method of claim 2, wherein, The method comprises: determining a first sub-adjustment coefficient corresponding to the current color component and a second sub-adjustment coefficient corresponding to the current pixel according to the target color; the color components of the current pixel share the second sub-adjustment coefficient; calculating the current adjustment coefficient corresponding to the current color component based on the first sub-adjustment coefficient and the second sub-adjustment coefficient.
4. The method according to any of claims 1 to 3, characterized in that, The method comprises: determining a first sub-adjustment coefficient corresponding to the current color component according to the color component value of the corresponding color component of the target color; and 5. The method of claim 4, wherein, determining a second sub-adjustment coefficient corresponding to the current pixel according to a first gray value of a target pixel corresponding to the current pixel in a target gray image and a second gray value corresponding to the target color, wherein the pixels in the target gray image correspond to the pixels in the first makeup effect. The first makeup effect is a portrait makeup effect, and the method further comprises: in response to a position adjustment operation for the first makeup effect, adjusting the addition position of the first makeup effect in the corresponding portrait part.
6. The method of claim 5, wherein, The method comprises: adjusting the key point corresponding to the first makeup effect in the corresponding portrait part; determining the addition position of the first makeup effect according to the adjusted key point. The position adjustment operation is a scaling coefficient adjustment operation, and the method comprises: According to the target scaling coefficient corresponding to the scaling coefficient adjustment operation, a three-dimensional model corresponding to the first makeup effect is scaled to adjust a key point in the three-dimensional model corresponding to the first makeup effect.
7. A makeup effect generation apparatus characterized by comprising: Comprise: An operation receiving module is configured to receive a color adjustment operation for a first makeup effect; The first makeup effect is a makeup effect that has been completed, and the first makeup effect includes a published makeup effect or an unpublished makeup effect; A color adjustment module is configured to determine a target color corresponding to the color adjustment operation in response to the color adjustment operation, and to perform color adjustment on the first makeup effect according to the target color to generate a second makeup effect; the target color is a color selected in the effect adjustment page of the first makeup effect through the color adjustment operation; The second makeup effect is used for publishing; The color adjustment module comprises: A coefficient determination unit is configured to determine a current adjustment coefficient corresponding to a current color component for at least part of the color components of at least part of the pixels in the first makeup effect according to the target color; A color adjustment unit is configured to adjust the color component value of the current color component using the current adjustment coefficient and a current transparency coefficient of the first makeup effect; a target color component value to which the current color component needs to be adjusted is determined based on the product of the color component value before the current color component is adjusted, the current adjustment coefficient, and the current transparency coefficient.
8. An electronic device, comprising: Comprise: One or more processors; Memory for storing 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 makeup effect generation method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the makeup effect generation method of any one of claims 1-6.
10. A computer program product, characterised in that, When the computer program product is executed by the computer, the computer implements the makeup effect generation method of any one of claims 1-6.
Citation Information
Patent Citations
Systems and methods for virtual application of cosmetic effects to remote user
CN110136272A
Face image processing method and device, electronic equipment and computer readable medium
CN111784568A
Image processing method, device and equipment
CN112541955A