Color matching method, device, electronic device and storage medium for theme template
By obtaining the main color and coordinated color of the target image, the UI template is replaced with color matching, which solves the problem of inconsistency in the color of the UI template in the live broadcast scene, and realizes the template design that is coordinated with the overall color of the target image.
Patent Information
- Application Number
- CN202110546232.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-05-19
AI Technical Summary
Existing UI templates can easily lead to the same appearance in live broadcast scenes, and the style or color matching of the template is inconsistent with other elements in the picture, resulting in disharmonious overall color matching.
By obtaining the main color of the target image and using the trained color matching model to determine multiple coordination colors corresponding to the main color, the theme template is replaced by color matching, and a new color matching theme template is generated to coordinate with the overall color matching of the target image.
The coordinated color selection and color change operation of the theme template is achieved based on the color of the theme elements in the target image, and the overall color coordination template design is achieved, avoiding the limitations of artificially making theme templates.
Smart Images

Figure CN113298921B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a color matching method, device, electronic device and storage medium for a theme template. Background Art
[0002] Currently, UI templates used in games or live broadcasting scenarios are mainly designed by artists in advance and imported into the game or live broadcasting screen for display. The style, style or color of the materials cannot be changed online. Applying them in live broadcasting scenarios can easily cause a large number of anchors to use the same UI template, resulting in a situation where everyone looks the same. Moreover, the style or color of the template is completely independent of other elements in the screen (such as comic characters), and the overall color matching may be inconsistent.
[0003] Traditionally, UI controls are designed by artists and imported into program packages in the form of resources, which are then rendered on screen by the client. Currently, there are two mainstream solutions: one is that artists design UI controls with different colors offline and use them as resource packages for clients to call. The advantage is that the client is simple to implement, just calling different resource packages, but the disadvantage is that the color cannot be changed dynamically online; the other is that the client renders UI controls in real time through shaders (line drawing (shadow) programs), so that the color of the controls can be adjusted dynamically online, but the disadvantage is that the UI controls need to be redesigned according to the template, and the client rendering process becomes complicated. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a color matching method, device, electronic device and storage medium for a theme template, which can coordinate the overall color matching of the target image and the theme template.
[0005] In order to solve the above problems, the first aspect of the present application provides a color matching method for a theme template, and the color matching method for the theme template includes: obtaining the main color of the target image; determining multiple coordinated colors corresponding to the main color of the target image; and using the multiple coordinated colors to replace the color of the theme template to obtain a theme template with a new color matching.
[0006] Wherein, the obtaining of the main color of the target image comprises: extracting all image colors of the target image; and selecting at least one image color from all image colors of the target image as the main color of the target image.
[0007] Among them, the selecting at least one image color from all the image colors of the target image as the main color of the target image includes: sorting all the image colors of the target image according to their proportions in the target image, and selecting at least one image color of the target image with the highest proportion in the target image as the main color of the target image; or, selecting the image color corresponding to the set position of the target image as the main color of the target image.
[0008] Wherein, determining the multiple coordinated colors corresponding to the main color of the target image includes: analyzing the main color of the target image using a trained first color matching model to obtain the multiple coordinated colors corresponding to the main color of the target image.
[0009] Among them, using the multiple coordinated colors to replace the color of the theme template to obtain a theme template with a new color, includes: using a trained second color model to replace the color of the theme template, replacing the color of the theme template with the multiple coordinated colors, and obtaining the theme template with the new color.
[0010] Among them, using the trained second color matching model to replace the color of the theme template, replacing the color of the theme template with the multiple coordinated colors, and obtaining the theme template with the new color matching, includes: using the trained second color matching model to split the theme template into multiple layers; replacing the color of each layer according to the multiple coordinated colors to obtain the layer after the color matching is replaced; and combining all the layers after the color matching is replaced to generate the theme template with the new color matching.
[0011] Among them, using the trained second color matching model to split the theme template into multiple layers includes: using the trained second color matching model to split the theme template into layers through an image soft segmentation algorithm to obtain layers corresponding to each image color of the theme template.
[0012] In order to solve the above problems, the second aspect of the present application provides a color matching device for a theme template, including: a main color acquisition module, which is used to acquire the main color of a target image; a coordination color determination module, which is used to determine multiple coordination colors corresponding to the main color of the target image; and a color replacement module, which is used to use the multiple coordination colors to replace the color of the theme template to obtain a new color matching theme template.
[0013] In order to solve the above problem, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the color matching method of the theme template of the first aspect above.
[0014] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored, and when the program instructions are executed by a processor, the color matching method of the theme template of the above-mentioned first aspect is implemented.
[0015] The beneficial effect of the present invention is as follows: different from the prior art, the color matching method of the theme template of the present application obtains the main color of the target image, and then can determine multiple coordinated colors corresponding to the main color of the target image, so that the theme template can be replaced with multiple coordinated colors to obtain a theme template with a new color matching, so that the overall color matching of the target image and the theme template is coordinated, and the theme template is selected and changed according to the color of the theme elements in the target image, so as to achieve a template design with overall color coordination. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of an embodiment of a color matching method of a theme template of the present application;
[0017] Figure 2 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S11;
[0018] Figure 3a to Figure 3c It is a display diagram of the color matching method of the theme template of this application and an application scenario;
[0019] Figure 4 It is a schematic diagram showing an application scenario of a color palette sample used in the present application for training a first color matching model;
[0020] Figure 5 It is a display schematic diagram of an application scenario in which the present application obtains multiple coordinated colors corresponding to the main color of a target image through a first color matching model;
[0021] Figure 6 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S13;
[0022] Figure 7 It is a display schematic diagram of an application scenario in which the present application obtains a new color matching theme template through a second color matching model;
[0023] Figure 8 It is a schematic diagram of the framework of an embodiment of a color matching device of the subject template of the present application;
[0024] Fig. 9 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0025] Fig.10 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0026] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0027] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0028] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0029] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a color matching method for a theme template of the present application. Specifically, the color matching method for a theme template in this embodiment may include the following steps:
[0030] Step S11: Obtain the main color of the target image.
[0031] In the present application, the target image is generally an image of a target object displayed in a game or live broadcast scene, or the main picture displayed by the web page content when browsing the web, or the main picture displayed by a software application such as a mobile phone application interface. The target image includes multiple display units, and the display unit can be the smallest pixel unit displayed by the target image, the smallest array of the target image, or the display area of the target image divided according to application requirements. The main color of the target image is the tone of the entire image, which determines the theme of the target image, and the target image needs to be matched with the theme template of the display interface when displayed. Therefore, the main color of the target image and the color matching of the theme template of the display interface should be harmonious, so that the target image and the theme template are displayed with good visual effects, giving the user a harmonious and consistent feeling. Therefore, it is necessary to obtain the main color of the target image, for example, by scanning all pixel values of the target image, and using clustering or differential methods, the main color of the target image can be extracted, and then the color matching of the theme template is adjusted according to the main color of the target image, so that the overall color matching of the target image and the theme template is coordinated.
[0032] Step S12: Determine a plurality of coordinated colors corresponding to the main color of the target image.
[0033] It is understandable that colors can be divided into two major color systems: warm colors dominated by red and yellow and cool colors dominated by blue and purple. The color matching between each color system can be called the color design of coordinated colors. Since coordinated colors have the continuity of color perception, they often give people a pleasing, harmonious and soft feeling. Therefore, it is necessary to determine multiple coordinated colors corresponding to the main color of the target image, so as to adjust the color matching of the theme template to the coordinated color corresponding to the main color of the target image. Specifically, the method for determining the multiple coordinated colors corresponding to the main color of the target image can be determined according to the color matching preferred by humans; for example, the multiple coordinated colors corresponding to the main color of the target image can be determined according to the principle of similar color matching. The principle of similar color matching refers to the matching of two colors of the same type with different shades and brightness, such as: blue with sky blue, dark green with light green, coffee with beige, dark red with light red, etc. The matching of similar colors can appear soft and elegant; for another example, the multiple coordinated colors corresponding to the main color of the target image can be determined according to the principle of similar color matching. The principle of similar color matching refers to the matching of two relatively close colors, such as: red with orange-red or purple-red, yellow with grass green or orange-yellow, etc.
[0034] Step S13: using the plurality of coordinated colors to replace the color of the theme template to obtain a theme template with a new color.
[0035] After determining the multiple coordinated colors corresponding to the main color of the target image, the color matching of the theme template can be adjusted to the coordinated colors corresponding to the main color of the target image, so that the overall color matching of the target image and the theme template can be coordinated.
[0036] The above scheme obtains the main color of the target image and then determines multiple coordinated colors corresponding to the main color of the target image. Then, the multiple coordinated colors can be used to replace the color of the theme template to obtain a theme template with a new color, so that the overall color matching of the target image and the theme template is coordinated. The coordinated color selection and color change operation of the theme template is realized according to the color of the theme elements in the target image, so as to achieve a template design with overall color coordination, which can adapt to target images of various color styles and can be realized automatically, avoiding the limitations of manually making theme templates.
[0037] Please combine Figure 2 , Figure 2 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S11 in FIG. 1. In one embodiment, the above step S11 may specifically include:
[0038] Step S111: extracting all image colors of the target image.
[0039] Step S112: selecting at least one image color from all image colors of the target image as the main color of the target image.
[0040] It is understandable that, in addition to the primary color, the target image also includes secondary colors and dotted colors. In the color matching, the primary color, secondary color and dotted color constitute all the colors of an image. In the present application, the primary color, secondary color and dotted color are all the image colors of the target image. Therefore, in order to determine the primary color of the target image, it is necessary to first extract all the image colors of the target image, and then select the image color from all the image colors of the target image as the primary color of the target image. It is understandable that the number of primary colors of the target image may be one or more, so the number of primary colors can be determined according to the actual content of the target image.
[0041] In one embodiment, the step S112 may specifically include: sorting all the image colors of the target image according to their proportions in the target image, and selecting at least one image color of the target image with the highest proportion in the target image as the main color of the target image. In another embodiment, the step S112 may specifically include: selecting the image color corresponding to the set position of the target image as the main color of the target image.
[0042] It is understandable that with the primary color as the base, the secondary color and the decorative color make the whole picture beautiful, and the difference between these three lies in the different sizes of the areas they occupy on the picture or the different importance of their positions. For example, based on the size of the area occupied, the primary color is undoubtedly the most important color, that is, the one or several colors that occupy the largest area among the colors. Based on the importance of the position, for comic characters, the pupil color and / or hair color of the character has the greatest impact on vision and is the main color of the comic character.
[0043] Please combine Figure 3a to Figure 3c , Figure 3a to Figure 3c It is a display diagram of an application scenario of the color matching method of the theme template of this application, wherein: Figure 3a The left side shows a target image, which is a cartoon image. In the case of a fixed template, the color matching of the theme template and the target image in the picture may not be coordinated, such as Figure 3b As shown on the left, therefore, it is necessary to first obtain the image color of the target image, select the main color from the image color, and then determine the multiple coordinated colors corresponding to the main color of the target image, such as Figure 3a As shown on the right, you can use multiple coordinated colors to match the color of the theme template (such as Figure 3b As shown on the right, replace the color scheme to obtain a new color scheme theme template, such as Figure 3c As shown, the theme template of the new color scheme has a color scheme that is coordinated with the target image.
[0044] In one embodiment, the step S12 may specifically include: analyzing the main color of the target image using the trained first color matching model to obtain a plurality of coordinated colors corresponding to the main color of the target image.
[0045] By inputting the main color of the target image into the trained first color matching model, the trained first color matching model can then output multiple coordinated colors corresponding to the main color of the target image. Regarding the construction and training of the first color matching model, a corresponding AI model can be constructed based on existing rules that can reflect human color matching preferences, and then a large number of sample color palettes can be produced through art, such as Figure 4 As shown, the main color corresponding to the sample color palette and the coordinated color that conforms to the aesthetic rules are given as input data and input into the AI model for computational learning, thereby obtaining the first color matching model after training. The first color matching model is specifically a neural network model for extracting the color of the image and analyzing it to obtain the coordinated color corresponding to the main color of the image; in the first color matching model, the algorithm for extracting the color of the image can be a median segmentation algorithm, which maps all pixels of the target image to the RGB space, repeatedly divides the subspace in this three-dimensional RGB space, and then calculates the average of the pixels in the divided space as the color extraction result; it can also be a K-Means clustering method (K-means clustering method), which filters isolated colors (which appear too few times) and colors that are too bright or too dark, and then selects the K colors with the highest frequency of occurrence as initial values. The algorithm clusters new stable color centers to achieve color extraction of the image. After the color of the target image is extracted, the main color can be determined. In the first color matching model, the method for analyzing and obtaining the coordinated color corresponding to the main color of the image is as follows. Figure 5 As shown, Figure 5 This is a display schematic diagram of an application scenario in which the present application obtains multiple coordinated colors corresponding to the main color of a target image through a first color matching model. After the main color of the target image is input into the trained first color matching model, the trained first color matching model can output three coordinated colors that match the main colors based on two given main colors.
[0046] In one embodiment, the step S13 may specifically include: using the trained second color matching model to replace the color matching of the theme template, replacing the color matching of the theme template with the multiple coordinated colors, and obtaining the theme template with the new color matching.
[0047] By inputting multiple coordinated colors corresponding to the main colors of the theme template and the target image into the trained second color matching model, the trained second color matching model can then replace the color matching of the theme template with the multiple coordinated colors, thereby outputting a theme template with a new color matching.
[0048] Please combine Figure 6 , Figure 6 yes Figure 1FIG. 1 is a flow chart of an embodiment of step S13 in FIG. 1. In one embodiment, the above step S13 may specifically include:
[0049] Step S131: split the theme template into multiple layers using the trained second color matching model.
[0050] Step S132: replacing the color of each layer according to the multiple coordinated colors to obtain a layer after color replacement.
[0051] Step S133: combining all the layers after the color matching is replaced to generate the theme template of the new color matching.
[0052] Specifically, the trained second color matching model can be used to split the theme template into layers, and then each layer can be replaced according to the coordinated color given by the trained first color matching model. A single layer can randomly select a coordinated color for color matching replacement, and the layers after color matching replacement are combined into a theme template with a new color matching. The second color matching model is specifically a neural network model for replacing the color matching of the theme template with a coordinated color; in the second color matching model, for a theme template with multiple layers, the color features corresponding to the multiple layers are obtained, and the correlation degree parameters between the color features are determined. Through the color features, the characteristics of the colors in the layers are quantitatively reflected, and the layers of the theme template are determined. Then, for each layer, a coordinated color is randomly selected for color matching replacement to achieve the re-coloring of the theme template. Regarding the training of the second color matching model, the ABtext (AB test) method can be used to optimize the selection process of the coordinated color to be replaced by the layer, so that the theme template composed of the new color matching presents a color matching that conforms to human aesthetics.
[0053] Furthermore, the above step S131 may include: using the trained second color matching model, splitting the theme template into layers through an image soft segmentation algorithm to obtain layers corresponding to each image color of the theme template. Specifically, in image segmentation, the entire image is divided into two areas, foreground and background. A pixel either belongs to a certain foreground or a certain background. There is no situation where part of the pixel belongs to the foreground and part of the pixel belongs to the background. Therefore, segmentation is often referred to as "hard" segmentation. In image cutout, it is not only necessary to separate the foreground object from the background, but also necessary to restore the foreground mixing ratio of the mixed pixels between the foreground and the background, that is, the foreground opacity value. Therefore, there is also a term for soft segmentation for cutout. The image soft segmentation algorithm of the present application can be a segmentation algorithm based on fuzzy clustering, which uses the membership of sample points to each class to represent the classification result. The membership value is in the interval [0,1], where the sum of the membership of any sample point to all clusters is 1. Fuzzy clustering takes into account the mutual connection between sample points, so it can effectively classify sample points with cross-class information. It can also be an image segmentation algorithm based on fuzzy connectivity, which determines whether the point belongs to the background or the target by comparing the fuzzy connectivity of all pixel points in the image and the background and target of the image, thereby achieving reasonable segmentation of layers corresponding to different image colors. Figure 7 As shown, after the theme template (upper left) is input into the trained second color matching model, the trained second color matching model can segment the layers corresponding to the different image colors (lower left) in the theme template through the image soft segmentation algorithm, and then replace the color of each layer (middle) (upper right), and combine all the layers after color replacement, so as to output the theme template with the new color matching (lower right).
[0054] See also Figure 8 , Figure 8 The color matching device 80 of the theme template of the present application is a schematic diagram of a framework of an embodiment. The theme template color matching device 80 includes: a main color acquisition module 800, the main color acquisition module 800 is used to acquire the main color of the target image; a coordination color determination module 802, the coordination color determination module 802 is used to determine a plurality of coordination colors corresponding to the main color of the target image; a color replacement module 804, the color replacement module 804 is used to replace the color of the theme template with the plurality of coordination colors to obtain a theme template with a new color.
[0055] In some embodiments, the main color acquisition module 800 performs the step of acquiring the main color of the target image, including: extracting all image colors of the target image; and selecting at least one image color from all image colors of the target image as the main color of the target image.
[0056] In some embodiments, the primary color acquisition module 800 executes the selection of at least one image color from all image colors of the target image as the primary color of the target image, including: sorting all image colors of the target image according to their proportions in the target image, and selecting at least one image color of the target image with the highest proportion in the target image as the primary color of the target image; or, selecting the image color corresponding to a set position of the target image as the primary color of the target image.
[0057] In some embodiments, the coordination color determination module 802 performs the step of determining multiple coordination colors corresponding to the main color of the target image, including: using the trained first color matching model to analyze the main color of the target image to obtain multiple coordination colors corresponding to the main color of the target image.
[0058] In some embodiments, the color replacement module 804 performs a step of replacing the color of the theme template with the multiple coordinated colors to obtain a theme template with a new color, including: using a trained second color model to replace the color of the theme template, replacing the color of the theme template with the multiple coordinated colors, and obtaining the theme template with the new color.
[0059] In some embodiments, the color replacement module 804 performs color replacement on the theme template using the trained second color model, replacing the color of the theme template with the multiple coordinated colors to obtain the theme template with the new color, including: using the trained second color model to split the theme template into multiple layers; performing color replacement on each layer according to the multiple coordinated colors to obtain the layer after color replacement; and combining all the layers after color replacement to generate the theme template with the new color.
[0060] In some embodiments, the color replacement module 804 uses the trained second color model to split the theme template into multiple layers, including: using the trained second color model to split the theme template into layers through an image soft segmentation algorithm to obtain layers corresponding to each image color of the theme template.
[0061] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 90 includes a memory 91 and a processor 92 coupled to each other, and the processor 92 is used to execute program instructions stored in the memory 91 to implement the steps of any of the above-mentioned color matching method embodiments of the theme template. In a specific implementation scenario, the electronic device 90 may include but is not limited to: a microcomputer, a server.
[0062] Specifically, the processor 92 is used to control itself and the memory 91 to implement the steps of the color matching method embodiment of any of the above-mentioned theme templates. The processor 92 can also be called a CPU (Central Processing Unit). The processor 92 may be an integrated circuit chip with signal processing capabilities. The processor 92 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 92 can be implemented by an integrated circuit chip.
[0063] See also Fig.10 , Fig.10 The computer-readable storage medium 100 stores program instructions 1000 that can be executed by a processor, and the program instructions 1000 are used to implement the steps of any of the above-mentioned color matching method embodiments of the theme template.
[0064] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0065] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0066] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0067] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A color matching method for a theme template, characterized in that: The color matching method of the theme template includes: Get the main color of the target image; Determining a plurality of coordinated colors corresponding to the main color of the target image includes: analyzing the main color of the target image using a trained first color matching model to obtain a plurality of coordinated colors corresponding to the main color of the target image; the first color matching model is obtained by training a neural network model based on the main colors and coordinated colors corresponding to the sample color palette; Using the multiple coordinated colors to replace the color of the theme template to obtain a theme template with a new color, including: using a trained second color matching model to replace the color of the theme template, replacing the color of the theme template with the multiple coordinated colors to obtain the theme template with the new color; the second color matching model is a neural network model; in the second color matching model, for a theme template with multiple layers, color features corresponding to the multiple layers are obtained, and correlation degree parameters between the color features are determined, and the characteristics of the colors in the layers are quantified by the color features, and each layer of the theme template is determined. For each layer, a coordinated color is randomly selected for color replacement to achieve re-color matching of the theme template.
2. The color matching method of the theme template according to claim 1, characterized in that: The obtaining of the main color of the target image comprises: Extracting all image colors of the target image; At least one image color is selected from all image colors of the target image as the main color of the target image.
3. The color matching method of the theme template according to claim 2, characterized in that: The step of selecting at least one image color from all image colors of the target image as the main color of the target image comprises: Sorting all the image colors of the target image according to their proportions in the target image, and selecting at least one image color of the target image with the highest proportion in the target image as the main color of the target image; Alternatively, the image color corresponding to the set position of the target image is selected as the main color of the target image.
4. The color matching method of the theme template according to claim 1, characterized in that: The step of replacing the color of the theme template by using the trained second color matching model, replacing the color of the theme template with the multiple coordinated colors, and obtaining the theme template with the new color matching includes: Splitting the theme template into multiple layers using the trained second color matching model; Performing color replacement on each layer according to the multiple coordinated colors to obtain a layer after color replacement; All the layers after color replacement are combined to generate a theme template of the new color.
5. The color matching method of the theme template according to claim 4, characterized in that: The method of using the trained second color matching model to split the theme template into multiple layers includes: The trained second color matching model is used to split the theme template into layers through an image soft segmentation algorithm to obtain a layer corresponding to each image color of the theme template.
6. A color matching device for a theme template, characterized in that: include: A main color acquisition module, the main color acquisition module is used to acquire the main color of the target image; A coordination color determination module, the coordination color determination module is used to determine a plurality of coordination colors corresponding to the main color of the target image, including: using a trained first color matching model to analyze the main color of the target image to obtain a plurality of coordination colors corresponding to the main color of the target image; the first color matching model is obtained by training a neural network model based on the main colors and coordination colors corresponding to the sample color palette; A color replacement module, the color replacement module is used to use the multiple coordinated colors to replace the color of the theme template to obtain a theme template with a new color, including: using the trained second color matching model to replace the color of the theme template, replacing the color of the theme template with the multiple coordinated colors to obtain the theme template with the new color; the second color matching model is a neural network model; in the second color matching model, for a theme template with multiple layers, color features corresponding to the multiple layers are obtained, and correlation degree parameters between color features are determined, and the characteristics of the colors in the layers are quantified by color features, and each layer of the theme template is determined. For each layer, a coordinated color is randomly selected for color replacement to achieve re-color matching of the theme template.
7. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the color matching method of the theme template described in any one of claims 1 to 5.
8. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the color matching method of the theme template described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Picture coloring method and device and computer terminal
CN108320312A
Image processing method and device
CN112700513A