[go: up one dir, main page]

CN115578299A - Image generation method, device, equipment and storage medium - Google Patents

Image generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115578299A
CN115578299A CN202211215358.7A CN202211215358A CN115578299A CN 115578299 A CN115578299 A CN 115578299A CN 202211215358 A CN202211215358 A CN 202211215358A CN 115578299 A CN115578299 A CN 115578299A
Authority
CN
China
Prior art keywords
map
special effect
target
virtual image
rendering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211215358.7A
Other languages
Chinese (zh)
Inventor
喻聪
张宇霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202211215358.7A priority Critical patent/CN115578299A/en
Publication of CN115578299A publication Critical patent/CN115578299A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure provides an image generation method, an image generation device, image generation equipment and a storage medium. Acquiring at least one initial special effect map based on the triggering operation of a user; cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map; fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map; and rendering the target virtual image map to obtain the target virtual image map. According to the image generation method provided by the embodiment of the disclosure, the target special effect map cut from the initial special effect map is merged with the original virtual image map and then rendered, the whole initial special effect map is not required to be processed, the calculation amount can be greatly reduced, namely, the consumption of video memory resources can be reduced, and therefore, the generation efficiency of the virtual image is improved.

Description

Image generation method, device, equipment and storage medium
Technical Field
The embodiments of the present disclosure relate to the field of image processing technologies, and in particular, to an image generation method, an image generation device, an image generation apparatus, and a storage medium.
Background
Intelligent terminals have become one of the indispensable entertainment tools for users to find out. The application scene of the virtual image makeup is one of the application scenes. Generally, when a whole set of makeup design is completed for an avatar, a plurality of makeup maps need to be combined with the avatar map. In the prior art, when a plurality of makeup pictures are drawn on the face of an avatar, the consumption of display and storage resources is large, and the image generation efficiency is reduced.
Disclosure of Invention
The present disclosure provides an image generation method, apparatus, device, and storage medium, which can not only improve the generation efficiency of an avatar image, but also reduce the consumption of video memory resources.
In a first aspect, an embodiment of the present disclosure provides an image generation method, including:
acquiring at least one initial special effect chartlet based on the triggering operation of a user;
cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map;
fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map;
and rendering the target virtual image map to obtain a target virtual image map.
In a second aspect, an embodiment of the present disclosure further provides an image generating apparatus, including:
the system comprises an initial special effect map acquisition module, a special effect map generation module and a special effect map generation module, wherein the initial special effect map acquisition module is used for acquiring at least one initial special effect map based on the triggering operation of a user;
the target special effect map obtaining module is used for cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map;
the target virtual image map obtaining module is used for fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map;
and the rendering module is used for rendering the target virtual image map to obtain the target virtual image map.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement an image generation method as described in embodiments of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the image generation method according to the disclosed embodiments.
The embodiment of the disclosure discloses an image generation method, an image generation device, an image generation equipment and a storage medium, wherein at least one initial special effect map is obtained based on the triggering operation of a user; cutting an effective content area in at least one initial special effect chartlet to obtain at least one target special effect chartlet; fusing at least one target special effect map with the original virtual image map to obtain a target virtual image map; and rendering the target virtual image map to obtain the target virtual image map. According to the image generation method provided by the embodiment of the disclosure, the target special effect map cut from the initial special effect map is merged with the original virtual image map and then rendered, the whole initial special effect map is not required to be processed, the calculation amount can be greatly reduced, namely, the consumption of video memory resources can be reduced, and therefore, the generation efficiency of the virtual image is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic flow chart of an image generation method provided in an embodiment of the present disclosure;
FIG. 2 is an exemplary diagram of a makeup editing interface provided by an embodiment of the present disclosure;
FIG. 3a is an exemplary diagram of a target special effect map provided by an embodiment of the present disclosure;
FIG. 3b is an exemplary diagram of a target special effect map provided by an embodiment of the present disclosure
FIG. 3c is an exemplary diagram of a target special effects map provided by an embodiment of the present disclosure;
FIG. 4 is an exemplary illustration of an original avatar map provided by an embodiment of the present disclosure;
FIG. 5 is an exemplary illustration of a target avatar map provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a target virtual pictogram provided by an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an image generation apparatus provided in an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, 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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving an active request from a user, a prompt message is sent to the user to explicitly prompt the user that the requested operation to be performed would require the acquisition and use of personal information to the user. Thus, the user can autonomously select 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 disclosed technical solution, according to the prompt information.
As an optional but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the pop-up window.
It is understood that the above notification and user authorization process is only illustrative and not limiting, and other ways of satisfying relevant laws and regulations may be applied to the implementation of the present disclosure.
It will be appreciated that the data involved in the subject technology, including but not limited to the data itself, the acquisition or use of the data, should comply with the requirements of the corresponding laws and regulations and related regulations.
Fig. 1 is a schematic flowchart of an image generation method provided in an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a situation of generating an image, and the method may be executed by an image generation apparatus, and the apparatus may be implemented in the form of software and/or hardware, and optionally implemented by an electronic device, and the electronic device may be a mobile terminal, a PC terminal, or a server.
As shown in fig. 1, the method includes:
s110, at least one initial special effect map is obtained based on the triggering operation of the user.
The initial special effect map may be a pre-constructed special effect map with a set size, and may be integrated into a pre-developed special effect resource package. For example, in a makeup application scenario, the initial effect map may be a makeup map related to a face, and may include an eye makeup map, a lip makeup map, and the like, for example: eyelash, blush, eyebrow, and eye etc.
In this embodiment, the manner of obtaining at least one initial special effect map based on the trigger operation of the user may be: loading special effect resources based on resource loading operation triggered by a user to generate a special effect resource panel; receiving at least one special effect resource selected by a user; at least one initial special effects map is obtained based on at least one special effects resource.
The special effect resource panel is used for displaying a plurality of special effect resources, and the special effect resources comprise initial special effect maps and rendering information. In this embodiment, a special effect editing interface is provided in a special effect generation tool or a special effect generation Application program (APP), and a user clicks a resource loading button in the special effect editing interface to load a special effect resource, so as to generate a special effect resource panel, where the special effect resource includes an initial special effect map and rendering information. A plurality of special effect resources are displayed in the special effect resource panel for selection by a user. The user selects at least one special effects resource in the special effects resource panel, thereby extracting at least one initial special effects map from the user selected special effects resource. In the application scene, by taking the generation of a makeup image as an example, a makeup tool or a makeup APP provides a makeup editing interface, and in the makeup editing interface, a user clicks a resource loading button in the makeup editing interface to load a makeup resource, so that a makeup resource panel is generated, and the makeup resource can comprise an initial makeup map and rendering information. And a plurality of cosmetic resources are displayed in the cosmetic resource panel for the user to select. The user selects at least one makeup resource in the makeup resource panel, thereby extracting at least one initial makeup map from the makeup resource selected by the user. Exemplarily, fig. 2 is an exemplary diagram of a makeup editing interface in the present embodiment, as shown in fig. 2, a lower half part of the interface is a makeup panel, and a makeup map 1, a makeup map 2, and a makeup map N are displayed in the makeup panel; rendering information 1, rendering information 2, … …, and rendering information M. The upper part of the interface is used for displaying a special effect image rendered based on the makeup resources selected by the user. In this embodiment, at least one initial special effect map is obtained based on a trigger operation of a user in the special effect tool, so that convenience in generating a special effect image can be improved.
S120, cutting the effective content area in the at least one initial special effect chartlet to obtain at least one target special effect chartlet.
The effective content area may be an area formed by pixels having actual pixel information. In this embodiment, the initial special effect map may be a makeup map, where an area having makeup is an effective content area and other areas are ineffective areas. The target special effect map is a map obtained by cutting out an effective content area in the initial special effect map, and the size of the target special effect map is smaller than that of the initial special effect map.
In this embodiment, the manner of obtaining at least one target special effect map by clipping the effective content area in at least one initial special effect map may be: extracting the transparency of pixel points in at least one initial special effect chartlet; determining an effective content area based on the transparency; and forming at least one target special effect map according to the effective content area.
Wherein, the transparency is stored in a setting channel in the initial special effect map, and the setting channel may be an alpha channel. The transparency can be any value between 0 and 1, if the transparency value is 0, the pixel point is represented to be completely transparent, and if the transparency value is more than 0, the pixel point is represented to be incompletely transparent. The effective content area may be an area formed by pixels having a transparency other than 0. The effective content area may be an irregularly shaped area.
Specifically, the manner of extracting the transparency of the pixel point in at least one initial special effect map may be: and traversing pixel points in the initial special effect maps for each initial special effect map, and extracting the transparency of the traversed pixel points stored in an alpha channel.
Specifically, the manner of determining the effective content area based on the transparency may be: and deleting the pixel points with the transparency equal to the first set value, and reserving the pixel points with the transparency greater than the first set value to obtain an effective content area.
Wherein the first set value may be any value between 0-0.2, for example set to 0.1. In this embodiment, if the transparency of the pixel point in the traversal initial special effect map is less than or equal to the first set value, the pixel point is deleted, and if the transparency of the pixel point in the traversal initial special effect map is greater than the first set value, the pixel point is retained. For example, fig. 3a to 3c are exemplary diagrams of the target special effect map in the present embodiment, as shown in fig. 3a, the target special effect map is an "eye shadow" special effect, as shown in fig. 3b, an "eye line special effect", as shown in fig. 3c, an artistic word special effect. In this embodiment, the effective content area in the initial special effect map is extracted based on the transparency of the pixel points, so that the image clipping efficiency can be improved.
S130, at least one target special effect map is fused with the original virtual image map to obtain a target virtual image map.
The original avatar map may be a surface map of the 3D avatar, and no special effect information is added to the original avatar map. For example a surface map of the face of the 3D avatar. Exemplarily, fig. 4 is an exemplary view of an original avatar map in the present embodiment, as shown in fig. 4, which is not drawn with any makeup.
In this embodiment, the process of fusing at least one target special effect map and the original virtual image map may be understood as follows: pixel values are sampled from at least one target special effect map, and the pixel values in the original avatar map are replaced with the sampled pixel values, thereby obtaining a target avatar map.
Specifically, the process of fusing at least one target special effect map with the original virtual image map to obtain the target virtual image map may be: determining the position information of a set boundary point corresponding to at least one target special effect map respectively; establishing a position corresponding relation between at least one target special effect map and an original virtual image map based on the position information of the set boundary point; and fusing at least one target special effect map and the original virtual image map based on the position corresponding relation to obtain a target virtual image map.
And setting boundary point position information as position information of the set boundary point of the target special effect map in the initial special effect map. The set boundary points may be two vertices of the target special effect map, and the set boundary point position information may be determined by a minimum UV abscissa x1, a minimum UV ordinate y1, a maximum UV abscissa x2, and a maximum UV ordinate y2 of the target special effect map (or the effective content area) in the initial special effect map. The coordinates of one vertex are represented as (x 1, y 1) and the coordinates of the other vertex are represented as (x 2, y 2).
In this embodiment, the original avatar map and the original avatar map have the same size, and the target avatar map is obtained by cutting the original avatar map, so that the target avatar map and the original avatar map have different sizes, i.e., pixels do not have a one-to-one correspondence, and therefore, a correspondence between pixels of the target avatar map and pixels of the original avatar map needs to be established. The UV coordinates of the target special effect map for which two vertices are in the target special effect map are (0,0) and (1,1), respectively, and their coordinates in the initial special effect map are (x 1, y 1) and (x 2, y 2). Since the original avatar-map is the same as the initial special effect-map, it can be understood that (0,0) and (1,1) in the target special effect-map correspond to (x 1, y 1) and (x 2, y 2) in the original avatar-map, i.e., (0,0) and (x 1, y 1), (1,1) and (x 2, y 2). Thereby, the position corresponding relation between at least one target special effect map and the original virtual image map can be established based on the vertex position information. The position correspondence can be expressed as: UV coordinates of the target special effect map = (UV coordinates of the original avatar map- (x 1, y 1))/((x 2, y 2) - (x 1, y 1)).
Specifically, the process of fusing at least one target special effect map and the original avatar map based on the position correspondence may be: for the pixel points in the original virtual image chartlet, determining corresponding sampling points of the pixel points in the target special effect chartlet according to the position corresponding relation; and sampling the pixel values of the sampling points, and replacing the pixel values of the pixel points with the sampled pixel values.
And the sampling points are corresponding pixel points of the pixel points in the original virtual image chartlet in the target special effect chartlet. In this embodiment, first, the UV coordinate of a pixel point in an original virtual image map is obtained, and then the UV coordinate is substituted into an expression of a position correspondence to obtain the UV coordinate of a sampling point of the pixel point in a target special effect map, so that a pixel value is adopted from the target special effect map according to the UV coordinate, and finally, the pixel value of the pixel point is replaced with the pixel value obtained by sampling.
Specifically, the manner of determining the corresponding sampling point of the pixel point in the target special effect map according to the position correspondence relationship may be: acquiring first position information of a pixel point in an original virtual image chartlet; and determining second position information of the pixel points at corresponding sampling points of the target special effect chartlet according to the position corresponding relation and the first position information.
The first position information and the second position information are both characterized by UV coordinates, the first position information can also be called first UV coordinates, and the second position information can be called second UV coordinates. In this embodiment, the first UV coordinate is substituted into the expression of the position correspondence, and a second UV coordinate of a sampling point corresponding to the pixel point in the target special effect map is obtained. In this embodiment, the sampling points corresponding to the pixel points in the target special effect map are determined based on the position correspondence, and the target special effect map can be accurately fused to the corresponding positions in the original virtual image map.
Optionally, the mode of replacing the pixel value of the sampling point with the pixel value of the pixel point may be: if the second position information is within the set threshold range, replacing the pixel value of the pixel point with the pixel value of the sampling point at the second position information; and if the second position information is out of the set threshold range, keeping the pixel value of the pixel point unchanged.
Wherein the set threshold range may be a range between 0 and 1, and the second position information being within the set threshold range may be understood as the UV abscissa and the UV ordinate being both within the set threshold range. The second position information being outside the set threshold range may be understood as the UV abscissa being outside the set threshold range, or the UV ordinate being outside the set threshold range, or both the UV abscissa and the UV ordinate being outside the set threshold range. In this embodiment, if the second position information is within the set threshold range, it indicates that a corresponding sampling point exists in the target special effect sticker for a pixel point in the initial virtual image sticker, and the pixel value of the pixel point is replaced with the pixel value of the sampling point located in the second position information. If the second position information is outside the set threshold range, it indicates that the pixel point in the initial virtual image chartlet does not have a corresponding sampling point in the target special effect chartlet, that is, the pixel is understood to be beyond the range of the area where the target special effect chartlet is located, and the pixel value of the pixel point is kept unchanged. Exemplarily, fig. 5 is an exemplary diagram of a target avatar map in the present embodiment, as shown in fig. 5, the target special effect maps of fig. 3 a-3 c are fused to corresponding positions in the original avatar map of fig. 4. In this embodiment, whether to replace the pixel value of the pixel point in the initial avatar map is determined according to whether the second position information is within the set threshold range, so that the sampling accuracy can be improved.
S140, rendering the target virtual image map to obtain the target virtual image map.
In this embodiment, the rendering of the target avatar map may be performed in a manner of obtaining the target avatar map: obtaining a rendering sequence of at least one target special effect map; and rendering the target virtual image map based on rendering sequence to obtain the target virtual image map.
Wherein the rendering order of the target special effect map may be understood as the rendering order of the initial special effect map. The rendering order may be predetermined by a developer, and the rendering order may be obtained by obtaining at least one initial special effect map selected by a user. And rendering the special effect areas in the target virtual image chartlet in sequence based on the rendering sequence after the rendering sequence is obtained. In the application scene, because the special effect chartlet can be a makeup chartlet, in the actual application scene, the superposed precedence position relationship needs to be determined between makeup with an overlapped relationship, and therefore, the rendering sequence of each target special effect chartlet needs to be determined when the target virtual image chartlet is rendered. In the embodiment, the target virtual image map is rendered based on the rendering sequence, so that the dressing display sequence is correct, and the display effect is improved.
In this embodiment, when rendering the target avatar map, rendering information of each pixel point needs to be determined, and the pixel points in the target avatar map are rendered based on the rendering information.
Specifically, the method for rendering the target avatar map to obtain the target avatar may be: and rendering the target virtual image map based on rendering information corresponding to the at least one initial special effect map to obtain the target virtual image map.
Wherein the rendering information includes at least one of: color information, material information, normal information, and illumination information. The texture information and the illumination information may be stored in the form of an image, the texture information being stored in an RGB channel of the image, and the illumination information being stored in an Alpha channel of the image. The normal information may also be stored in the form of an image, the RGB channels of which store the three components of the normal information, respectively. In this embodiment, the texture of the pixel points is calculated based on the texture information. And performing normal calculation on the pixel points based on the normal information, performing illumination calculation on the pixel points based on the illumination information, and assigning the color information to the pixel points. Exemplarily, fig. 6 is a schematic view of a target avatar diagram in the present embodiment, as shown in fig. 6, a variety of makeup is fused into an initial avatar. In the embodiment, the rendering information is used for rendering the target virtual image map, so that the diversity of the target virtual image map can be improved, and the display effect is enriched.
According to the technical scheme of the embodiment of the disclosure, at least one initial special effect map is obtained based on the triggering operation of a user; cutting an effective content area in at least one initial special effect chartlet to obtain at least one target special effect chartlet; fusing at least one target special effect map with the original virtual image map to obtain a target virtual image map; and rendering the target virtual image map to obtain the target virtual image map. According to the image generation method provided by the embodiment of the disclosure, the target special effect map cut from the initial special effect map is merged with the original virtual image map and then rendered, the whole initial special effect map is not required to be processed, the calculation amount can be greatly reduced, namely, the consumption of video memory resources can be reduced, and therefore, the generation efficiency of the virtual image is improved.
Fig. 7 is a schematic structural diagram of an image generating apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, the apparatus includes:
an initial special effect map obtaining module 710, configured to obtain at least one initial special effect map based on a trigger operation of a user;
a target special effect map obtaining module 720, configured to crop an effective content area in at least one initial special effect map to obtain at least one target special effect map;
a target virtual image map obtaining module 730, configured to fuse at least one target special effect map with an original virtual image map to obtain a target virtual image map;
and a rendering module 740, configured to render the target avatar map to obtain the target avatar map.
Optionally, the target special effect map obtaining module 720 is further configured to:
extracting the transparency of pixel points in at least one initial special effect chartlet; wherein, the transparency is stored in a set channel in the initial special effect map;
determining an effective content area based on the transparency;
and forming at least one target special effect map according to the effective content area.
Optionally, the target special effect map obtaining module 720 is further configured to:
and deleting the pixel points with the transparency less than or equal to the first set value, and reserving the pixel points with the transparency greater than the first set value to obtain an effective content area.
Optionally, the target avatar map obtaining module 730 is further configured to:
determining the position information of a set boundary point corresponding to at least one target special effect map respectively; setting boundary point position information as position information of a set boundary point of the target special effect map in the initial special effect map;
establishing a position corresponding relation between at least one target special effect map and an original virtual image map based on the position information of the set boundary point;
and fusing at least one target special effect map and the original virtual image map based on the position corresponding relation to obtain a target virtual image map.
Optionally, the target avatar map obtaining module 730 is further configured to:
for the pixel points in the original virtual image chartlet, determining the corresponding sampling points of the pixel points in the target special effect chartlet according to the position corresponding relation; wherein, the sampling point is a pixel point corresponding to a pixel point in the original virtual image chartlet in the target special effect chartlet;
and sampling the pixel values of the sampling points, and replacing the pixel values of the pixel points with the pixel values of the sampling points.
Optionally, the target avatar map obtaining module 730 is further configured to;
acquiring first position information of a pixel point in an original virtual image chartlet;
and determining second position information of the pixel point at a corresponding sampling point of the target special effect map according to the position corresponding relation and the first position information.
Optionally, the target avatar map obtaining module 730 is further configured to:
if the second position information is within the set threshold range, replacing the pixel value of the pixel point with the pixel value of the sampling point at the second position information;
and if the second position information is out of the set threshold range, keeping the pixel value of the pixel point unchanged.
Optionally, the rendering module 740 is further configured to:
obtaining a rendering sequence of at least one target special effect map;
and rendering the target virtual image map based on rendering sequence to obtain the target virtual image map.
Optionally, the initial special effect map obtaining module 710 is further configured to:
loading special effect resources based on resource loading operation triggered by a user to generate a special effect resource panel; the special effect resource panel is used for displaying a plurality of special effect resources, and the special effect resources comprise initial special effect maps and rendering information;
receiving at least one special effect resource selected by a user;
at least one initial special effects map is obtained based on at least one special effects resource.
Optionally, the rendering module 740 is further configured to:
rendering the target virtual image map based on rendering information corresponding to at least one initial special effect map to obtain a target virtual image map; wherein the rendering information includes at least one of: color information, material information, normal information, and illumination information.
The image generation device provided by the embodiment of the disclosure can execute the image generation method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the embodiments of the present disclosure.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring now to fig. 8, a schematic diagram of an electronic device (e.g., the terminal device or the server in fig. 8) 500 suitable for implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An editing/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 8 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present 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 method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The electronic device provided by the embodiment of the disclosure and the image generating method provided by the embodiment belong to the same inventive concept, and technical details which are not described in detail in the embodiment can be referred to the embodiment, and the embodiment has the same beneficial effects as the embodiment.
The disclosed embodiments provide a computer storage medium having stored thereon a computer program that, when executed by a processor, implements the image generation method provided by the above-described embodiments.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least one initial special effect map based on the triggering operation of a user; cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map; fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map; and rendering the target virtual image map to obtain the target virtual image map.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first obtaining unit may also be described as a "unit obtaining at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided an image generation method including:
acquiring at least one initial special effect map based on the triggering operation of a user;
cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map;
fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map;
and rendering the target virtual image map to obtain the target virtual image map.
Further, clipping the effective content area in the at least one initial special effect map to obtain at least one target special effect map, including:
extracting the transparency of the pixel points in the at least one initial special effect map; wherein the transparency is stored in a set channel in the initial special effect map;
determining an effective content area based on the transparency;
and forming at least one target special effect map according to the effective content area.
Further, determining an effective content area based on the transparency includes:
and deleting the pixel points with the transparency less than or equal to the first set value, and reserving the pixel points with the transparency greater than the first set value to obtain an effective content area.
Further, fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map, including:
determining the position information of a set boundary point corresponding to the at least one target special effect map respectively; wherein the set boundary point position information is position information of a set boundary point of the target special effect map in the initial special effect map;
establishing a position corresponding relation between the at least one target special effect map and the original virtual image map based on the position information of the set boundary point;
and fusing the at least one target special effect map and the original virtual image map based on the position corresponding relation to obtain a target virtual image map.
Further, fusing the at least one target special effect map with an original avatar map based on the position correspondence, including:
for the pixel points in the original virtual image chartlet, determining the corresponding sampling points of the pixel points in the target special effect chartlet according to the position corresponding relation; wherein, the sampling point is a pixel point corresponding to a pixel point in the original virtual image chartlet in the target special effect chartlet;
and sampling the pixel values of the sampling points, and replacing the pixel values of the pixel points with the pixel values of the sampling points.
Further, determining corresponding sampling points of the pixel points in the target special effect map according to the position corresponding relation, including;
acquiring first position information of the pixel point in the original virtual image chartlet;
and determining second position information of the pixel points at corresponding sampling points of the target special effect map according to the position corresponding relation and the first position information.
Further, replacing the pixel values of the sampling points with the pixel values of the pixel points includes:
if the second position information is within a set threshold range, replacing the pixel value of the pixel point with the pixel value of the sampling point of the second position information;
and if the second position information is out of the range of the set threshold value, keeping the pixel value of the pixel point unchanged.
Further, rendering the target avatar map to obtain a target avatar map, including:
obtaining a rendering sequence of the at least one target special effect map;
rendering the target virtual image map based on the rendering sequence to obtain the target virtual image map.
Further, acquiring at least one initial special effect map based on a trigger operation of a user, comprising:
loading special effect resources based on resource loading operation triggered by a user to generate a special effect resource panel; the special effect resource panel is used for displaying a plurality of special effect resources, and the special effect resources comprise initial special effect maps and rendering information;
receiving at least one special effect resource selected by a user;
obtaining at least one initial special effects map based on the at least one special effects resource.
Further, rendering the target avatar map to obtain a target avatar, including:
rendering the target virtual image map based on rendering information corresponding to the at least one initial special effect map to obtain a target virtual image map; wherein the rendering information includes at least one of: color information, material information, normal information, and illumination information.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (13)

