Image processing template processing method and device, equipment, storage medium and product
By automatically obtaining and filling the images and text in the image processing template, the problems of low efficiency and human resources generation in the prior art are solved, and efficient automatic generation of image processing templates is realized.
Patent Information
- Application Number
- CN202311121247.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
AI Technical Summary
The existing image processing template generation methods are inefficient and consume human resources.
Automatically fill the image processing template by obtaining the image and text to be filled, and determining the display parameters based on the preset layout style and fill area.
The automatic generation of image processing templates is realized, which improves the generation efficiency and reduces the consumption of human resources.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to an image processing template processing method, apparatus, device, storage medium, and product. Background Technology
[0002] Image processing is a form of visual communication and is widely used in marketing, advertising, and other scenarios, such as poster design. To enable rapid poster generation, some internet platforms provide users with image processing templates. Users can generate posters by replacing images and text within these templates.
[0003] In related technologies, image processing templates are generally designed and generated by designers based on experience and actual needs. However, the generation efficiency of image processing templates is often low and consumes a lot of human resources. Summary of the Invention
[0004] This disclosure provides an image processing template generation method, apparatus, device, storage medium, and product to solve the technical problems of low efficiency and high manpower consumption in existing image processing template generation methods.
[0005] In a first aspect, embodiments of this disclosure provide an image processing template generation method, including:
[0006] Obtain the image to be filled and determine the first filling area of the image to be filled in the preset canvas;
[0007] The image to be filled is filled into the preset canvas based on the first filling area to obtain the filled canvas;
[0008] Obtain the text to be filled, and determine the display parameters of the text to be filled according to the preset layout style, the first filling area and the text level information corresponding to the text to be filled, wherein the display parameters include the second filling area parameters and the font display parameters;
[0009] The text to be filled is filled into the filled canvas according to the display parameters corresponding to the text to be filled, thereby obtaining an image processing template.
[0010] Secondly, embodiments of this disclosure provide an image processing template generation apparatus, comprising:
[0011] The acquisition module is used to acquire the image to be filled and determine the first filling area of the image to be filled in the preset canvas;
[0012] A fill module is used to fill the image to be filled into the preset canvas based on the first fill area to obtain a filled canvas;
[0013] The determination module is used to obtain the text to be filled and determine the display parameters of the text to be filled according to the preset layout style, the first filling area and the text level information corresponding to the text to be filled, wherein the display parameters include the second filling area parameters and the font display parameters;
[0014] The processing module is used to fill the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, and obtain an image processing template.
[0015] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0016] The memory stores computer-executed instructions;
[0017] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the image processing template generation method as described in the first aspect and various possible designs of the first aspect.
[0018] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image processing template generation method described in the first aspect and various possible designs of the first aspect.
[0019] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the image processing template generation method as described in the first aspect and various possible designs of the first aspect.
[0020] The image processing template generation method, apparatus, device, storage medium, and product provided in this embodiment acquire an image to be filled and determine a first filling area of the image to be filled in a preset canvas. This allows for accurate filling of the image based on this first filling area. Furthermore, it allows for accurate determination of the display parameters corresponding to the text to be filled based on the first filling area, a preset layout style, and the text hierarchy information corresponding to the text to be filled. Consequently, it enables accurate and automatic filling of the text based on these display parameters. This achieves automatic generation of image processing templates, eliminating the need for manual generation by the user and improving the efficiency of image processing template generation. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the system architecture on which the embodiments of this disclosure are based;
[0023] Figure 2 A schematic flowchart illustrating the image processing template generation method provided in this embodiment of the disclosure;
[0024] Figure 3 This is a schematic diagram of an image processing template provided in an embodiment of the present disclosure;
[0025] Figure 4 This is a flowchart illustrating an image processing template generation method according to another embodiment of the present disclosure;
[0026] Figure 5 This is a flowchart illustrating an image processing template generation method according to another embodiment of the present disclosure;
[0027] Figure 6 This is a schematic diagram of the structure of the image processing template generation apparatus provided in the embodiments of this disclosure;
[0028] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0030] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0031] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0032] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0033] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0034] To address the technical problems of low efficiency and high manpower consumption in existing image processing template generation methods, this disclosure provides an image processing template generation method, apparatus, device, storage medium, and product.
[0035] It should be noted that the image processing template generation method, apparatus, device, storage medium and product provided in this disclosure can be applied to any template generation scenario.
[0036] In related technologies, image processing templates are typically generated by designers based on their aesthetic experience, taking into account factors such as the arrangement of images and text. However, generating image processing templates using this method is often time-consuming and requires a high level of expertise from the designer, resulting in low efficiency.
[0037] In the process of solving the above-mentioned technical problems, the inventors discovered through research that in order to achieve automatic generation of image processing templates, image and text processing conditions can be preset. When the image and text to be filled by the user meet the processing conditions, the image and text to be filled can be automatically adjusted and the adjusted image and text to be filled into the preset canvas to obtain the image processing template.
[0038] Figure 1 This is a schematic diagram of the system architecture on which the embodiments of this disclosure are based, such as... Figure 1As shown, the system architecture upon which this disclosure is based includes at least server 11 and server 12. Server 11 is equipped with an image processing template generation device, which can be written in languages such as C / C++, Java, Shell, or Python. Server 12 can be a data server, which can be a cloud server or a server cluster, storing a large amount of data. Alternatively, server 12 may be equipped with an artificial intelligence content generation device, which can intelligently generate images and / or text to be filled according to actual needs.
[0039] Figure 2 This is a flowchart illustrating the image processing template generation method provided in this embodiment of the disclosure, as shown below. Figure 2 As shown, the method includes:
[0040] Step 201: Obtain the image to be filled and determine the first filling area of the image to be filled in the preset canvas.
[0041] The execution entity in this embodiment is an image processing template generation device, which can be coupled to a server capable of communicating with a server providing data. This data server can be a data server storing a large number of images and text to be filled. Alternatively, the data server can also include a pre-defined artificial intelligence content generation device. Thus, based on data acquisition requests sent by the server, images and text to be filled can be generated using a novel content production method (AI-Generated Content, or AIGC).
[0042] In this embodiment, in order to generate an image processing template, an image to be filled can be obtained. This image to be filled can be an image portion of the image processing template. The image to be filled can be uploaded or collected by the user who created the image processing template according to actual needs, or it can be obtained from a preset data server, or it can be generated via AIGC. This disclosure does not impose any limitations on these methods.
[0043] Optionally, different images to be filled can be obtained for different types of image processing templates. For example, if a person image processing template needs to be generated, an image to be filled that includes the person can be obtained. If an item poster needs to be generated, an image to be filled that includes the item can be obtained.
[0044] Furthermore, to determine the fill position of the image to be filled, a first fill area of the image to be filled in a preset canvas can also be determined. This first fill area can be determined by the user according to actual needs. Alternatively, when generating an image processing template, the user can select a layout style for the image processing template, which can be a top-bottom layout, a left-right layout, or a grid layout. The first fill area can be determined based on the layout style, and this disclosure does not impose any limitations on this.
[0045] The first filled area can be a part of the preset canvas or the entire preset canvas.
[0046] For example, in practical applications, this image processing template can be a poster template. After generating the poster template, users can generate a poster by replacing the image and text to be filled in the template.
[0047] Step 202: Fill the image to be filled into the preset canvas based on the first filling area to obtain the filled canvas.
[0048] In this embodiment, after determining the first fill area, the image to be filled can be filled into the first fill area of the preset canvas to obtain the filled canvas. The user can determine the preset canvas according to actual needs, and different canvases can correspond to different display sizes.
[0049] Optionally, the complete image to be filled can be scaled up and then filled into the first filling area. Alternatively, the image to be filled can be cropped, and the cropped target area can be filled into the first filling area. This disclosure does not limit this.
[0050] Step 203: Obtain the text to be filled, and determine the display parameters of the text to be filled according to the preset layout style, the first filling area and the text level information corresponding to the text to be filled, wherein the display parameters include the second filling area parameters and the font display parameters.
[0051] In this embodiment, after completing the filling operation on the image to be filled, the text to be filled can also be obtained. The text to be filled can be uploaded or collected by the user according to actual needs, or it can be obtained from a preset data server, or it can be generated by AIGC. This disclosure does not impose any restrictions on this.
[0052] Furthermore, to automatically fill the text to be filled, the display parameters corresponding to the text can be determined. This text can include multiple sub-texts, such as main title text, subtitle text, guide text, and body text. Different sub-texts correspond to different text hierarchy information. To highlight the differences between the various sub-texts, different display parameters can be set for different text hierarchy information.
[0053] Optionally, when generating an image processing template, the user can also specify a layout style, which can be a top-bottom layout, a left-right layout, or a grid layout. Different layout styles will result in different display parameters for the image and text to be filled. Therefore, to accurately determine the display parameters of the text to be filled, the display parameters can be determined based on factors such as the preset layout style, the first filling area, and the text hierarchy information corresponding to the text to be filled. These display parameters include the second filling area parameters and the font display parameters.
[0054] Step 204: Fill the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, and obtain the image processing template.
[0055] In this embodiment, after determining the display parameters of the text to be filled based on factors such as a preset layout style, a first filling area, and the text hierarchy information corresponding to the text to be filled, the text to be filled can be filled into the filled canvas based on these display parameters to obtain an image processing template. This enables the automatic generation of image processing templates without requiring manual adjustments by the user.
[0056] Figure 3 This is a schematic diagram of an image processing template provided in an embodiment of this disclosure, such as... Figure 3 As shown, the layout style of the image processing template 31 is a left-right layout, with the left side displaying the text 32 to be filled and the right side displaying the image 33 to be filled.
[0057] During the generation of image processing template 31, the user can specify a first fill region 34 of the image 33 to be filled in a preset canvas. This allows salient areas of the image 33 to be filled into the first fill region 34. A second fill region 35 is then determined based on the first fill region 34 and the preset canvas, allowing the text 32 to be filled to be performed within the second fill region 35. The line spacing and font size of sub-texts at different text levels within the text 32 to be filled may differ.
[0058] Optionally, based on any of the above embodiments, step 201 includes:
[0059] Obtain the location parameter information input by the user, and determine the first filling area of the image to be filled in the preset canvas based on the location parameter information.
[0060] or,
[0061] In response to a user's selection operation in the preset canvas, the range selected by the user is determined as the first fill area.
[0062] In this embodiment, the first filling area can be determined by the user according to actual needs.
[0063] Optionally, the user can input positional parameters according to actual needs, whereby the positional parameters may include multiple coordinate information. This allows for the determination of a display area matching the positional parameters, which is then designated as the first fill area for the image to be filled within a preset canvas.
[0064] Alternatively, users can also determine the first fill area through human-computer interaction. Users can make selections on a preset canvas through human-computer interaction, and the selected area is determined as the first fill area in response to the user's selection on the preset canvas.
[0065] The image processing template generation method provided in this embodiment acquires the image to be filled and determines the first filling area of the image in a preset canvas. This allows for accurate filling of the image based on this first filling area. Furthermore, it accurately determines the display parameters of the text to be filled based on the first filling area, a preset layout style, and the text hierarchy information corresponding to the text to be filled. Consequently, it enables accurate and automatic filling of the text based on these display parameters. This achieves automatic generation of image processing templates, eliminating the need for manual generation by the user and improving the efficiency of image processing template generation.
[0066] Furthermore, based on any of the above embodiments, step 202 includes:
[0067] A preset salient region recognition algorithm is used to identify the salient regions in the image to be filled.
[0068] The salient region is filled into the first filled region to obtain the filled canvas.
[0069] In this embodiment, the image to be filled often includes salient regions. For example, the salient region in an image to be filled that includes a human figure can be the human figure region, and the salient region in an image to be filled that includes an object can be the object region.
[0070] To enrich the display content in the image processing template and enable it to more prominently display salient regions, a preset salient region recognition algorithm can be used to identify salient regions in the image to be filled. These salient regions are then filled into the first filling area to obtain the filled canvas.
[0071] Optionally, the image to be filled can be cropped based on the salient region to obtain an image that includes only the salient region. The image that includes only the salient region can then be filled into the first filling area to obtain the filled canvas.
[0072] The image processing template generation method provided in this embodiment determines the salient regions in the image to be filled and fills the salient regions into the first filling region. This enables the automatic filling operation of the image to be filled and ensures that the generated image processing template includes the salient regions in the image to be filled, thereby improving the quality of the image processing template.
[0073] Figure 4 This is a flowchart illustrating an image processing template generation method according to another embodiment of the present disclosure. Based on any of the above embodiments, the text to be filled includes at least one sub-text, and each sub-text corresponds to preset text hierarchy information. For example... Figure 4 As shown, step 203 includes:
[0074] Step 401: Determine the second filling area parameters corresponding to the text to be filled based on the preset layout style and the first filling area.
[0075] Step 402: For each sub-text, determine the font display parameters corresponding to the text level information based on the text level information corresponding to the sub-text.
[0076] Step 403: Determine the font display parameters corresponding to each sub-text as the font display parameters corresponding to the text to be filled.
[0077] In this embodiment, the display parameters specifically include second fill area parameters and font display parameters. To determine the fill position corresponding to the text to be filled, the second fill area parameters corresponding to the text to be filled can first be determined based on the preset layout style and the first fill area.
[0078] Furthermore, the text to be filled can include multiple sub-texts, such as main title text, subtitle text, introductory text, and body text. Different sub-texts correspond to different text hierarchy information. To highlight the differences between different sub-texts, different font display parameters can be set for different text hierarchy information.
[0079] Optionally, font display parameters corresponding to different text level information can be preset. Therefore, for each sub-text, the font display parameters corresponding to the text level information can be determined based on the sub-text's text level information. The font display parameters corresponding to each sub-text are then used as the font display parameters for the text to be filled.
[0080] The image processing template generation method provided in this embodiment can accurately realize the filling operation of the text to be filled by determining the second filling area parameter corresponding to the text to be filled and the font display parameter corresponding to each sub-text, and can ensure the template quality of the image processing template filled based on the display parameters.
[0081] Furthermore, based on any of the above embodiments, step 401 includes:
[0082] Calculate the difference information between the preset canvas and the first filled area.
[0083] The display relationship between the text to be filled and the image to be filled is determined based on the difference information.
[0084] The second filling area parameters corresponding to the text to be filled are determined based on the display relationship and the layout style.
[0085] In this embodiment, the area of the preset canvas can be defined as 1, the first filling area as A, and the second filling area information as B. Therefore, the difference between the preset canvas and the first filling area can be calculated using the formula B = 1 - A.
[0086] Based on this difference information, the display relationship between the text to be filled and the image to be filled can be accurately determined. If B > 0, it indicates that the text to be filled and the image to be filled are mutually exclusive. If B < 0, it indicates that the text to be filled and the image to be filled are overlapping.
[0087] After determining the display relationship between the text to be filled and the image to be filled, the parameters of the second filling area corresponding to the text to be filled can be determined based on the display relationship and the preset layout style.
[0088] For example, in a practical application, the text to be filled and the image to be filled are mutually exclusive, and the preset layout style is a top-bottom layout. The first filling area is the upper area of the preset canvas. Therefore, based on this mutual exclusion relationship and the layout style, the second filling area can be determined to be the lower area of the preset canvas.
[0089] The image processing template generation method provided in this embodiment can accurately determine the display relationship between the text to be filled and the image to be filled by calculating the difference information between the preset canvas and the first filling area. Furthermore, based on this display relationship and the preset layout style, it can accurately determine the parameters of the second filling area corresponding to the text to be filled, so as to avoid mutual occlusion between the image to be filled and the text to be filled.
[0090] Furthermore, based on any of the above embodiments, the font display parameters include hierarchical order display parameters, line spacing display parameters, and font size display parameters. Step 402 includes:
[0091] Determine the number of text levels corresponding to the text to be filled.
[0092] The display parameters for the hierarchical order of each sub-text are determined based on the number of text levels, the text level information corresponding to each sub-text, and the preset hierarchical order style information. The hierarchical order style information includes the display order of different text levels under different numbers of text levels.
[0093] The line spacing display parameters for each sub-text are determined based on the text level information corresponding to each sub-text and the preset line spacing correspondence. The line spacing correspondence includes the correspondence between different text level information and line spacing display parameters.
[0094] The font size display parameters for each sub-text are determined based on the text level information corresponding to each sub-text and the preset font size correspondence. The font size display parameters include the correspondence between different text level information and font size display parameters.
[0095] In this embodiment, the font display parameters include hierarchical order display parameters, line spacing display parameters, and font size display parameters.
[0096] To determine the display parameters of the hierarchical order, hierarchical order style information can be preset. This hierarchical order style information includes the display order of different text levels with varying numbers of levels. Therefore, the number of text levels corresponding to the text to be filled can be determined. Based on the number of text levels, the text level information corresponding to each sub-text, and the preset hierarchical order style information, the display parameters of the hierarchical order for each sub-text are determined.
[0097] For example, in a practical application, when there are three text levels (P0, P1, P2), the display order of the corresponding text levels can include six possible sequences: P0, P1, P2; P0, P2, P1; P1, P2, P0; P1, P0, P2; P2, P0, P1; or P2, P1, P0. Users can choose any display order as the display parameter for the corresponding level of each sub-text according to their actual needs.
[0098] Furthermore, to determine the line spacing display parameters, text hierarchy information and preset line spacing correspondences can be pre-set. Thus, for each sub-text, the corresponding line spacing display parameters can be determined based on the text hierarchy information and the preset line spacing correspondences, where the line spacing correspondences include the correspondence between different text hierarchy information and line spacing display parameters.
[0099] Furthermore, to determine the font size display parameters, text hierarchy information and preset font size correspondences can be pre-set. Thus, for each sub-text, the font size display parameters corresponding to that sub-text can be determined based on the text hierarchy information and the preset font size correspondences.
[0100] For example, in practical applications, the font size for the main title subtext can be the maximum font size, while the font size for the content subtext can be the minimum font size. For the text hierarchy between the main title subtext and the content subtext, the font size can be between the maximum and minimum font sizes.
[0101] The image processing template generation method provided in this embodiment improves the quality of the image processing template by determining the hierarchical order display parameters, line spacing display parameters, and font size display parameters corresponding to each sub-text. This allows for accurate filling operations on each sub-text based on these parameters, thereby improving the overall quality of the image processing template.
[0102] Figure 5 This is a flowchart illustrating an image processing template generation method according to another embodiment of the present disclosure. Based on any of the above embodiments, such as... Figure 5 As shown, step 204 includes:
[0103] Step 501: Fill the entire text to be filled into the filled canvas according to the display parameters.
[0104] Step 502: For each sub-text after filling, determine whether the content in the sub-text exceeds the filled canvas.
[0105] Step 503: If yes, then perform a line break operation on the subtext.
[0106] Step 504: Determine whether the subtext exceeds the filled canvas after the line break operation.
[0107] Step 505: If yes, adjust the font size display parameters corresponding to the sub-text until the sub-text does not exceed the filled canvas, and obtain the image processing template.
[0108] In this embodiment, after determining the display parameters corresponding to the text to be filled, the entire text can be filled into the filled canvas based on these display parameters. However, when filling the entire text into the filled canvas, for longer sub-texts, the corresponding display content may exceed the filled canvas, resulting in incomplete content.
[0109] Therefore, to ensure the integrity of the image processing template, for each filled sub-text, it is determined whether the content of the sub-text exceeds the filled canvas. If so, a line break is performed on the sub-text. It is then determined whether the sub-text exceeds the filled canvas after the line break. If so, the font size display parameters of the corresponding sub-text are adjusted until the sub-text does not exceed the filled canvas, thus obtaining the image processing template.
[0110] For example, if any sub-text is detected to exceed the filled canvas, a line break can be performed on that sub-text. If, after the line break, it still exceeds the filled canvas, the font size of that sub-text can be reduced. This process continues until the sub-text no longer exceeds the filled canvas, at which point the image processing template is obtained.
[0111] Furthermore, based on any of the above embodiments, after step 505, the method further includes:
[0112] Based on the font size display parameters corresponding to the adjusted subtext and the text hierarchy information of the subtext, the font size display parameters of other subtexts in the text to be filled are adjusted.
[0113] In this embodiment, adjusting the font size display parameters of any sub-text within the text to be filled may result in an inconsistent overall display effect. Therefore, based on the adjusted font size display parameters of the sub-text and its text hierarchy information, the font size display parameters of other sub-texts within the text to be filled can be adjusted.
[0114] For example, if the font size display parameter of any sub-text is reduced by one level, the font size display parameter of other sub-texts can be reduced by one level accordingly, so as to ensure the visual coordination of the image processing template while maintaining the integrity of the text to be filled.
[0115] The image processing template generation method provided in this embodiment automatically fills the text to be filled into the filled canvas according to the display parameters. When it is detected that the text to be filled exceeds the filled canvas, operations such as line wrapping and / or switching font size display parameters are performed on the text to be filled. In addition, it can ensure that the text to be filled is completely displayed in the filled canvas, thus ensuring the integrity of the text to be filled and improving the quality of the generated image processing template.
[0116] Furthermore, based on any of the above embodiments, after step 204, the method further includes:
[0117] Determine the current alignment and margin information of the image to be filled and the text to be filled.
[0118] Determine whether the current alignment and margin information of the image to be filled and the text to be filled match the preset layout.
[0119] If not, then adjust the alignment and margin information of the image to be filled and the text to be filled according to the layout method.
[0120] In this embodiment, to improve the quality of the image processing template, the current alignment and margin information of the image to be filled and the text to be filled can be determined. It is determined whether the current alignment and margin information of the image to be filled and the text to be filled match a preset layout. This preset layout may include fixed margin values and alignment methods between the image to be filled and the text to be filled, such as center line alignment or image edge alignment.
[0121] If it is determined that the current alignment and margin information of the image to be filled and the text to be filled do not match the preset layout, in order to ensure the aesthetics of the image processing template, the current alignment and margin information of the image to be filled and the text to be filled can be adjusted according to the layout.
[0122] The image processing template generation method provided in this embodiment can automatically generate image processing templates and improve the quality of image processing templates by adjusting the current alignment and margin information of the image to be filled and the text to be filled according to a preset layout.
[0123] Furthermore, based on any of the above embodiments, after step 204, the method further includes:
[0124] Detect whether the image to be filled and / or the text to be filled meets the preset saliency visual conditions.
[0125] If the conditions are not met, then background content matching the color information is filled in a preset area around the image and / or text to be filled, based on the color information of the image and / or text to be filled.
[0126] In this embodiment, poster design is a form of visual communication, attracting attention and providing an immediate stimulus through its layout. Therefore, to ensure the image processing template highlights key information in the image and / or text to be filled, it can detect whether the image and / or text meet preset salience visual conditions. If not, to make the image and / or text more eye-catching, background content matching the color information can be filled in a preset area around the image and / or text.
[0127] For example, in a practical application, the image to be filled may include a red object. To make the red object more eye-catching, a white background can be added behind the red object so that the user can view the red object more intuitively.
[0128] The image processing template generation method provided in this embodiment fills the background content around the image to be filled and / or the text to be filled with preset salient visual conditions, thereby enriching the display content in the image processing template and improving the quality of the image processing template based on the automatic generation of the image processing template.
[0129] Furthermore, based on any of the above embodiments, after step 204, the method further includes:
[0130] Detect whether the image processing template meets the preset visual balance conditions.
[0131] If the conditions are not met, the image processing template is decorated with preset decoration content to obtain the processed target image processing template.
[0132] In this embodiment, visual balance refers to a balance of visual strength with the visual center as the fulcrum. Uniformity, symmetry, and proportional harmony are typically key terms for achieving visual balance. Therefore, to further improve the quality of the image processing template, decorative elements can be added to the template to achieve visual balance.
[0133] Optionally, it can be detected whether the image processing template meets preset visual balance conditions. This detection can be performed using a preset visual balance algorithm. If the conditions are not met, preset decorative content is used to decorate the image processing template, resulting in a processed target image processing template. This decorative content can be pre-stored in a data server, or it can be generated via AIGC; this disclosure does not impose any limitations on this.
[0134] It should be noted that the shape, color, and display position of the decorative content can be determined using a preset visual balance algorithm, or it can be specified by the user according to actual needs. This disclosure does not impose any restrictions on this.
[0135] The image processing template generation method provided in this embodiment decorates the image processing template with preset decorative content based on preset visual balance conditions, thereby making the generated target image processing template visually balanced and improving the quality of the image processing template, so that users can generate higher quality posters based on the image processing template.
[0136] Furthermore, based on any of the above embodiments, after step 204, the method further includes:
[0137] The image processing template is subjected to color coordination processing using a preset color coordination algorithm to obtain the processed target image processing template.
[0138] In this embodiment, in order to further improve the quality of the image processing template, the image processing template can also be color coordinated by a preset color coordination algorithm to obtain the processed target image processing template, so that the colors of the target image processing template are more coordinated.
[0139] The image processing template generation method provided in this embodiment performs color coordination processing on the image processing template through a preset color coordination algorithm to obtain the processed target image processing template. This enables the generated target image processing template to have harmonious colors, improves the quality of the image processing template, and allows users to generate higher-quality posters based on the image processing template.
[0140] Figure 6 This is a schematic diagram of the structure of the image processing template generation apparatus provided in the embodiments of this disclosure, such as... Figure 6As shown, the device includes: an acquisition module 61, a filling module 62, a determination module 63, and a processing module 64. The acquisition module 61 acquires an image to be filled and determines a first filling area of the image in a preset canvas. The filling module 62 fills the image to be filled into the preset canvas based on the first filling area, obtaining a filled canvas. The determination module 63 acquires text to be filled and determines display parameters of the text to be filled based on a preset layout style, the first filling area, and text hierarchy information corresponding to the text to be filled. The display parameters include second filling area parameters and font display parameters. The processing module 64 fills the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, obtaining an image processing template.
[0141] Furthermore, based on any of the above embodiments, the acquisition module is configured to: acquire position parameter information input by the user, and determine a first filling area of the image to be filled in a preset canvas based on the position parameter information. Alternatively, in response to a user's selection operation in the preset canvas, determine the range selected by the user as the first filling area.
[0142] Furthermore, based on any of the above embodiments, the filling module is configured to: identify salient regions in the image to be filled using a preset salient region recognition algorithm; fill the salient regions into the first filling area to obtain a filled canvas.
[0143] Furthermore, based on any of the above embodiments, the text to be filled includes at least one sub-text, and each sub-text corresponds to preset text hierarchy information. The determining module is configured to: determine a second filling region parameter corresponding to the text to be filled based on the preset layout style and the first filling region; for each sub-text, determine font display parameters corresponding to the text hierarchy information based on the text hierarchy information corresponding to the sub-text; and determine the font display parameters corresponding to each sub-text as the font display parameters corresponding to the text to be filled.
[0144] Further, based on any of the above embodiments, the determining module is configured to: calculate the difference information between the preset canvas and the first filling area; determine the display relationship between the text to be filled and the image to be filled based on the difference information; and determine the second filling area parameters corresponding to the text to be filled based on the display relationship and the layout style.
[0145] Further, based on any of the above embodiments, the font display parameters include hierarchy order display parameters, line spacing display parameters, and font size display parameters. The determining module is configured to: determine the number of text levels corresponding to the text to be filled; determine the hierarchy order display parameters corresponding to each sub-text based on the number of text levels, the text level information corresponding to each sub-text, and preset hierarchy order style information; wherein the hierarchy order style information includes the display order of different text levels under different numbers of text levels; determine the line spacing display parameters corresponding to each sub-text based on the text level information corresponding to each sub-text and a preset line spacing correspondence, wherein the line spacing correspondence includes the correspondence between different text level information and line spacing display parameters; and determine the font size display parameters corresponding to each sub-text based on the text level information corresponding to each sub-text and a preset font size correspondence, wherein the font size display parameters include the correspondence between different text level information and font size display parameters.
[0146] Further, based on any of the above embodiments, the processing module is configured to: fill the text to be filled into the filled canvas according to the display parameters; for each filled sub-text, determine whether the content of the sub-text exceeds the filled canvas; if so, perform a line break operation on the sub-text; determine whether the sub-text exceeds the filled canvas after the line break operation; if so, adjust the font size display parameters corresponding to the sub-text until the sub-text does not exceed the filled canvas, thereby obtaining the image processing template.
[0147] Furthermore, based on any of the above embodiments, the processing module is configured to: adjust the font size display parameters of other subtexts in the text to be filled according to the font size display parameters corresponding to the adjusted subtext and the text hierarchy information of the subtext.
[0148] Furthermore, based on any of the above embodiments, the device further includes: a determining module, further configured to determine the current alignment and margin information of the image to be filled and the text to be filled; a detecting module, configured to determine whether the current alignment and margin information of the image to be filled and the text to be filled match a preset layout; and an adjusting module, configured to, if not, adjust the current alignment and margin information of the image to be filled and the text to be filled according to the layout.
[0149] Furthermore, based on any of the above embodiments, the device further includes: a detection module, configured to detect whether the image to be filled and / or the text to be filled meets a preset saliency visual condition; and an adjustment module, configured to, if not, fill a preset area around the image to be filled and / or the text to be filled with background content matching the color information, based on the color information of the image to be filled and / or the text to be filled.
[0150] Furthermore, based on any of the above embodiments, the device further includes: a detection module, used to detect whether the image processing template meets preset visual balance conditions; and an adjustment module, used to, if not, perform a decoration operation on the image processing template using preset decorative content to obtain a processed target image processing template.
[0151] Furthermore, based on any of the above embodiments, the device further includes: an adjustment module, used to perform color coordination processing on the image processing template using a preset color coordination algorithm to obtain the processed target image processing template.
[0152] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0153] To implement the above embodiments, this disclosure also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image processing template generation method as described in any of the above embodiments.
[0154] To implement the above embodiments, this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the image processing template generation method as described in any of the above embodiments.
[0155] To implement the above embodiments, this disclosure also provides an electronic device, including a processor and a memory.
[0156] The memory stores computer-executed instructions.
[0157] The processor executes computer execution instructions stored in the memory, causing the processor to perform the image processing template generation method as described in any of the above embodiments.
[0158] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this disclosure, such as... Figure 7As shown, the electronic device 700 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0159] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0160] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0161] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0162] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0163] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0164] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0165] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0167] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0168] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0169] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0170] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0171] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0172] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating an image processing template, characterized in that: include: Acquire an image to be filled, and determine a first filling area of the image to be filled in a preset canvas; Filling the image to be filled into the preset canvas based on the first filling area to obtain a filled canvas; Acquire the text to be filled, and determine the display parameters of the text to be filled according to the preset layout style, the first filling area and the text level information corresponding to the text to be filled, wherein the display parameters include the second filling area parameters and the font display parameters; The text to be filled is filled into the filled canvas according to the display parameters corresponding to the text to be filled, so as to obtain an image processing template.
2. The method according to claim 1, characterized in that The determining a first filling area of the image to be filled in a preset canvas includes: Acquire position parameter information input by a user, and determine a first filling area of the image to be filled in a preset canvas based on the position parameter information; or, In response to a selection operation of a user in the preset canvas, a range selected by the user is determined as the first filling area.
3. The method according to claim 1, characterized in that The step of filling the image to be filled into the preset canvas based on the first filling area to obtain the filled canvas includes: Using a preset salient region recognition algorithm to identify the salient region in the image to be filled; The salient area is filled into the first filling area to obtain a filled canvas.
4. The method according to claim 1, characterized in that: The text to be filled includes at least one sub-text, and each sub-text corresponds to preset text level information; The determining the display parameters of the text to be filled according to the preset layout style, the first filling area and the text level information corresponding to the text to be filled includes: Determining a second filling area parameter corresponding to the text to be filled according to the preset layout style and the first filling area; For each subtext, determining a font display parameter corresponding to the text level information according to the text level information corresponding to the subtext; The font display parameters corresponding to each sub-text are determined as the font display parameters corresponding to the text to be filled.
5. The method according to claim 4, characterized in that The determining, according to the preset layout style and the first filling area, a second filling area parameter corresponding to the text to be filled includes: Calculating difference information between the preset canvas and the first filling area; Determine a display relationship between the text to be filled and the image to be filled according to the difference information; The second filling area parameter corresponding to the text to be filled is determined according to the display relationship and the layout style.
6. The method according to claim 4, characterized in that The font display parameters include a level order display parameter, a line spacing display parameter, and a font size display parameter; The step of determining the font display parameter corresponding to the text level information according to the text level information corresponding to the subtext includes: Determine the number of text levels corresponding to the text to be filled; Determine the hierarchical order display parameters corresponding to each subtext according to the number of text hierarchies, the text hierarchical information corresponding to each subtext, and the preset hierarchical order style information; wherein the hierarchical order style information includes the display order of different text hierarchies under different numbers of text hierarchies; Determining the line spacing display parameters corresponding to each subtext according to the text level information corresponding to each subtext and a preset line spacing correspondence relationship, wherein the line spacing correspondence relationship includes a correspondence relationship between different text level information and line spacing display parameters; The font size display parameters corresponding to each subtext are determined according to the text level information corresponding to each subtext and a preset font size correspondence relationship, wherein the font size display parameters include the correspondence relationship between different text level information and the font size display parameters.
7. The method according to claim 1, characterized in that The step of filling the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled includes: Filling the to-be-filled text into the filled canvas as a whole according to the display parameters; For each filled subtext, determining whether the content in the subtext exceeds the filled canvas; If yes, then perform a line break operation on the sub-text; Determine whether the subtext exceeds the filled canvas after the line break operation; If so, the font size display parameter corresponding to the sub-text is adjusted until the sub-text does not exceed the filled canvas, thereby obtaining the image processing template.
8. The method according to claim 7, characterized in that After the font size display parameter corresponding to the sub-text is adjusted until the sub-text does not exceed the filled canvas, the method further includes: According to the font size display parameters corresponding to the adjusted sub-text and the text level information of the sub-text, the font size display parameters of other sub-texts in the text to be filled are adjusted.
9. The method according to any one of claims 1 to 8, characterized in that: After filling the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, the method further includes: Determine the current alignment and margin information of the image to be filled and the text to be filled; Determine whether the current alignment and margin information of the image to be filled and the text to be filled match the preset typesetting mode; If not, the current alignment and margin information of the image to be filled and the text to be filled are adjusted according to the typesetting method.
10. The method according to any one of claims 1 to 8, characterized in that: After filling the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, the method further includes: Detecting whether the image to be filled and / or the text to be filled meets a preset visual saliency condition; If not, then based on the color information of the image to be filled and / or the text to be filled, a preset area around the image to be filled and / or the text to be filled is filled with background content matching the color information.
11. The method according to any one of claims 1 to 8, characterized in that: After filling the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, the method further includes: Detecting whether the image processing template meets a preset visual balance condition; If not, a preset decoration content is used to perform a decoration operation on the image processing template to obtain a processed target image processing template.
12. The method according to any one of claims 1 to 8, characterized in that: After filling the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, the method further includes: The image processing template is subjected to color coordination processing by a preset color coordination algorithm to obtain a processed target image processing template.
13. An image processing template generating device, characterized in that: include: An acquisition module, used for acquiring an image to be filled and determining a first filling area of the image to be filled in a preset canvas; A filling module, used for filling the image to be filled into the preset canvas based on the first filling area to obtain a filled canvas; A determination module, used for acquiring the text to be filled, and determining the display parameters of the text to be filled according to a preset layout style, the first filling area and the text level information corresponding to the text to be filled, wherein the display parameters include the second filling area parameters and the font display parameters; The processing module is used to fill the text to be filled into the filled canvas according to the display parameters corresponding to the text to be filled, so as to obtain an image processing template.
14. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the image processing template generation method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the image processing template generation method according to any one of claims 1 to 12 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for displaying information according to any one of claims 1 to 12 is implemented.