Poster generation method and device, computer equipment and storage medium
By acquiring the edge image of the text layout image, using the text-generated image model to generate the initial image and deleting the text content, combined with color extraction and optimization processing, the problem of low text accuracy in poster generation is solved, and high-quality poster generation is achieved.
Patent Information
- Application Number
- CN202510669318.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-10-21
AI Technical Summary
Existing technologies have low accuracy in text generation when generating posters, which greatly reduces the precision and controllability of the text, resulting in low overall intelligence and affecting visual effects and information delivery efficiency.
By acquiring the edge image of the text layout image, generating an initial image using the text-generated image model, deleting the text content to obtain a pure background image, and obtaining the target text color information through color extraction algorithms and optimization processing, the text is finally printed on the pure background image.
It enables more accurate acquisition of pure background images and optimized text color information, improving the precision, controllability, and intelligence of poster text, enhancing the integration effect of text and background, and improving the accuracy and intelligence of poster generation.
Smart Images

Figure CN120823286A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology and can be applied to fields such as financial technology and digital medicine, and in particular to poster generation methods, devices, computer equipment and storage media. Background Art
[0002] In advertising and marketing, posters, as an intuitive and highly effective visual communication medium, are widely used in various commercial activities, product promotions, brand image building, and knowledge dissemination. Poster production demands encompass holiday promotions, new product launches, corporate image display, and the dissemination of professional knowledge, making it an indispensable part of any marketing strategy.
[0003] With the rapid development of artificial intelligence and computer vision technology, automated poster generation technology has emerged, aiming to automatically generate high-quality posters through algorithmic models to reduce the burden on designers and improve production efficiency. However, the application of currently available image generation technology in the field of poster production still faces many challenges, especially the lack of text rendering capabilities, which has become a key factor restricting its development. Specifically, when generating posters, the accuracy of the text part of the existing technology is low, resulting in a significant reduction in the precise controllability of the poster in terms of text, and the overall intelligence is low. This not only affects the visual effect and information communication efficiency of the poster, but also limits the widespread application of automated poster generation technology in the commercial field.
[0004] For example, in the production of promotional posters for investment products in the financial sector, accurate and engaging text descriptions are crucial for attracting potential investors. Traditional or existing technology-generated posters can suffer from poor text rendering, resulting in unclear or incorrect descriptions of key investment product information and misleading investors.
[0005] Therefore, there is an urgent need to develop an efficient and intelligent poster generation solution to overcome the shortcomings of existing technologies, meet the market demand for high-quality and efficient poster production, and promote the intelligent upgrading of poster production technology. Summary of the Invention
[0006] The purpose of the embodiments of the present application is to propose a poster generation method, apparatus, computer equipment and storage medium to solve the technical problem that when generating posters in the prior art, the accuracy of the text part is low, resulting in a significant reduction in the precise controllability of the text on the poster and low overall intelligence.
[0007] In a first aspect, a poster generation method is provided, comprising:
[0008] Obtaining a text layout image corresponding to the preset text layout data;
[0009] Performing edge extraction processing on the text layout image to obtain a corresponding edge image;
[0010] Obtaining preset background prompt words, and processing the edge image and the background prompt words based on a text-based graph model to generate a corresponding initial generated image;
[0011] Deleting text content from the initially generated image to obtain a corresponding pure background image;
[0012] extracting text color information from the initially generated image based on a preset color extraction algorithm;
[0013] Optimizing the text color information to obtain corresponding target text color information;
[0014] Based on the text typesetting data, the target text color information is used to perform corresponding text printing processing on the pure background image to obtain a corresponding target poster.
[0015] In a second aspect, a poster generating device is provided, comprising:
[0016] An acquisition module, used to acquire a text layout image corresponding to preset text layout data;
[0017] A first extraction module is used to extract edges from the text layout image to obtain a corresponding edge image;
[0018] a processing module, configured to obtain a preset background prompt word, and process the edge image and the background prompt word based on a text-based graph model to generate a corresponding initial generated image;
[0019] A deletion module, configured to delete text content from the initially generated image to obtain a corresponding pure background image;
[0020] A second extraction module, configured to extract text color information from the initially generated image based on a preset color extraction algorithm;
[0021] An optimization module, configured to optimize the text color information to obtain corresponding target text color information;
[0022] A generation module is used to perform corresponding text printing processing on the pure background image based on the text typesetting data using the target text color information to obtain a corresponding target poster.
[0023] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned poster generation method when executing the computer program.
[0024] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned poster generation method are implemented.
[0025] In the scheme implemented by the above-mentioned poster generation method, device, computer equipment and storage medium, first, a text layout picture corresponding to the preset text layout data is obtained; and the edge extraction processing is performed on the text layout picture to obtain a corresponding edge image; then the preset background prompt words are obtained, and the edge image and the background prompt words are processed based on the text graph model to generate a corresponding initial generated image; then the text content of the initial generated image is deleted to obtain a corresponding pure background picture; subsequently, text color information is extracted from the initial generated image based on a preset color extraction algorithm; the text color information is further optimized to obtain the corresponding target text color information; finally, based on the text layout data, the target text color information is used to perform corresponding text printing processing on the pure background picture to obtain the corresponding target poster. This application obtains a text layout picture corresponding to the preset text layout data, extracts edges from the text layout picture to obtain an edge image, then obtains preset background prompt words, and processes the edge image and background prompt words based on the use of the text graph model to generate an initial generated image, then deletes the text content from the initial generated image to obtain a pure background picture, and then extracts text color information from the initial generated image based on the use of a color extraction algorithm, and optimizes the text color information to obtain target text color information, and finally, based on the text layout data, uses the target text color information to perform corresponding text printing on the pure background picture to obtain the corresponding target poster. Through the above-mentioned poster generation process, this application can achieve more accurate acquisition of pure background pictures, and extract and optimize text color information, so that the generated target poster with text is more accurate and controllable in terms of text, and the fusion effect of text and background is better, effectively improving the accuracy and intelligence of the generated target poster. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0027] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0028] Figure 2is a flowchart of an embodiment of a poster generation method according to the present application;
[0029] Figure 3 is a structural diagram of an embodiment of a poster generating device according to the present application;
[0030] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0032] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0034] like Figure 1 As shown, system architecture 100 may include a terminal device 101, a network 102, and a server 103. Terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. Network 102 is a medium for providing a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0035] The user can use the terminal device 101 to interact with the server 103 via the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0036] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer and a desktop computer, etc.
[0037] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .
[0038] It should be noted that the poster generation method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the poster generation device is generally set in the server / terminal device.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0040] Continue to refer Figure 2 , shows a flowchart of an embodiment of the poster generation method according to the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted. The poster generation method provided in the embodiment of the present application can be applied to any scenario where poster generation is required, and the poster generation method can be applied to products in these scenarios, for example, poster generation in the financial insurance field or the digital medical field. The poster generation method comprises the following steps:
[0041] Step S201: Acquire a text layout image corresponding to preset text layout data.
[0042] In this embodiment, the poster generation method is executed on the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain the text layout image through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (ultrasound) connection, and other wireless connection methods currently known or developed in the future. The executive subject of this application is specifically a poster generation system, which can be referred to as the system for short. This application can be applied to business processing scenarios for poster generation in the financial insurance field and the digital medical field. Exemplarily, for the financial insurance field, the setting of the poster theme for the poster to be generated may be: with "Wealth Guardian New Product Launch Conference" as the core theme, it aims to showcase the newly launched financial insurance products. For the digital medical field, the setting of the poster theme for the poster to be generated may be: with "Smart Health Guardian New Product Launch Conference" as the core theme, it highlights the newly launched digital medical products or services.
[0043] The above text layout data includes text content and text parameters. The specific implementation process of obtaining the text layout image corresponding to the preset text layout data will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0044] Step S202: performing edge extraction processing on the text layout image to obtain a corresponding edge image.
[0045] In this embodiment, the specific implementation process of extracting the edge of the text layout image to obtain the corresponding edge image will be further described in detail in subsequent specific embodiments of this application and will not be elaborated on here.
[0046] Step S203 : obtaining preset background prompt words, and processing the edge image and the background prompt words based on a text-based graph model to generate a corresponding initial generated image.
[0047] In this embodiment, the above-mentioned cultural graph model can specifically adopt an open source cultural graph model with a Control Net module, such as Stable Diffusion. The above-mentioned background prompt words are detailed prompt words pre-built according to actual business needs, describing the characteristics of the background image to be generated. For example, "A futuristic financial technology conference site with cool lighting effects and advanced technology product displays." Specifically, the extracted edge image can be used as a control condition, and the above-mentioned background prompt words can be input into the above-mentioned cultural graph model. The cultural graph model will generate an initial generated image based on the input conditions.
[0048] Step S204 , deleting text content from the initially generated image to obtain a corresponding pure background image.
[0049] In this embodiment, since the text layout in the initial generated image is manually set and fixed in position, it is necessary to use a tool (such as the Lama tool) to erase the text in the fixed position to obtain a pure background image without text. The specific implementation process of deleting the text content from the initial generated image to obtain the corresponding pure background image will be further described in detail in subsequent specific embodiments of this application and will not be elaborated on here.
[0050] Step S205 : extracting text color information from the initially generated image based on a preset color extraction algorithm.
[0051] In this embodiment, the selection of the color extraction algorithm is not specifically limited and can be determined according to actual business needs, for example, it can be implemented by pillow. The selected color extraction algorithm can be used to extract the corresponding text color information from the initial generated image.
[0052] Step S206: Optimize the text color information to obtain corresponding target text color information.
[0053] In this embodiment, the above-mentioned specific implementation process of optimizing the text color information to obtain the corresponding target text color information will be further described in detail in subsequent specific embodiments of this application and will not be elaborated on here.
[0054] Step S207 : Based on the text typesetting data, the target text color information is used to perform corresponding text printing processing on the pure background image to obtain a corresponding target poster.
[0055] In this embodiment, the above-mentioned specific implementation process of performing corresponding text printing processing on the pure background image based on the text typesetting data and using the target text color information to obtain the corresponding target poster will be further described in detail in the subsequent specific embodiments of this application and will not be elaborated on here.
[0056] The present application first obtains a text layout picture corresponding to preset text layout data; and extracts edges of the text layout picture to obtain a corresponding edge image; then obtains preset background prompt words, and processes the edge image and the background prompt words based on a text graph model to generate a corresponding initial generated image; then deletes the text content from the initial generated image to obtain a corresponding pure background picture; subsequently, extracts text color information from the initial generated image based on a preset color extraction algorithm; further optimizes the text color information to obtain corresponding target text color information; finally, based on the text layout data, uses the target text color information to perform corresponding text printing on the pure background picture to obtain a corresponding target poster. This application obtains a text layout picture corresponding to the preset text layout data, extracts edges from the text layout picture to obtain an edge image, then obtains preset background prompt words, and processes the edge image and background prompt words based on the use of the text graph model to generate an initial generated image, then deletes the text content from the initial generated image to obtain a pure background picture, and then extracts text color information from the initial generated image based on the use of a color extraction algorithm, and optimizes the text color information to obtain target text color information, and finally, based on the text layout data, uses the target text color information to perform corresponding text printing on the pure background picture to obtain the corresponding target poster. Through the above-mentioned poster generation process, this application can achieve more accurate acquisition of pure background pictures, and extract and optimize text color information, so that the generated target poster with text is more accurate and controllable in terms of text, and the fusion effect of text and background is better, effectively improving the accuracy and intelligence of the generated target poster.
[0057] In some optional implementations, step S204 includes the following steps:
[0058] Call the preset deep learning model.
[0059] In this embodiment, the deep learning model is a model that is generated by training image data containing text and non-text areas and is capable of accurately identifying text areas in images.
[0060] Perform text area detection on the initially generated image based on the deep learning model to obtain a corresponding text area detection result.
[0061] In this embodiment, the above-mentioned initial generated image can be input into a deep learning model, and the deep learning model will perform text area detection on the initial generated image and output the corresponding text area detection result. The text area detection result includes the probability that each pixel in the initial generated image belongs to a text area or a non-text area.
[0062] A mask of the corresponding text area is generated based on the text area detection result.
[0063] In this embodiment, a mask of the corresponding text area can be generated based on the output of the deep learning model. In the mask, the white area represents the text area, and the black area represents the non-text area.
[0064] Call the preset image restoration algorithm.
[0065] In this embodiment, there is no specific limitation on the selection of the above-mentioned image restoration algorithm, which can be determined according to actual business needs. For example, an image restoration algorithm based on a generative adversarial network (GAN) based on deep learning can be used.
[0066] The image restoration algorithm is guided based on the mask to restore the text area to obtain a corresponding restored image.
[0067] In this embodiment, the generated text region mask is used as model input to guide the model corresponding to the above-mentioned image inpainting algorithm to inpaint the initial generated image so that it blends naturally with the surrounding background. Specifically, during the inpainting process, the model generates content that matches the background based on the color, texture, and other information of the surrounding pixels, filling the text region. The result is a pure background image without text, i.e., the inpainted image.
[0068] The repaired image is used as the pure background image.
[0069] This application calls a preset deep learning model; then performs text area detection on the initial generated image based on the deep learning model to obtain the corresponding text area detection result; then generates a corresponding text area mask based on the text area detection result; subsequently calls a preset image restoration algorithm; and guides the image restoration algorithm to restore the text area based on the mask to obtain the corresponding restoration image; finally, uses the restoration image as the pure background image. This application uses a deep learning model to perform text area detection on the initial generated image to obtain the corresponding text area detection result, and generates a corresponding text area mask based on the text area detection result, and then restores the text area based on the image restoration algorithm, thereby automatically and accurately deleting the text content of the initial generated image and obtaining a pure background image without text, effectively ensuring the accuracy of the pure background image obtained.
[0070] In some optional implementations of this embodiment, step S206 includes the following steps:
[0071] Get the background color information of the surrounding background corresponding to the text content.
[0072] In this embodiment, the corresponding background color information can be obtained by analyzing and extracting the color features of the background surrounding the text content.
[0073] The background color information and the text color information are fused and analyzed based on a preset color analysis strategy to obtain a corresponding color fusion analysis result.
[0074] In this embodiment, the above-mentioned specific implementation process of performing fusion analysis on the background color information and the text color information based on the preset color analysis strategy to obtain the corresponding color fusion analysis results will be further described in detail in subsequent specific embodiments of this application and will not be elaborated on here.
[0075] The text color information is optimized and adjusted according to the color fusion analysis result to obtain adjusted text color information.
[0076] In this embodiment, the text color information extracted from the initial generated image is optimized and adjusted based on the color fusion analysis results. Specifically, if the contrast between the text color and the background color is too low, the brightness or saturation of the text color is appropriately increased; if the contrast is too high, the brightness or saturation of the text color is reduced.
[0077] The adjusted text color information is used as the target text color information.
[0078] In this embodiment, for text with a gradient effect, the starting and ending colors, as well as the gradient direction, can be fine-tuned based on the changing trend of the background color to better blend into the background. A color histogram can be generated by statistically analyzing the colors of the text area. This color histogram can then be used to understand the main distribution range and changing trends of the text color.
[0079] The present application obtains the background color information of the surrounding background corresponding to the text content; then, based on a preset color analysis strategy, the background color information and the text color information are fused and analyzed to obtain a corresponding color fusion analysis result; then, the text color information is optimized and adjusted according to the color fusion analysis result to obtain adjusted text color information; and subsequently, the adjusted text color information is used as the target text color information. The present application obtains the background color information of the surrounding background corresponding to the text content; then, based on the use of a color analysis strategy, the background color information and the text color information are fused and analyzed to obtain a corresponding color fusion analysis result; then, the text color information is optimized and adjusted according to the color fusion analysis result to obtain an optimized target text color information. The subsequent use of the optimized and adjusted text color to reprint text can effectively ensure that the text is clear and the layout is neat, and ultimately generate a high-quality poster.
[0080] In some optional implementations, performing fusion analysis on the background color information and the text color information based on a preset color analysis strategy to obtain a corresponding color fusion analysis result includes the following steps:
[0081] Get the preset space transformation strategy.
[0082] In this embodiment, the space conversion strategy includes converting the text color and background color from the RGB space to the HSV space, so that the brightness, saturation, and hue of the color can be better analyzed in the HSV space.
[0083] Based on the space conversion strategy, space conversion processing is performed on the background color information and the text color information respectively to obtain corresponding designated background color information and designated text color information.
[0084] In this embodiment, according to the policy content of the above-mentioned space conversion strategy, the above-mentioned background color information can be converted from the RGB space to the HSV space to obtain the corresponding specified background color information, and the above-mentioned text color information can be converted from the RGB space to the HSV space to obtain the corresponding specified background color information.
[0085] The color difference between the designated background color information and the designated text color information is calculated.
[0086] In this embodiment, the color difference between the text color information and the background color information may be calculated by using a general recognition algorithm, including brightness difference, saturation difference, and hue difference.
[0087] A color fusion analysis result between the background color information and the text color information is generated based on the color difference.
[0088] In this embodiment, the color difference can be compared with a preset threshold. If the color difference is greater than or equal to the preset threshold, the text color and the background color are judged to be too different, and a color fusion analysis result indicating that the text and background are not harmonious is generated. If the color difference is less than the preset threshold, the text color and the background color are judged to be less different, and a color fusion analysis result indicating that the text and background are relatively harmonious is generated.
[0089] The present application obtains a preset spatial conversion strategy; then based on the spatial conversion strategy, performs spatial conversion processing on the background color information and the text color information respectively to obtain the corresponding specified background color information and specified text color information; then calculates the color difference between the specified background color information and the specified text color information; and subsequently generates a color fusion analysis result between the background color information and the text color information based on the color difference. The present application obtains a preset spatial conversion strategy; then performs spatial conversion processing on the background color information and the text color information respectively to obtain the corresponding specified background color information and the specified text color information; then calculates the color difference between the specified background color information and the specified text color information; and then based on the color difference, it can realize intelligent and accurate generation of a color fusion analysis result between the background color information and the text color information, thereby ensuring the data accuracy of the obtained color fusion analysis result, and is conducive to the subsequent intelligent optimization and adjustment of the extracted text color information based on the color fusion analysis result.
[0090] In some optional implementations, step S207 includes the following steps:
[0091] The text layout data is fine-tuned based on the pure background image to obtain corresponding target text layout data.
[0092] In this embodiment, the text layout data, such as the text layout, font and font size, can be fine-tuned according to the characteristics of the above-mentioned pure background image to ensure that the text remains clear and beautiful on the new background, thereby obtaining the corresponding target text layout data.
[0093] A first character corresponding to the target character typeset data is obtained.
[0094] In this embodiment, the first text refers to text whose content is adjusted accordingly by using the target text typesetting data.
[0095] The target text color information is applied to the first text to obtain a corresponding second text.
[0096] In this embodiment, the optimized and adjusted target text color information may be applied to the first text that needs to be reprinted, thereby obtaining the corresponding second text.
[0097] According to the target text layout data, the second text is added one by one to the pure background image to obtain a corresponding target image.
[0098] In this embodiment, the second characters are added one by one to the pure background image according to the typesetting requirements corresponding to the set target character typesetting data on the pure background image, thereby obtaining the corresponding target image.
[0099] Perform a quality test on the target image to obtain a corresponding quality test result.
[0100] In this embodiment, the generated target image can be subjected to quality inspection, including text clarity, layout neatness, color fusion effect, etc., to obtain a corresponding quality inspection result, wherein the quality inspection result includes qualified or unqualified.
[0101] If the quality inspection result is qualified, the target image is used as the target poster.
[0102] In this embodiment, if the generated quality inspection result is qualified, the qualified target image is used as the final target poster, and the target poster is saved as a high-quality image file, thereby completing the poster generation process.
[0103] The present application obtains the corresponding target text layout data by fine-tuning the text typesetting data based on the pure background image; and obtains the first text corresponding to the target text typesetting data; then applies the target text color information to the first text to obtain the corresponding second text; then adds the second text one by one to the pure background image according to the target text typesetting data to obtain the corresponding target image; subsequently performs a quality inspection on the target image to obtain the corresponding quality inspection result; if the quality inspection result is qualified, the target image is used as the target poster. The present application obtains the target text layout data by fine-tuning the text typesetting data based on the pure background image, then obtains the first text corresponding to the target text typesetting data, and applies the target text color information to the first text to obtain the second text, then adds the second text one by one to the pure background image according to the target text typesetting data to obtain the target image, and uses the target image as the target poster when the target image passes the quality inspection. The present application uses the optimized and adjusted text color to complete the generation of the target poster, which can make the generated target poster more accurate and controllable in terms of text, and better integrate the text and background, thereby improving the generation effect of the target poster.
[0104] In some optional implementations of this embodiment, step S201 includes the following steps:
[0105] Acquire text layout data corresponding to a preset poster theme; wherein the text layout data includes text content and text parameters.
[0106] In this embodiment, the above-mentioned poster theme and the corresponding text layout data can be set according to actual business needs. The text layout data includes text content and text parameters. The text parameters include at least the set font, font size, and color. Specifically, the setting of the poster theme includes: Theme setting: clarifying that the core theme of the poster is "New Product Launch Conference", and determining the key information that needs to be displayed around this theme. Text content planning: design an attractive title, such as "[Product Name] Shocking Debut", and a subtitle that can highlight the significance of the product, such as "Opening a New Era of Technology". You can also add some auxiliary text, such as the date, time, location and other information of the press conference.
[0107] The settings of text typesetting data include: Font selection: According to the style and theme of the poster, select fonts with a sense of technology and modernity. For example, for a technology product launch conference, you can choose some sans-serif fonts with simple lines and unique shapes. Font size setting: The title text needs to be highlighted, so the font size should be larger so that it can be clearly seen from a distance. The font size of the subtitle and auxiliary text is relatively small, but it must be ensured that it can be easily read at a normal viewing distance. Color matching: The color can be set at will in the initial stage, but the color contrast and visual effect must be considered. For example, you can choose bright text colors, such as white, yellow, etc., and match them with a black background to enhance the readability of the text.
[0108] This application can be applied to poster generation services in the financial, insurance, and digital healthcare sectors. For example, in the financial and insurance sector, a poster theme might be set up with the core theme of "Wealth Guardian New Product Launch," showcasing newly launched financial and insurance products. The text content planning includes: Title: "[XX Wealth Treasure] Shocking Debut." Subtitle: "Opening a New Chapter in Wealth Security." Supporting text: "Press Conference Date: XX / XX / 20XX; Time: XX:XX-XX:XX; Location: XX Hall, XX Hotel." The text layout data settings include: Font selection: Choose Fangzheng Lanting Black Simplified. This sans-serif font has clean, flowing lines and a modern, technological feel, in line with the professional and robust image of the financial and insurance sector. Font size settings include: Title: Set to 80pt to ensure legibility even from a distance. Subtitle: Set to 40pt to ensure easy readability at a normal viewing distance. Supporting text: Set to 20pt to facilitate information retrieval. Color combination: Choose white for text and dark blue for background. The dark blue gives a professional and reliable feeling, and the white text on the dark blue background has high contrast and is highly readable.
[0109] In the digital healthcare sector, the poster theme could be "Smart Health Guardian New Product Launch," highlighting newly launched digital healthcare products or services. The text content planning includes: Title: "[XX Health Manager] Makes a Stunning Debut." Subtitle: "Leading a New Trend in Digital Healthcare." Supporting text: "Press Conference Date: XX / XX / 20XX; Time: XX:XX-XX:XX; Location: XX Exhibition Hall, XX Science and Technology Museum." The text layout settings include: Font selection: Source Han Sans, a free sans-serif font with a clean, modern look that reflects the technological and innovative spirit of digital healthcare. Font size settings include: Title: 72pt to ensure good visibility from a distance. Subtitle: 36pt to meet normal viewing requirements. Supporting text: 18pt to facilitate viewing. Color combination: Choose yellow for text and dark gray for background. Yellow is a bright color that stands out against a dark gray background, attracting the audience’s attention. At the same time, the dark gray background creates a professional and calm feeling, which is consistent with the characteristics of the digital medical field.
[0110] Invoke the preset first image editing tool.
[0111] In this embodiment, the first image editing tool may be a commonly used image editing tool, such as the Pillow tool.
[0112] Get a pre-created black background image.
[0113] In this embodiment, the black background picture can be obtained by using the first image editing tool to create a picture with a black background.
[0114] Based on the text parameters, the first image editing tool is used to insert the text content into the black background image to obtain the corresponding text layout image.
[0115] In this embodiment, the text contents can be added one by one to the black background image using the first image editing tool described above according to the text parameters (such as the set font, size, and color) contained in the pre-designed text layout data, thereby constructing a corresponding text layout image. Furthermore, the position, spacing, and alignment of the text can be further adjusted to ensure a neat and aesthetically pleasing text layout.
[0116] The present application obtains text layout data corresponding to a preset poster theme; wherein the text layout data includes text content and text parameters; then calls a preset first image editing tool; then obtains a pre-created black background image; and subsequently, based on the text parameters, uses the first image editing tool to insert the text content into the black background image to obtain the corresponding text layout image. The present application obtains text layout data corresponding to a preset poster theme, and obtains a pre-created black background image, and then, based on the text parameters in the text layout data, uses the first image editing tool to insert the text content in the text layout data into the black background image, thereby automatically and intelligently constructing the required text layout image, effectively improving the construction efficiency and construction intelligence of the text layout image.
[0117] In some optional implementations of this embodiment, step S202 includes the following steps:
[0118] Invoke the preset second image editing tool.
[0119] In this embodiment, the first image editing tool may be a commonly used image editing tool, such as a Pillow tool.
[0120] Get the preset target filter.
[0121] In this embodiment, the target filter may specifically be the FIND_EDGES filter in the ImageFilter module.
[0122] Based on the second image editing tool, the target filter is applied to the text layout picture to detect a specified image containing edge information in the text layout picture.
[0123] In this embodiment, by using the above-mentioned second image editing tool, the selected target filter is applied to the above-mentioned text layout image. The target filter detects the edge information in the text layout image, highlights the outline of the text, and thus extracts the specified image containing the edge information.
[0124] The designated image is used as the edge image.
[0125] In this embodiment, the extracted edge image may be saved as a new file for subsequent use.
[0126] The present application obtains a preset second image editing tool; then obtains a preset target filter; then, based on the second image editing tool, applies the target filter to the text layout picture to detect a specified image containing edge information in the text layout picture; and subsequently uses the specified image as the edge image. The present application obtains a preset target filter; then, based on the use of the second image editing tool, applies the target filter to the text layout picture to detect a specified image containing edge information in the text layout picture, and then uses the specified image as the required edge image, thereby efficiently and accurately completing the edge extraction processing of the text layout picture and ensuring the image accuracy of the obtained edge image.
[0127] In some optional implementations, the user information obtained is obtained with the user's consent and complies with relevant laws and policies.
[0128] In addition, any software tools or components not provided by our company that appear in the embodiments of this application are merely examples and do not represent actual use.
[0129] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0130] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target poster, the above-mentioned target poster can also be stored in a node of a blockchain.
[0131] The blockchain referred to in this application refers to a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (to prevent counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.
[0132] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0133] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0134] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0135] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0136] Further references Figure 3 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a poster generation device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0137] like Figure 3 As shown, the poster generation device 300 of this embodiment includes: an acquisition module 301, a first extraction module 302, a processing module 303, a deletion module 304, a second extraction module 305, an optimization module 306 and a generation module 307. Among them:
[0138] The acquisition module 301 is used to acquire a text layout image corresponding to the preset text layout data;
[0139] A first extraction module 302 is configured to extract edges from the text layout image to obtain a corresponding edge image;
[0140] The processing module 303 is used to obtain preset background prompt words, and process the edge image and the background prompt words based on the text graph model to generate a corresponding initial generated image;
[0141] A deletion module 304 is configured to delete text content from the initially generated image to obtain a corresponding pure background image;
[0142] A second extraction module 305 is configured to extract text color information from the initially generated image based on a preset color extraction algorithm;
[0143] An optimization module 306 is configured to optimize the text color information to obtain corresponding target text color information;
[0144] The generating module 307 is configured to perform corresponding text printing processing on the pure background image based on the text typesetting data and using the target text color information to obtain a corresponding target poster.
[0145] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0146] In some optional implementations of this embodiment, the deletion module 304 includes:
[0147] The first calling submodule is used to call the preset deep learning model;
[0148] A first detection submodule is configured to perform text region detection on the initially generated image based on the deep learning model to obtain a corresponding text region detection result;
[0149] A generating submodule, configured to generate a mask of a corresponding text area based on the text area detection result;
[0150] The second calling submodule is used to call a preset image restoration algorithm;
[0151] a restoration submodule, configured to guide the image restoration algorithm to restore the text region based on the mask to obtain a corresponding restored image;
[0152] The first determining submodule is configured to use the repaired image as the pure background image.
[0153] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0154] In some optional implementations of this embodiment, the optimization module 306 includes:
[0155] A first acquisition submodule is used to obtain background color information of the surrounding background corresponding to the text content;
[0156] An analysis submodule, configured to perform a fusion analysis on the background color information and the text color information based on a preset color analysis strategy to obtain a corresponding color fusion analysis result;
[0157] An optimization submodule, configured to optimize and adjust the text color information according to the color fusion analysis result to obtain adjusted text color information;
[0158] The second determining submodule is configured to use the adjusted text color information as the target text color information.
[0159] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0160] In some optional implementations of this embodiment, the analysis submodule includes:
[0161] An acquisition unit, used to acquire a preset space conversion strategy;
[0162] a conversion unit, configured to perform space conversion processing on the background color information and the text color information respectively based on the space conversion strategy to obtain corresponding designated background color information and designated text color information;
[0163] a calculation unit, configured to calculate a color difference between the specified background color information and the specified text color information;
[0164] A generating unit is configured to generate a color fusion analysis result between the background color information and the text color information based on the color difference.
[0165] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0166] In some optional implementations of this embodiment, the generating module 307 includes:
[0167] A fine-tuning submodule, configured to fine-tune the text layout data based on the pure background image to obtain corresponding target text layout data;
[0168] A second acquisition submodule is used to acquire a first character corresponding to the target character typeset data;
[0169] an application submodule, configured to apply the target text color information to the first text to obtain a corresponding second text;
[0170] An adding submodule, configured to add the second characters one by one to the pure background image according to the target character typeset data, to obtain a corresponding target image;
[0171] A second detection submodule is used to perform quality detection on the target image and obtain a corresponding quality detection result;
[0172] The third determining submodule is configured to use the target image as the target poster if the quality detection result is qualified.
[0173] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0174] In some optional implementations of this embodiment, the acquisition module 301 includes:
[0175] The third acquisition submodule is used to acquire text layout data corresponding to a preset poster theme; wherein the text layout data includes text content and text parameters;
[0176] A third calling submodule is used to call a preset first image editing tool;
[0177] The fourth acquisition submodule is used to obtain a pre-created black background image;
[0178] The inserting submodule is used to insert the text content into the black background image based on the text parameters using the first image editing tool to obtain the corresponding text layout image.
[0179] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0180] In some optional implementations of this embodiment, the first extraction module 302 includes:
[0181] A fourth calling submodule, configured to call a preset second image editing tool;
[0182] The fifth acquisition submodule is used to obtain a preset target filter;
[0183] an application submodule, configured to apply the target filter to the text layout picture based on the second image editing tool, so as to detect a designated image containing edge information in the text layout picture;
[0184] The fourth determining submodule is configured to use the designated image as the edge image.
[0185] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the poster generation method in the aforementioned embodiment, and are not described in detail here.
[0186] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0187] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 having components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0188] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.
[0189] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the poster generation method. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0190] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions or process data stored in the memory 41, such as computer-readable instructions for executing the poster generation method.
[0191] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0192] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0193] In an embodiment of the present application, a text layout picture corresponding to preset text layout data is obtained, and edge processing is performed on the text layout picture to obtain an edge image, and then a preset background prompt word is obtained, and the edge image and the background prompt word are processed based on the use of the text graph model to generate an initial generated image, and then the text content of the initial generated image is deleted to obtain a pure background picture, and then the text color information is extracted from the initial generated image based on the use of the color extraction algorithm, and the text color information is optimized to obtain the target text color information, and finally, based on the text layout data, the target text color information is used to perform corresponding text printing processing on the pure background picture to obtain the corresponding target poster. Through the above-mentioned poster generation process, the present application can achieve more accurate acquisition of pure background pictures, and extract and optimize text color information, so that the generated target poster with text is more accurate and controllable in terms of text, and the fusion effect of text and background is better, which effectively improves the accuracy and intelligence of the generated target poster.
[0194] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the poster generation method as described above.
[0195] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0196] In an embodiment of the present application, a text layout picture corresponding to preset text layout data is obtained, and edge processing is performed on the text layout picture to obtain an edge image, and then a preset background prompt word is obtained, and the edge image and the background prompt word are processed based on the use of the text graph model to generate an initial generated image, and then the text content of the initial generated image is deleted to obtain a pure background picture, and then the text color information is extracted from the initial generated image based on the use of the color extraction algorithm, and the text color information is optimized to obtain the target text color information, and finally, based on the text layout data, the target text color information is used to perform corresponding text printing processing on the pure background picture to obtain the corresponding target poster. Through the above-mentioned poster generation process, the present application can achieve more accurate acquisition of pure background pictures, and extract and optimize text color information, so that the generated target poster with text is more accurate and controllable in terms of text, and the fusion effect of text and background is better, which effectively improves the accuracy and intelligence of the generated target poster.
[0197] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0198] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.
Claims
1. A poster generation method, characterized in that: The steps include: Obtaining a text layout image corresponding to the preset text layout data; Performing edge extraction processing on the text layout image to obtain a corresponding edge image; Obtaining preset background prompt words, and processing the edge image and the background prompt words based on a text-based graph model to generate a corresponding initial generated image; Deleting text content from the initially generated image to obtain a corresponding pure background image; extracting text color information from the initially generated image based on a preset color extraction algorithm; Optimizing the text color information to obtain corresponding target text color information; Based on the text typesetting data, the target text color information is used to perform corresponding text printing processing on the pure background image to obtain a corresponding target poster.
2. The poster generation method according to claim 1, characterized in that: The step of deleting text content from the initially generated image to obtain a corresponding pure background image specifically includes: Call the preset deep learning model; Performing text region detection on the initial generated image based on the deep learning model to obtain a corresponding text region detection result; Generating a mask of the corresponding text area based on the text area detection result; Call the preset image restoration algorithm; guiding the image restoration algorithm to repair the text area based on the mask to obtain a corresponding restored image; The repaired image is used as the pure background image.
3. The poster generation method according to claim 1, characterized in that: The step of optimizing the text color information to obtain corresponding target text color information specifically includes: Obtain background color information of the surrounding background corresponding to the text content; Performing a fusion analysis on the background color information and the text color information based on a preset color analysis strategy to obtain a corresponding color fusion analysis result; Optimizing and adjusting the text color information according to the color fusion analysis result to obtain adjusted text color information; The adjusted text color information is used as the target text color information.
4. The poster generation method according to claim 3, characterized in that: The step of performing fusion analysis on the background color information and the text color information based on a preset color analysis strategy to obtain a corresponding color fusion analysis result specifically includes: Get the preset space conversion strategy; Based on the space conversion strategy, space conversion processing is performed on the background color information and the text color information respectively to obtain corresponding designated background color information and designated text color information; Calculating the color difference between the specified background color information and the specified text color information; A color fusion analysis result between the background color information and the text color information is generated based on the color difference.
5. The poster generation method according to claim 1, characterized in that: The step of performing corresponding text printing processing on the pure background image using the target text color information based on the text typesetting data to obtain the corresponding target poster specifically includes: Fine-tuning the text layout data based on the pure background image to obtain corresponding target text layout data; Acquire a first character corresponding to the target character typeset data; Applying the target text color information to the first text to obtain a corresponding second text; According to the target text layout data, the second characters are added one by one to the pure background image to obtain a corresponding target image; Performing quality inspection on the target image to obtain a corresponding quality inspection result; If the quality inspection result is qualified, the target image is used as the target poster.
6. The poster generation method according to claim 1, characterized in that: The step of obtaining a text layout image corresponding to the preset text layout data specifically includes: Acquire text layout data corresponding to a preset poster theme; wherein the text layout data includes text content and text parameters; Calling the preset first image editing tool; Get a pre-created black background image; Based on the text parameters, the first image editing tool is used to insert the text content into the black background image to obtain the corresponding text layout image.
7. The poster generation method according to claim 1, characterized in that: The step of performing edge extraction processing on the text layout image to obtain a corresponding edge image specifically includes: Call the preset second image editing tool; Get the preset target filter; Applying the target filter to the text layout image based on the second image editing tool to detect a designated image containing edge information in the text layout image; The designated image is used as the edge image.
8. A poster generating device, characterized in that: include: An acquisition module, used to acquire a text layout image corresponding to preset text layout data; A first extraction module is used to extract edges from the text layout image to obtain a corresponding edge image; a processing module, configured to obtain a preset background prompt word, and process the edge image and the background prompt word based on a text-based graph model to generate a corresponding initial generated image; A deletion module, configured to delete text content from the initially generated image to obtain a corresponding pure background image; A second extraction module, configured to extract text color information from the initially generated image based on a preset color extraction algorithm; An optimization module, configured to optimize the text color information to obtain corresponding target text color information; A generation module is used to perform corresponding text printing processing on the pure background image based on the text typesetting data using the target text color information to obtain a corresponding target poster.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the poster generation method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the poster generation method according to any one of claims 1 to 7.