1. An image generation method, comprising:
acquiring at least one initial special effect map based on the triggering operation of a user;
cutting the effective content area in the at least one initial special effect map to obtain at least one target special effect map;
fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map;
and rendering the target virtual image map to obtain the target virtual image map.
2. The method of claim 1, wherein clipping the active content area in the at least one initial special effect map to obtain at least one target special effect map comprises:
extracting the transparency of the pixel points in the at least one initial special effect map; wherein the transparency is stored in a set channel in the initial special effect map;
determining an effective content area based on the transparency;
and forming at least one target special effect chartlet according to the effective content area.
3. The method of claim 2, wherein determining the active content area based on the transparency comprises:
and deleting the pixel points with the transparency less than or equal to the first set value, and reserving the pixel points with the transparency greater than the first set value to obtain an effective content area.
4. The method of claim 1, wherein fusing the at least one target special effects map with an original avatar map to obtain a target avatar map comprises:
determining the position information of a set boundary point corresponding to the at least one target special effect map respectively; wherein the set boundary point position information is position information of a set boundary point of the target special effect map in the initial special effect map;
establishing a position corresponding relation between the at least one target special effect map and the original virtual image map based on the position information of the set boundary point;
and fusing the at least one target special effect map and the original virtual image map based on the position corresponding relation to obtain a target virtual image map.
5. The method of claim 4, wherein fusing the at least one target special effect map with an original avatar map based on the positional correspondence comprises:
for the pixel points in the original virtual image chartlet, determining corresponding sampling points of the pixel points in the target special effect chartlet according to the position corresponding relation; wherein, the sampling point is a pixel point corresponding to a pixel point in the original virtual image chartlet in the target special effect chartlet;
and sampling the pixel values of the sampling points, and replacing the pixel values of the pixel points with the sampled pixel values.
6. The method according to claim 5, wherein determining the corresponding sampling point of the pixel point in the target special effect map according to the position correspondence comprises;
acquiring first position information of the pixel point in the original virtual image chartlet;
and determining second position information of the pixel points at corresponding sampling points of the target special effect map according to the position corresponding relation and the first position information.
7. The method of claim 6, wherein replacing the pixel values of the sampling points with the pixel values of the pixel points comprises:
if the second position information is within a set threshold range, replacing the pixel value of the pixel point with the pixel value of the sampling point of the second position information;
and if the second position information is out of the range of the set threshold value, keeping the pixel value of the pixel point unchanged.
8. The method of claim 1, wherein rendering the target avatar map to obtain a target avatar map comprises:
obtaining a rendering sequence of the at least one target special effect map;
rendering the target virtual image map based on the rendering sequence to obtain the target virtual image map.
9. The method of claim 1, wherein obtaining at least one initial special effect map based on a user-triggered operation comprises:
loading special effect resources based on resource loading operation triggered by a user to generate a special effect resource panel; the special effect resource panel is used for displaying a plurality of special effect resources, and the special effect resources comprise initial special effect maps and rendering information;
receiving at least one special effect resource selected by a user;
obtaining at least one initial special effects map based on the at least one special effects resource.
10. The method of claim 9, wherein rendering the target avatar map to obtain a target avatar comprises:
rendering the target virtual image map based on rendering information corresponding to the at least one initial special effect map to obtain a target virtual image map; wherein the rendering information includes at least one of: color information, material information, normal information, and illumination information.
11. An image generation apparatus, comprising:
the system comprises an initial special effect map acquisition module, a special effect map generation module and a special effect map generation module, wherein the initial special effect map acquisition module is used for acquiring at least one initial special effect map based on the triggering operation of a user;
the target special effect chartlet acquisition module is used for cutting an effective content area in the at least one initial special effect chartlet to obtain at least one target special effect chartlet;
the target virtual image map obtaining module is used for fusing the at least one target special effect map with the original virtual image map to obtain a target virtual image map;
and the rendering module is used for rendering the target virtual image map to obtain the target virtual image map.
12. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image generation method of any of claims 1-10.
13. A storage medium containing computer-executable instructions for performing the image generation method of any one of claims 1-10 when executed by a computer processor.
CN202211215358.7A 2022-09-30 2022-09-30 Image generation method, device, equipment and storage medium Pending CN115578299A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211215358.7A CN115578299A (en) 2022-09-30 2022-09-30 Image generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211215358.7A CN115578299A (en) 2022-09-30 2022-09-30 Image generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115578299A true CN115578299A (en) 2023-01-06

