A method and device for generating pictures
By obtaining user image design needs, filtering and laying out materials in the preset material feature library, the problems of low efficiency and high cost of manual design images in the existing technology are solved, and efficient and personalized image generation is achieved.
Patent Information
- Application Number
- CN202011598717.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2040-12-29
AI Technical Summary
In the prior art, the method of manually designing pictures is inefficient and costly, resulting in image design efficiency and cost problems.
Provides an image generation method, by obtaining the image design needs of the target user, determining the image design feature set and layout method, filtering materials that meet the design features from the preset material feature library, and layout according to the layout method to generate the target picture.
No need for manual design by professional designers, which improves image generation efficiency, reduces image design costs, and provides personalized customization services to improve user experience.
Smart Images

Figure CN112700514B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for generating a picture. Background Art
[0002] For a long time, people have been happy to use pictures to express their emotions, such as holiday cards, posters, promotional pictures, etc. These pictures have always required professional designers to design pictures according to the needs of users. The design content specifically includes picture elements, background, color and composition.
[0003] However, the method of having designers design pictures is not only inefficient, but also has a very high design cost due to the high labor cost of designers. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for generating an image to overcome the problem of low efficiency and high cost of the method of manually designing images in the prior art.
[0005] According to a first aspect, an embodiment of the present invention provides a method for generating an image, comprising:
[0006] Obtain the image design requirements of target users;
[0007] Determine a picture design feature set and a picture layout method according to the picture design requirements;
[0008] Selecting picture design materials that meet the picture design feature set from a preset material feature library;
[0009] The picture design materials are laid out according to the picture layout method to generate a target picture corresponding to the target user.
[0010] Optionally, the preset material feature library is established in the following manner:
[0011] Acquire historical design picture data and historical user evaluation data corresponding to each historical design picture in the historical design picture data, wherein the historical user evaluation data includes historical user evaluations of multiple users on the current historical design picture;
[0012] Determining the image design features of the current historical design image according to each historical user evaluation corresponding to the current historical design image;
[0013] The current historical design picture is stored based on the picture design feature to generate the preset material feature library.
[0014] Optionally, determining the picture design feature of the current historical design picture according to each historical user evaluation corresponding to the current historical design picture includes:
[0015] Inputting the historical design image data and the historical user evaluation data into an initial design feature evaluation model to train the initial design feature model to obtain a design feature evaluation model;
[0016] The current historical design picture and the corresponding historical user evaluations are input into the design feature evaluation model to obtain the picture design features of the current historical design picture.
[0017] Optionally, the picture design feature set includes at least: background design features, picture element design features and text design features, and the step of selecting picture design materials satisfying the picture design feature set from a preset material feature library includes:
[0018] Background materials satisfying the background design features, picture element materials satisfying the picture element design features, and text materials satisfying the text design features are screened from the preset material feature library.
[0019] Optionally, the step of laying out the picture design material case in the picture layout mode to generate a target picture corresponding to the target user includes:
[0020] Determining the image size of the target image according to the image layout mode;
[0021] Determine the size of the background material based on the image size;
[0022] Based on the picture layout mode, determine the picture element position and the text position of the picture element material and the text material in the background material;
[0023] The size of the picture element and the text size are determined based on the picture element position and the text position, and the target picture is generated.
[0024] Optionally, before laying out the picture design material according to the picture layout mode, the method further includes:
[0025] Obtaining historical design images of the target user;
[0026] Determining user preference characteristics of the target user based on the historical design images;
[0027] The image design materials are screened based on the user's preference characteristics.
[0028] Optionally, determining the picture layout mode according to the picture design requirement includes:
[0029] Dividing the target image into regions based on a preset image division rule;
[0030] Encoding each region divided into the target image based on a preset encoding rule;
[0031] The layout of the picture is determined by using the encoding of each area according to the picture design requirements.
[0032] According to a second aspect, an embodiment of the present invention provides a picture generating device, including:
[0033] The acquisition module is used to obtain the image design requirements of the target users;
[0034] A first processing module, used to determine a picture design feature set and a picture layout method according to the picture design requirements;
[0035] A second processing module, used for screening picture design materials satisfying the picture design feature set from a preset material feature library;
[0036] The third processing module is used to layout the picture design materials according to the picture layout method to generate a target picture corresponding to the target user.
[0037] According to a third aspect, an embodiment of the present invention provides an electronic device, including:
[0038] A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method described in the first aspect and any one of its optional embodiments by executing the computer instructions.
[0039] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect or any optional embodiment thereof.
[0040] The technical solution of the present invention has the following advantages:
[0041] The picture generation method and device provided by the embodiment of the present invention include: obtaining the picture design requirements of the target user; determining the picture design feature set and the picture layout method according to the picture design requirements; screening the picture design materials that meet the picture design feature set from the preset material feature library; laying out the picture design materials according to the picture layout method, and generating the target picture corresponding to the target user. Thus, by utilizing the picture design materials stored according to the picture design features in the preset material feature library, the corresponding design materials are extracted and laid out according to the user's picture design requirements, and then the target picture required by the user is automatically generated, without the need for professional designers to perform manual design, thereby improving the picture generation efficiency and reducing the picture design cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 A flowchart of a method for generating an image according to an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of encoding a picture area according to an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a picture generation result according to an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of a card generation process according to an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of a picture generating device according to an embodiment of the present invention;
[0048] Figure 6 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] The technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0051] For a long time, people have been happy to use pictures to express their emotions, such as holiday cards, posters, promotional pictures, etc. These pictures have always required professional designers to design pictures according to the needs of users. The design content specifically includes picture elements, background, color and composition.
[0052] However, the method of having designers design pictures is not only inefficient, but also has a very high design cost due to the high labor cost of designers.
[0053] Based on the above problems, an embodiment of the present invention provides a method for generating an image. Figure 1 As shown, the image generation method specifically includes the following steps:
[0054] Step S101: Obtain the image design requirements of the target user.
[0055] The image design requirements include multiple design elements input by the user, such as the purpose of the image, image elements, text content, and special requirements. For example, the image design requirements are a blessing card wishing Li Ming a speedy recovery, a Christmas blessing card, etc.
[0056] Step S102: Determine a picture design feature set and a picture layout method according to picture design requirements.
[0057] Among them, a preset recognition model can be used to extract the design features and picture layout methods of the target picture from the picture design requirements input by the user. The preset recognition model is trained using a sample set corresponding to historical user picture design requirements and design features and picture layout methods. The corresponding design features and picture layout methods can also be extracted from the picture design requirements manually, but the present invention is not limited to this.
[0058] Step S103: Filtering picture design materials that meet the picture design feature set from the preset material feature library.
[0059] The preset material feature library is composed of a feature background library, a feature element library, a feature text library, etc. Each library establishes a material index through design features. For example, in the feature background library, background material indexes are established according to the style of the picture background: mountains, jungles, sea, etc. In practical applications, multiple indexes can be established for each material. For example, the index of background time and style is: mountains in the morning, mountains in the evening, etc., but the present invention is not limited to this.
[0060] Step S104: Laying out the picture design materials according to the picture layout method to generate a target picture corresponding to the target user.
[0061] Among them, when the screened image design materials include multiple combinations, each combination can be laid out separately to generate multiple target images for users to choose from, or the user can be prompted to continue entering details of the design requirements to reduce the combination methods of the image design materials until the number of target images required by the user is reached. The present invention is not limited to this.
[0062] By executing the above-mentioned steps S101 to S104, the picture generation method provided by the embodiment of the present invention utilizes the picture design materials stored according to the picture design features in the preset material feature library, extracts the corresponding design materials and performs layout according to the user's picture design requirements, and then automatically generates the target picture required by the user. There is no need for professional designers to perform manual design, which improves the picture generation efficiency and reduces the picture design cost.
[0063] Specifically, in one embodiment, determining the image layout mode in the above step S102 specifically includes the following steps:
[0064] Step S201: Divide the target image into regions based on a preset image division rule.
[0065] Among them, the preset image division rules can be set according to the user's design precision requirements. For example: the higher the user's requirements for image details, the more areas the target image will be divided into. If the user's requirements for image details are lower, the fewer areas the target image will be divided into. The number of area divisions reflects the precision of the image design, and each area is the smallest design unit of the target image.
[0066] Step S202: Encode each region divided into the target image based on a preset encoding rule.
[0067] The preset encoding rule can be flexibly set according to actual needs, for example: dividing the target image into Figure 2 As shown in the areas, each area is encoded in the manner of A1, A2, B1, B2, and different picture materials can be placed in each area.
[0068] Step S203: Determine the layout of the picture using the codes of each area according to the picture design requirements.
[0069] Specifically, according to the user's design requirements, such as the above-mentioned unified production form or fixed format requirements of the greeting card or the design position specified by the user, the picture layout mode of the target picture can be formed.
[0070] Specifically, in one embodiment, the above-mentioned preset material feature library is established in the following manner:
[0071] Step S301: Acquire historical design picture data and historical user evaluation data corresponding to each historical design picture in the historical design picture data.
[0072] The historical user evaluation data includes historical user evaluations of multiple users on the current historical design image.
[0073] Step S302: determining the picture design features of the current historical design picture according to the historical user evaluations corresponding to the current historical design picture.
[0074] Among them, the picture design features of the current historical design pictures are determined by utilizing the idea of machine learning.
[0075] The specific process includes: inputting historical design picture data and historical user evaluation data into the initial design feature evaluation model to train the initial design feature model to obtain the design feature evaluation model; inputting the current historical design picture and the corresponding historical user evaluations into the design feature evaluation model to obtain the picture design features of the current historical design picture. Among them, the initial design feature evaluation model can select an existing neural network model or design a special model according to user needs, and the present invention is not limited to this.
[0076] Step S303: storing the current historical design pictures based on the picture design features to generate a preset material feature library.
[0077] Specifically, since human emotions have certain commonalities, most people have the same perception of beauty. The graphic elements, colors, composition and aesthetics in the pictures have regularities, and usually certain graphic elements and colors represent a specific meaning. Therefore, by using massive amounts of data to summarize and generalize, we can form users' general behavioral preferences and aesthetic preferences, and determine the picture design features of each historical design picture based on the users' general behavioral preferences and aesthetic preferences, and establish corresponding picture design feature labels for each picture component contained in the historical design picture, and store each picture component in the historical design picture separately according to the picture design feature labels to form a preset material feature library.
[0078] Specifically, in one embodiment, the picture design feature set includes at least: background design features, picture element design features and text design features, and the above-mentioned step S103 specifically includes: selecting background materials that meet the background design features, picture element materials that meet the picture element design features and text materials that meet the text design features from a preset material feature library.
[0079] In actual applications, pictures are basically composed of background, theme picture elements set in the background, and text. Picture elements are used to embellish the background and play a finishing touch, such as the sun reflecting the weather and the dove of peace representing blessings. Among them, background design features, picture element design features, and text design features can all classify picture materials according to time, mood, weather, applicable scenarios, etc.
[0080] Specifically, in one embodiment, the above step S104 specifically includes the following steps:
[0081] Step S401: Determine the image size of the target image according to the image layout mode.
[0082] The image layout method includes the size of the image, such as 16K, 24K, etc., and the shape of rectangle, square, circle, etc., so that the specific side length or radius and other dimensions of the target image can be determined.
[0083] Step S402: Determine the size of the background material based on the image size.
[0084] Among them, the size of the picture is usually the size of the background material. In practical applications, part of the size can be reserved as the size of the background material based on the picture size according to actual needs. For example, when the picture needs to be framed, part of the size can be reserved at the edge of the picture to avoid obstruction.
[0085] Step S403: based on the picture layout mode, determine the picture element position and the text position of the picture element material and the text material in the background material.
[0086] Specifically, by using Figure 2 The encoding method shown in the figure obtains the above picture layout method, and then determines the position of picture elements and text. Take the production of greeting card pictures as an example. Figure 3 As shown, place the recipient of the greeting card in area B2, the greeting content in areas C2:C5, D2:D5, the issuer's signature in E5, the decorative picture element seagull in B5, and the decorative picture element QR code in F6.
[0087] Step S404: Determine the size of the image element and the text size based on the image element position and the text position, and generate a target image.
[0088] Among them, Figure 3 Taking the target picture shown as an example, the picture design requirements input by the user include: a greeting card wishing a speedy recovery. The ocean in the target picture represents a sunny mood, and the seagulls in the sky bring vitality. The text in the picture is the greeting input by the user, and the QR code represents the link to the blessing video made by the user.
[0089] Specifically, in one embodiment, different users have their own special picture design preferences, such as preference for blue design, etc. In order to provide users with personalized picture design services so that the designed pictures are more in line with the personal preferences of users, before executing the above step S104, the above picture generation method further includes the following steps:
[0090] Step S105: Acquire the historical design pictures of the target user.
[0091] The historical design image may be an image designed according to the user's historical image design requirements, or may be a favorite image design sample input by the user himself.
[0092] Step S106: Determine the user preference characteristics of the target user based on the historical design pictures.
[0093] Specifically, by performing similarity analysis on all historical design pictures of the user, common features can be extracted from these historical design pictures, and customer preferences can be statistically summarized to form a customer portrait. For example, if the background of most historical design pictures is blue, the user's preference feature is set to blue.
[0094] Step S107: Screening the image design materials based on the user's preference characteristics.
[0095] Specifically, in actual applications, there are many different combinations of picture design materials selected according to the user's picture design needs. At this time, these combinations can be selected according to user preference characteristics. For example: only select picture design material combinations with a blue background color, and then layout the selected picture design materials according to the above-mentioned picture layout method to obtain pictures that better meet the user's preferences, provide users with personalized customization services, and improve the user experience.
[0096] In practical applications, Figure 4 Taking the card generation process as an example, the complete process of card generation is introduced. Figure 4 As shown, after obtaining the target image, the target image can also be used as a historical design image to update the design feature evaluation model, and continuously optimize the material feature library to provide users with more accurate design services next time.
[0097] By executing the above steps, the picture generation method provided by the embodiment of the present invention uses the picture design materials stored in the preset material feature library according to the picture design features, extracts the corresponding design materials according to the user's picture design requirements and performs layout, and then automatically generates the target picture required by the user, without the need for professional designers to perform manual design, thereby improving the picture generation efficiency and reducing the picture design cost. In addition, it also provides personalized customization services for specific users, improving the user experience.
[0098] The embodiment of the present invention also provides a picture generating device, such as Figure 5 As shown, the image generating device includes:
[0099] The acquisition module 101 is used to acquire the image design requirements of the target user. For details, please refer to the relevant description of step S101 in the above method embodiment, which will not be repeated here.
[0100] The first processing module 102 is used to determine the picture design feature set and the picture layout mode according to the picture design requirements. For details, please refer to the relevant description of step S102 in the above method embodiment, which will not be repeated here.
[0101] The second processing module 103 is used to select picture design materials that meet the picture design feature set from the preset material feature library. For details, please refer to the relevant description of step S103 in the above method embodiment, which will not be repeated here.
[0102] The third processing module 104 is used to lay out the picture design materials according to the picture layout mode to generate a target picture corresponding to the target user. For details, please refer to the relevant description of step S104 in the above method embodiment, which will not be repeated here.
[0103] The image generation device provided in the embodiment of the present invention is used to execute the image generation method provided in the above embodiment. Its implementation method and principle are the same. For details, please refer to the relevant description of the above method embodiment, which will not be repeated here.
[0104] Through the collaborative cooperation of the above-mentioned components, the image generation device provided by the embodiment of the present invention utilizes the image design materials stored according to the image design features in the preset material feature library, extracts the corresponding design materials and lays them out according to the user's image design requirements, and then automatically generates the target image required by the user. There is no need for professional designers to perform manual design, which improves the image generation efficiency and reduces the image design cost.
[0105] Figure 6 An electronic device according to an embodiment of the present invention is shown. Figure 6As shown, the electronic device includes: a processor 901 and a memory 902, wherein the processor 901 and the memory 902 can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0106] The processor 901 may be a central processing unit (CPU). The processor 901 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0107] The memory 902 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the methods in the above method embodiments. The processor 901 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 902, that is, implementing the methods in the above method embodiments.
[0108] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 901, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 902 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the processor 901 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0109] One or more modules are stored in the memory 902 , and when executed by the processor 901 , the method in the above method embodiment is executed.
[0110] The specific details of the above electronic device can be understood by referring to the corresponding descriptions and effects in the above method embodiments, and will not be repeated here.
[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the implemented program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0112] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for generating an image, characterized in that: include: Obtain the image design requirements of target users; According to the picture design requirements, determine the picture design feature set and picture layout method, Determining the picture layout mode according to the picture design requirements includes: dividing the target picture into regions based on a preset picture division rule; encoding each region divided into the target picture based on a preset encoding rule; determining the picture layout mode according to the picture design requirements using the encoding of each region, wherein the preset picture division rule is set according to the user's design refinement requirements; Selecting picture design materials that meet the picture design feature set from a preset material feature library; The picture design materials are laid out according to the picture layout method to generate a target picture corresponding to the target user.
2. The method according to claim 1, characterized in that The preset material feature library is established in the following manner: Acquire historical design picture data and historical user evaluation data corresponding to each historical design picture in the historical design picture data, wherein the historical user evaluation data includes historical user evaluations of multiple users on the current historical design picture; Determining the image design features of the current historical design image according to each historical user evaluation corresponding to the current historical design image; The current historical design picture is stored based on the picture design feature to generate the preset material feature library.
3. The method according to claim 2, characterized in that The determining, according to each historical user evaluation corresponding to the current historical design picture, the picture design feature of the current historical design picture includes: Inputting the historical design image data and the historical user evaluation data into an initial design feature evaluation model to train the initial design feature model to obtain a design feature evaluation model; The current historical design picture and the corresponding historical user evaluations are input into the design feature evaluation model to obtain the picture design features of the current historical design picture.
4. The method according to claim 3, characterized in that: The picture design feature set includes at least: background design features, picture element design features and text design features, and the step of selecting picture design materials that meet the picture design feature set from a preset material feature library includes: Background materials satisfying the background design features, picture element materials satisfying the picture element design features, and text materials satisfying the text design features are screened from the preset material feature library.
5. The method according to claim 4, characterized in that The step of laying out the picture design material case in the picture layout mode to generate a target picture corresponding to the target user includes: Determining the image size of the target image according to the image layout mode; Determine the size of the background material based on the image size; Based on the picture layout mode, determine the picture element position and the text position of the picture element material and the text material in the background material; The size of the picture element and the text size are determined based on the picture element position and the text position, and the target picture is generated.
6. The method according to claim 1, characterized in that Before laying out the picture design material according to the picture layout method, the method further includes: Obtaining historical design images of the target user; Determining user preference characteristics of the target user based on the historical design images; The image design materials are screened based on the user's preference characteristics.
7. A picture generating device, characterized in that: include: The acquisition module is used to obtain the image design requirements of the target users; The first processing module is used to determine a picture design feature set and a picture layout method according to the picture design requirements. Determining the picture layout mode according to the picture design requirements includes: dividing the target picture into regions based on a preset picture division rule; encoding each region divided into the target picture based on a preset encoding rule; determining the picture layout mode according to the picture design requirements using the encoding of each region, wherein the preset picture division rule is set according to the user's design refinement requirements; A second processing module, used for screening picture design materials satisfying the picture design feature set from a preset material feature library; The third processing module is used to layout the picture design materials according to the picture layout method to generate a target picture corresponding to the target user.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Display content generation method and device
CN110032352A
Picture generation method and system, electronic equipment and storage medium
CN110750666A