Family

ID=84584024

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211215358.7A Pending CN115578299A (en) 2022-09-30 2022-09-30 Image generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115578299A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118001741A (en) * 2024-04-09 2024-05-10 湖南速子文化科技有限公司 Method, system, equipment and medium for displaying large number of virtual characters

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118001741A (en) * 2024-04-09 2024-05-10 湖南速子文化科技有限公司 Method, system, equipment and medium for displaying large number of virtual characters

Similar Documents

Publication Publication Date Title
CN111242881A (en) Method, device, storage medium and electronic equipment for displaying special effects
CN111243049B (en) Face image processing method and device, readable medium and electronic equipment
CN114782612A (en) Image rendering method, device, electronic device and storage medium
CN115358919A (en) Image processing method, device, equipment and storage medium
CN114842120A (en) Image rendering processing method, device, equipment and medium
WO2024041637A1 (en) Special effect image generation method and apparatus, device, and storage medium
CN111833459A (en) Image processing method and device, electronic equipment and storage medium
CN115082368A (en) Image processing method, device, equipment and storage medium
CN116301530A (en) Virtual scene processing method and device, electronic equipment and storage medium
CN115330925A (en) Image rendering method and device, electronic equipment and storage medium
CN115063335A (en) Generation method, device and equipment of special effect graph and storage medium
CN115170740A (en) Special effect processing method and device, electronic equipment and storage medium
CN115578299A (en) Image generation method, device, equipment and storage medium
CN114742934A (en) Image rendering method and device, readable medium and electronic equipment
CN114820878B (en) Image editing method and device
CN114339447B (en) Method, device and equipment for converting picture into video and storage medium
CN111275800B (en) Animation generation method and device, electronic equipment and computer readable storage medium
CN113961280A (en) View display method and device, electronic equipment and computer-readable storage medium
CN115272060A (en) Transition special effect diagram generation method, device, equipment and storage medium
CN116301526A (en) Interaction method, interaction device, electronic equipment and storage medium
CN115272061A (en) Method, device and equipment for generating special effect video and storage medium
CN114866706A (en) Image processing method, image processing device, electronic equipment and storage medium
CN116363239A (en) Method, device, equipment and storage medium for generating special effect diagram
CN117132608A (en) Image processing method, device, electronic equipment and storage medium
CN110807114B (en) Method, device, terminal and storage medium for picture display

Legal Events

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