An image color matching method, system, image generation method and system
By obtaining image color system information, and using preset algorithms to determine the background layer and foreground layer colors of the intelligent drawing tool, the problem of single image and inefficiency caused by existing tools relying on templates is solved, and efficient and successful image generation is achieved.
Patent Information
- Application Number
- CN202210146397.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-02-17
AI Technical Summary
The existing intelligent drawing tools rely on design templates and lack the ability to draw with natural colors as the base, resulting in a single image generated, low mapping efficiency, and improper color matching of templates and content information, resulting in a large number of unapplicable "waste pictures".
By obtaining the color system information of the image, the background layer color and foreground layer color of the target image are determined based on the preset algorithm, and the hue value, saturation value and brightness value are used to generate the target image, including monochrome and gradient color processing.
It improves the success rate and efficiency of image generation, saves template production costs, ensures that the content information such as text, illustrations and other content in the image are significantly contrasted with the background layer color, and reduces user screening time and operation costs.
Smart Images

Figure CN114529624B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of image technology, and particularly to an image color matching method and system. Background Art
[0002] With the development of technology, intelligent mapping tools are widely used in the mapping field due to their convenient and fast mapping advantages. For example, intelligent mapping tools can combine pictures and texts based on pre-stored design templates to generate promotional posters. However, the method of mapping based on templates not only lacks the ability to map with natural colors as the basis, but also depends on design templates, requiring a high picture generation ability for intelligent mapping tools, resulting in single generated images and low mapping efficiency.
[0003] Therefore, it is desirable to provide an image color matching and generation method to improve mapping efficiency and success rate. Summary of the Invention
[0004] One embodiment of this specification provides an image color matching method. The method includes: obtaining first image information, where the first image information includes color system information and content information; determining the background layer color of the target image based on the color system information, where the background layer color includes a single color or a gradient color; determining the foreground layer color of the target image based on the background layer color, where the foreground layer includes the content information.
[0005] In some embodiments, determining the background layer color of the target image based on the color system information includes: determining the hue value, saturation value, and brightness value using a preset algorithm based on the color system information; determining the background layer color of the target image based on the hue value, saturation value, and brightness value.
[0006] In some embodiments, when the background layer color is the single color, the saturation value S and brightness value B of the background layer color satisfy: B - 100 ≥ 20 2 / (S - 100).
[0007] In some embodiments, the gradient color includes a single-color gradient color and a cross-color gradient color; when the background layer color is the single-color gradient color, the hue value of the background layer color is fixed, and the saturation value S1 and brightness value B1 of the gradient color satisfy the following conditions: if S0 + X > 100, then the saturation value S1 of the gradient color = 100, and the brightness value B1 = B0 + S0 - 100; if B0 + X > 100, then the brightness value B1 of the gradient color = 100, and the saturation value S1 = B0 + S0 - 100; where S0 and B0 respectively represent the saturation value and brightness value corresponding to the base color of the background layer color, and X is any integer within the interval [20, 40].
[0008] In some embodiments, when the background layer color is the cross-color gradient color, the saturation value and the brightness value of the background layer color are both fixed, and the hue value H1 of the gradient color satisfies the following conditions: If H0 + Y > 360, then the hue value H1 of the gradient color = H0 + Y - 360; If H0 - Y < 0, then the hue value H1 of the gradient color = 360 - (Y - H0); where H0 represents the hue value corresponding to the base color of the background layer color, and Y is any integer within the range of [30, 60].
[0009] In some embodiments, determining the foreground layer color of the target image based on the background layer color includes: When the background layer color and the foreground layer color belong to the same type of hue, the background layer color and the foreground layer color are respectively located in the first preset area and the second preset area of the same type of hue; When the background layer color and the foreground layer color belong to different hues, the hue of the foreground layer color is within the preset color gamut of the hue of the background layer color.
[0010] In some embodiments, when the first preset area is smaller than the second preset area, the second preset area satisfies: S ≥ B ≥ 20 2 / (S - 100) + 100, (100 / 8 ≤ S ≤ 100); where S represents the saturation value and B represents the brightness value.
[0011] In some embodiments, when the first preset area is larger than the second preset area, the second preset area satisfies: (0 ≤ S ≤ 100 / 8).
[0012] In some embodiments, the preset color gamut is the 60-degree adjacent hue of the hue of the background layer color.
[0013] In some embodiments, when the background layer color and the foreground layer color belong to different hues, the foreground layer color is determined based on the following formula: B2 - 100 ≥ 20 2 / (S2 - 100), (0 < S2 ≤ 100, 0 < B2 ≤ 100); and, H - 60 ≤ H2 ≤ H + 60, (0 ≤ H ≤ 360); where B2, S2, and H2 respectively represent the brightness value, saturation value, and hue value corresponding to the foreground layer color, and H represents the hue value corresponding to the background layer color.
[0014] In some embodiments, the content information includes at least one of text, illustrations, buttons, and labels.
[0015] One embodiment of this specification provides an image generation method. The method includes: determining the foreground layer color and background layer color of the target image by using the image color method as described above; obtaining second image information, where the second image information includes at least one of an image theme, size, and style; and generating the target image based on the second image information, the foreground layer color, and the background layer color of the image.
[0016] One embodiment of this specification provides an image color matching system. The system includes: a first acquisition module for acquiring first image information, where the first image information includes color system information and content information; a color determination module for determining the background layer color of the target image based on the color system information, where the background layer color includes a single color or a gradient color; and a color matching module for determining the foreground layer color of the target image based on the background layer color, where the foreground layer includes the content information.
[0017] One embodiment of this specification provides an image generation system. The system includes: an image color matching module for determining the foreground layer color and background layer color of the target image; a second acquisition module for acquiring second image information, where the second image information includes at least one of an image theme, size, and style; and an image generation module for generating the target image based on the second image information, the foreground layer color, and the background layer color.
[0018] One embodiment of this specification provides an image color matching device. The device includes: at least one storage medium storing computer instructions; and at least one processor for executing the computer instructions to implement the image color matching method as described above.
[0019] One embodiment of this specification provides an image generation device. The device includes: at least one storage medium storing computer instructions; and at least one processor for executing the computer instructions to implement the image generation method as described above.
[0020] One embodiment of this specification provides a computer-readable storage medium storing computer instructions, and when a computer reads the computer instructions, the computer executes the image color matching and / or image generation method as described above. Description of the Drawings
[0021] This specification will be further described by way of exemplary embodiments, which will be described in detail through the drawings. These embodiments are not restrictive. In these embodiments, the same numbers represent the same structures, where:
[0022] Figure 1 is a schematic diagram of an application scenario of an exemplary image color matching system shown according to some embodiments of this specification;
[0023] Figure 2 is a schematic diagram of modules of an exemplary image color matching system shown in some embodiments of this specification;
[0024] Figure 3 is a schematic diagram of modules of an exemplary image generation system shown in some embodiments of this specification;
[0025] Figure 4 is a schematic flowchart of an exemplary image color matching method shown in some embodiments of this specification;
[0026] Figure 5 is a schematic diagram of an exemplary foreground layer and background layer of an image shown in some embodiments of this specification;
[0027] Figures 6 - 8 is a schematic diagram of an exemplary image color matching method shown in some embodiments of this specification;
[0028] Figure 9 is a schematic flowchart of an exemplary image generation method shown in some embodiments of this specification. Detailed implementation manners
[0029] To more clearly illustrate the technical solutions of the embodiments of this specification, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some examples or embodiments of this specification. For those of ordinary skill in the art, without creative efforts, this specification can also be applied to other similar scenarios based on these drawings. Unless obvious from the language context or otherwise stated, the same reference numerals in the figures represent the same structure or operation.
[0030] It should be understood that the "system", "device", "unit" and / or "module" used herein is a way to distinguish different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the said words can be replaced by other expressions.
[0031] As shown in this specification and the claims, unless the context clearly indicates an exception, words such as "a", "an", "one" and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0032] Flowcharts are used in this specification to illustrate the operations performed by the systems according to the embodiments of this specification. It should be understood that the preceding or subsequent operations are not necessarily executed precisely in sequence. On the contrary, the steps can be processed in reverse order or simultaneously. Also, other operations can be added to these processes, or one or more steps can be removed from these processes.
[0033] Current intelligent mapping tools generally rely on design templates generated within the system to tile and combine pictures and copywriting to generate target images (for example, generating product promotion pictures, public welfare promotion pictures, etc.), which are greatly affected by the types and quantities of design templates. In addition, such mapping tools lack the ability to map with natural colors as the basis, and there is a problem of improper color matching between the design template and the content information due to the lack of systematic constraints and rules in the matching of text, illustrations, buttons and other content information in the image background layer and foreground layer, resulting in a large number of unusable "waste pictures" (for example, the color contrast between the content information in the foreground layer such as text and illustrations in the image and the background layer color is not obvious), which not only has low efficiency, but also increases the time and operation cost for users to screen images.
[0034] An image color matching method is provided in the embodiments of this specification. By determining the background layer color of the target image based on color system information and determining the foreground layer color of the target image based on the background layer color, the target image is generated according to the background layer color and the foreground layer color, which can save the template production cost and improve the success rate and efficiency of target image generation.
[0035] Figure 1 It is a schematic diagram of an application scenario of an exemplary image color matching system shown according to some embodiments of this specification.
[0036] As Figure 1 shown, the image color matching system 100 may include a processing device 110, a terminal device 120, a storage device 130, and a network 140. In some embodiments, the processing device 110 may be a part of the terminal device 120.
[0037] The processing device 110 can process data and / or information obtained from the terminal device 120, the storage device 130, or other components of the image color matching system 100. For example, the processing device 110 can obtain image information (such as first image information, second image information, etc.) from the terminal device 120, and analyze and process it to determine the colors of the foreground layer 151 and the background layer 152 of the target image, and / or generate the target image 150 based on the foreground layer 151 and the background layer 152. In some embodiments, the processing device 110 can be local or remote. For example, the processing device 110 can access information and / or data from the terminal device 120 and / or the storage device 130 through the network 140.
[0038] In some embodiments, the processing device 110 may include an input device and / or an output device. Through the input device and / or the output device, interaction with the user can be achieved (for example, obtaining image information, displaying a target image, etc.). In some embodiments, the input device and / or the output device may include a display screen, a keyboard, a mouse, a microphone, etc. or any combination thereof.
[0039] The terminal device 120 may be connected to and / or communicate with the processing device 110 and / or the storage device 130. For example, the terminal device 120 may obtain the generated target image from the processing device 110 and display it for output to the user. In some embodiments, the terminal device 120 may include a mobile device 121, a tablet computer 122, a laptop computer 123, a server, a processing device, etc. or any combination of one or more devices having functions such as data uploading, receiving, processing, outputting, and / or displaying. In some embodiments, the terminal device 120 (or all or part of its functions) may be integrated into the processing device 110. In some embodiments, the processing device 110 and the terminal device 120 may be directly or indirectly connected and cooperate to implement the methods and / or functions described in this specification. In some embodiments, one or more users may use the terminal device 120, which may include users directly using the service (for example, the target image generation service) and other related users.
[0040] The storage device 130 may store data, instructions, and / or any other information. In some embodiments, the storage device 130 may store data obtained from the processing device 110 and / or the terminal device 120 (for example, a target image, first image information, second image information, etc.). In some embodiments, the storage device 130 may store computer instructions for implementing the image color matching method and / or the image generation method, etc.
[0041] In some embodiments, the storage device 130 may include one or more storage components, and each storage component may be an independent device or a part of other devices. In some embodiments, the storage device 130 may include a random access memory (RAM), a read only memory (ROM), a mass storage device, a removable storage device, a volatile read / write memory, etc. or any combination thereof. Exemplarily, the mass storage device may include a magnetic disk, an optical disk, a solid state disk, etc. In some embodiments, the storage device 130 may be implemented on a cloud platform.
[0042] Network 140 may include any suitable network capable of facilitating information and / or data exchange. In some embodiments, at least one component of the image color matching system 100 (e.g., the processing device 110, the terminal device 120, the storage device 130) may exchange information and / or data with at least one other component in the image color matching system 100 via the network 140. For example, the processing device 110 may obtain image information from the terminal device 120 via the network 140.
[0043] It should be noted that the image color matching system 100 is provided for illustrative purposes only and is not intended to limit the scope of this specification. Those of ordinary skill in the art can make various modifications or changes according to the description of this specification. For example, the image color matching system 100 may implement similar or different functions on other devices. However, these changes and modifications do not depart from the scope of this specification.
[0044] Figure 2 is a schematic block diagram of an exemplary image color matching system shown in some embodiments of this specification.
[0045] As Figure 2 shown, in some embodiments, the image color matching system 200 may include a first acquisition module 210, a color determination module 220, and a color matching module 230. In some embodiments, the functions corresponding to the image color matching system 200 may be implemented by the processing device 110.
[0046] The first acquisition module 210 may be used to acquire first image information. In some embodiments, the first image information may include color system information and content information. In some embodiments, the content information may include at least one of text, illustrations, buttons, and labels, etc.
[0047] The color determination module 220 may be used to determine the background layer color of the target image. In some embodiments, the color determination module 220 may determine the background layer color of the target image based on the color system information. In some embodiments, the color determination module 220 may use a preset algorithm to determine the hue value, saturation value, and brightness value based on the color system information; and determine the background layer color of the target image based on the hue value, saturation value, and brightness value.
[0048] In some embodiments, the background layer color may include a single color or a gradient color. In some embodiments, the gradient color may include a single-color gradient color and a cross-color gradient color. In some embodiments, when the background layer color is a single color, the saturation value S and the brightness value B of the background layer color may satisfy the mathematical formula (1): B - 100 ≥ 20 2 / (S - 100). In some embodiments, when the background layer color is a single - color gradient color, the hue value of the background layer color is fixed, and the saturation value S1 and brightness value B1 of the gradient color can satisfy the following conditions: If S0 + X > 100, then the saturation value S1 of the gradient color is 100, and the brightness value B1 is B0 + S0 - 100; If B0 + X > 100, then the brightness value B1 of the gradient color is 100, and the saturation value S1 is B0 + S0 - 100. Wherein, S0 represents the saturation value corresponding to the base color of the background layer color, B0 represents the brightness value corresponding to the base color, and X can be any integer within the interval [20, 40]. In some embodiments, when the background layer color is a cross - color gradient color, the saturation value and brightness value of the background layer color are both fixed, and the hue value H1 of the gradient color satisfies the following conditions: If H0 + Y > 360, then the hue value H1 of the gradient color is H0 + Y - 360; If H0 - Y < 0, then the hue value H1 of the gradient color is 360 - (Y - H0). Wherein, H0 represents the hue value corresponding to the base color of the background layer color, and Y can be any integer within the interval [30, 60].
[0049] The color matching module 230 can be used to determine the foreground layer color of the target image based on the background layer color. In some embodiments, the foreground layer may include content information. In some embodiments, when the background layer color and the foreground layer color belong to the same type of hue, the background layer color and the foreground layer color can be respectively located in the first preset area and the second preset area of the same type of hue; when the background layer color and the foreground layer color belong to different hues, the hue of the foreground layer color can be located within the preset color gamut of the hue of the background layer color. In some embodiments, the preset color gamut can be the 60 - degree adjacent hues of the hue of the background layer color. In some embodiments, when the first preset area is smaller than the second preset area, the second preset area can satisfy the following mathematical formula (2):
[0050] S≥B≥20 2 / (S - 100)+100, (100 / 8≤S≤100) (2)
[0051] Wherein, S represents the saturation value, and B represents the brightness value.
[0052] In some embodiments, when the first preset area is larger than the second preset area, the second preset area can satisfy the following mathematical formula (3):
[0053]
[0054] In some embodiments, when the background layer color and the foreground layer color belong to different hues, the foreground layer color can be determined based on the following mathematical formulas (4) and (5):
[0055] B2 - 100≥202 / (S2 - 100), (0 < S2 ≤ 100, 0 < B2 ≤ 100) (4)
[0056] H - 60 ≤ H2 ≤ H + 60, (0 ≤ H ≤ 360) (5)
[0057] Among them, B2, S2, and H2 respectively represent the brightness value, saturation value, and hue value corresponding to the foreground layer color. And when S2 = 0, B2 = 100; when S2 = 100, B2 = 0; H represents the hue value corresponding to the background layer color.
[0058] For more content about the functions of the first acquisition module 210, color determination module 220, and color matching module 230, reference can be made to Figure 4 and its related descriptions, which will not be elaborated here.
[0059] Figure 3 It is a schematic diagram of the modules of an exemplary image generation system shown according to some embodiments of this specification.
[0060] As Figure 3 shown, in some embodiments, the image generation system 300 may include an image color matching module 310, a second acquisition module 320, and an image generation module 330. In some embodiments, the functions corresponding to the image generation system 300 may be implemented by the processing device 110 or the terminal device 120.
[0061] The image color matching module 310 can be used to determine the foreground layer color and the background layer color of the target image. In some embodiments, the image color matching module 310 can implement the same or similar functions as the image color matching system 200. For more content, reference can be made to Figure 2 or Figure 4 and its related descriptions, which will not be elaborated here. For example, the image color matching module 310 may further include an image information acquisition unit, a color determination unit, and a color matching unit (not shown in the figure). Among them, the image information acquisition unit can be used to acquire the first image information, the color determination unit can be used to determine the background layer color of the target image, and the color matching unit can be used to determine the foreground layer color of the target image based on the background layer color.
[0062] The second acquisition module 320 can be used to acquire the second image information. In some embodiments, the second image information may include at least one of the image theme, size, and style, etc.
[0063] The image generation module 330 can be used to generate a target image based on the second image information, the foreground layer color, and the background layer color. For example, the image generation module 330 can generate the foreground layer 151 of the target image based on the second image information and the foreground layer color, generate the background layer 152 of the target image based on the background layer color, and generate the target image 150 based on the foreground layer 151 and the background layer 152.
[0064] It should be understood that Figure 2 and Figure 3 the systems and their modules shown can be implemented in various ways. For example, in some embodiments, the systems and their modules can be implemented through hardware, software, or a combination of software and hardware.
[0065] It should be noted that the above descriptions of the system 200 and / or system 300 and their modules are only for convenience of description and are illustrative, and do not limit this specification to the scope of the exemplified embodiments. It can be understood that for those skilled in the art, after understanding the principle of the system, they may, without departing from this principle, make any combination of the various modules, or form a subsystem and connect it to other modules. For example, in some embodiments, Figure 2 or Figure 3 the above modules disclosed in can be different modules in a system, or a module can implement the functions of the above two or more modules. Also, for example, each module can share a storage module, or each module can have its own storage module separately. Such variations are all within the scope of protection of this specification.
[0066] Figure 4 is a schematic flowchart of an exemplary image color matching method according to some embodiments of this specification.
[0067] In some embodiments, the process 400 can be executed by the image color matching system 100 (for example, the processing device 110 or the terminal device 120) or the image color matching system 200. For example, the process 400 can be stored in a storage device (for example, the storage device 130, the storage unit of the system) in the form of a program or instructions. When the processor or Figure 2 the modules shown execute the program or instructions, the process 400 can be implemented. As Figure 4 shown, in some embodiments, the process 400 can include the following steps.
[0068] Step 410, obtain the first image information. In some embodiments, step 410 can be executed by the processing device 110, the terminal device 120, or the first acquisition module 210.
[0069] Image information (e.g., first image information, second image information) can reflect the parameters of the target image to be generated. For example, the first image information may include color system information and content information. The color system information can reflect the hue in which the image color is located. For example, red hue, green hue, blue hue, etc. The content information can reflect the content that needs to be included in the image. In some embodiments, the content information may include at least one of text, illustrations, buttons, and labels, etc. The text can be content introducing the promotional information involved in the image, such as a promotional slogan, an event title, a product / service name, etc. The illustration can be a picture related to the promotional information of the target image, such as a product picture, an event picture, etc. The button can be a link that can jump to other pages (for example, a link button to enter the product purchase page). The label can be parameter information that can introduce a logo picture, a button background picture, a tool icon, etc. For example, when generating a poster image for promoting a certain green food, the image information may include green (i.e., color system), "organic, healthy" (i.e., text), a food picture (i.e., illustration), a button to jump to the product details, etc. Another example is when generating a poster for promoting a National Day promotion event, the image information may include red (i.e., color system), "Receive great National Day gifts - enjoy discount benefits in thousands of stores, subtract XX for every XX spent" (i.e., text), a button to jump to the online store purchase page, etc.
[0070] In some embodiments, the first image information can be obtained from a terminal device (e.g., terminal device 120) or a storage device (e.g., storage device 130). For example, the processing device 110 can obtain information such as color system, text, and buttons input by the user through the terminal device 120. In some embodiments, the input methods may include but are not limited to selection input, typing input, voice input, scanning input, handwriting input, etc. or any combination thereof. In some embodiments, the first image information can be obtained in response to an image generation instruction. In some embodiments, the first image information can be obtained in response to an image editing instruction. For example, when generating an intermediate image and displaying it on the display interface of the terminal device 120, in response to the user clicking buttons such as adjust, modify, add, or delete, the first image information supplemented or re-entered by the user can be obtained.
[0071] Step 420, determine the background layer color of the target image based on the color system information. In some embodiments, step 420 can be executed by the processing device 110, the terminal device 120, or the color determination module 220.
[0072] In some embodiments, the image can be divided into an image background layer and a foreground layer according to its structure. Among them, the background layer can be a layer of the image base layer, and the foreground layer can be a layer above the base layer. For example, as Figure 5As shown, the base layer c of the image represents the background layer, and the illustration b and the text a above the base layer c correspond to the foreground layer. In some embodiments, the foreground layer may include one or more layers.
[0073] In some embodiments, the hue value, saturation value, and brightness value may be determined based on color system information using a preset algorithm, and the background layer color of the target image may be determined based on the hue value, saturation value, and brightness value. In some embodiments, the preset algorithm may include a color model. For example, the color model may include, but is not limited to, the HIS (Hue, Intensity, Saturation) color model, the HSB (Hue, Saturation, Brightness) color model, the HSV (Hue, Saturation, Value) color model, the RGB (Red, Green, Blue) color model, the CMYK (Cyan, Magenta, Yellow) color model, etc. In some embodiments, the preset algorithm may be the HSB (Hue, Saturation, Brightness) color model. Only as an example, as Figure 6 shown in Figure 6 (a) represents the hue H in the HSB color model, which includes a variety of different hues with values from 0 to 360, Figure 6 (b) represents the area corresponding to one of the hues. The ordinate of this area represents the brightness, and the abscissa represents the saturation. The values of both the saturation S and the brightness B are from 0 to 100.
[0074] In some embodiments, the background layer color may include a single color and / or a gradient color. In some embodiments, the single-color background layer color may be determined from the effective color gamut based on color system information. In some embodiments, the effective color gamut may be determined by a preset method (for example, mathematical formula (1)). Only as an example, when the color system is red, the processing device 110 may determine the hue value corresponding to red (for example, the hue value H = 0) based on the HSB color model, and based on the area corresponding to the red hue (for example, Figure 6 (b) the shown area) determine the effective color gamut (for example, Figure 6 (c) the area above the dotted line), and determine the saturation value S and brightness value B of the background layer color from the effective color gamut (for example, (S = 15, B = 100), (S = 44, B = 100), (S = 86, B = 95), (S = 100, B = 67), (S = 100, B = 29)).
[0075] In some embodiments, the gradient color can include a single-color gradient color and a cross-color gradient color. The single-color gradient color means that the gradient color and the base color are respectively colors corresponding to different saturations and / or brightnesses in the same hue. The cross-color gradient color means that the gradient color and the base color are respectively colors in different hues.
[0076] In some embodiments, the saturation value and / or brightness value of the gradient color can be determined based on the saturation value and / or brightness value of the base color, and then the single-color gradient color background layer can be determined. In some embodiments, the saturation value and / or brightness value of the base color can be determined based on the color system information (for example, randomly determining the saturation value and / or brightness value from the area shown in Figure 6 (b)). In some embodiments, when the background layer color is a single-color gradient color, the hue value of the background layer color is fixed, and the saturation value S1 and brightness value B1 of the gradient color can satisfy the first preset condition. For example, the first preset condition can be: if S0 + X > 100, then the saturation value S1 of the gradient color = 100, and the brightness value B1 = B0 + S0 - 100; if B0 + X > 100, then the brightness value B1 of the gradient color = 100, and the saturation value S1 = B0 + S0 - 100; where S0 represents the saturation value corresponding to the base color of the background layer color, B0 represents the brightness value corresponding to the base color, and X is any integer within the interval [20, 40]. In some embodiments, the value of X can be other numerical ranges, for example, [30, 60], [10, 50], etc., and this specification does not limit this.
[0077] Merely as an example, the processing device 110 can determine that the saturation value S0 of the base color of the background layer is 17, the brightness value B0 is 100, the saturation value S1 of the gradient color is 54, and the brightness value B1 is 100; or, the saturation value S0 of the base color is 100, the brightness value B0 is 50, the saturation value S1 of the gradient color is 100, and the brightness value B1 is 15; or, the saturation value S0 of the base color is 69, the brightness value B0 is 97, the saturation value S1 of the gradient color is 100, and the brightness value B1 is 71; or, the saturation value S0 of the base color is 99, the brightness value B0 is 82, the saturation value S1 of the gradient color is 99, and the brightness value B1 is 42.
[0078] In some embodiments, the hue value of the gradient color can be determined based on the hue value of the base color, and then the cross-color gradient color background layer can be determined. In some embodiments, the saturation value, brightness value, and / or hue value of the base color can be determined based on the color system information (for example, based on the color system information from Figure 6(a) and the color of the base color determined in the area shown in (b). In some embodiments, when the background layer color is a cross-color gradient color, the saturation value and the brightness value of the background layer color are both fixed, and the hue value H1 of the gradient color can satisfy a second preset condition. For example, the second preset condition may include that the hue corresponding to the gradient color is within a preset area of the hue corresponding to the base color (for example, the adjacent hue within 30° to 60° of the hue corresponding to the base color). Specifically, the second preset condition may be: if H0 + Y > 360, then the hue value H1 of the gradient color = H0 + Y - 360; if H0 - Y < 0, then the hue value H1 of the gradient color = 360 - (Y - H0); where H0 represents the hue value corresponding to the base color of the background layer color, and Y is any integer within the range [30, 60]. In some embodiments, the value of Y may be other numerical ranges, and this specification does not limit this.
[0079] Merely by way of example, the processing device 110 may determine that the saturation values of the base color and the gradient color of the background layer are both 75, the brightness values are both 100, the hue value H0 of the base color is 50, and the hue value H1 of the gradient color is 0; or, the saturation values of the base color and the gradient color are both 71, the brightness values are both 95, the hue value H0 of the base color is 35, and the hue value H1 of the gradient color is 339; or, the saturation values of the base color and the gradient color are both 70, the brightness values are both 96, the hue value H0 of the base color is 19, and the hue value H1 of the gradient color is 329; or, the saturation values of the base color and the gradient color are both 75, the brightness values are both 94, the hue value H0 of the base color is 353, and the hue value H1 of the gradient color is 293.
[0080] In some embodiments, the background layer color may be determined based on the content information. For example, the background layer color (for example, the base color) may be determined based on the color of the illustration. In some embodiments, when the content information includes color sampling of multiple colors, the background layer color may be determined based on the color coverage area of the content information. For example, when the illustration includes multiple colors, the processing device 110 may extract the color with the largest proportion in the illustration and match the color within the 60-degree adjacent hue corresponding to its hue as the background layer color. Another example is that when the illustration includes multiple colors, the processing device 110 may extract the two colors with the largest proportion in the illustration and match the colors corresponding to the two colors as the base color and the gradient color of the background layer respectively.
[0081] In some embodiments, the background layer color may be determined based on the color system information and the content information.
[0082] Step 430, determine the foreground layer color of the target image based on the background layer color. In some embodiments, step 410 may be executed by the processing device 110, the terminal device 120, or the color matching module 230.
[0083] In some embodiments, the foreground layer may include content information; correspondingly, the foreground layer color may include the color of the content information. In some embodiments, the foreground layer color and the background layer color may be determined to belong to the same hue or different hues based on the color system information and / or the content information. In some embodiments, when the background layer color and the foreground layer color belong to the same hue, the background layer color and the foreground layer color may be located in the first preset area and the second preset area of the same hue respectively; when the background layer color and the foreground layer color belong to different hues, the hue of the foreground layer color is within the preset color gamut of the hue of the background layer color. Among them, the first preset area and the second preset area may be areas formed by different saturation values and / or brightness values in the same hue (for example, Figure 7 (the first preset area and the second preset area shown in (a) and (b)).
[0084] In some embodiments, when the first preset area is smaller than the second preset area, the saturation value S and the brightness value B of the second preset area may satisfy the mathematical formula (2):
[0085] S≥B≥20 2 / (S - 100)+100, (100 / 8≤S≤100) (2)
[0086] For example, as shown in Figure 7 (a), the first preset area corresponds to the light gray rectangular area in the same hue, and the second preset area corresponds to the light gray irregular triangle area in the same hue. When the background layer color is located in the first preset area, the foreground layer color can be determined from the second preset area.
[0087] In some embodiments, when the first preset area is larger than the second preset area, the saturation value S and the brightness value B of the second preset area may satisfy the mathematical formula (3):
[0088]
[0089] For example, as shown in Figure 7 (b), the first preset area corresponds to the light gray irregular triangle area in the same hue, and the second preset area corresponds to the light gray rectangular area in the same hue. When the background layer color is located in the first preset area, the foreground layer color can be determined from the second preset area.
[0090] In some embodiments, the preset color gamut may be the 60-degree adjacent hue of the hue of the background layer color (for example, Figure 8(a). The 60-degree adjacent hue of the base color shown in (a). In some embodiments, the preset color gamut may be the adjacent hues within other numerical ranges of the hue of the background layer color (for example, 15-degree adjacent hues, 30-degree adjacent hues, 90-degree adjacent hues, 120-degree adjacent hues, 180-degree adjacent hues, etc.), and this specification does not limit this.
[0091] For example, as Figure 8 shown in (b), a sector represents a preset color gamut, and the background layer color and the foreground layer color can be different colors within the same sector. The processing device 110 can determine the foreground layer color based on the background layer color using mathematical formulas (4) and (5):
[0092] B2 - 100 ≥ 20 2 / (S2 - 100), (0 < S2 ≤ 100, 0 < B2 ≤ 100) (4)
[0093] H - 60 ≤ H2 ≤ H + 60, (0 ≤ H ≤ 360) (5)
[0094] where B2, S2, and H2 respectively represent the brightness value, saturation value, and hue value corresponding to the foreground layer color, and H represents the hue value corresponding to the background layer color.
[0095] In some embodiments, the foreground layer color can be determined based on the base color of the background layer. In some embodiments, the foreground layer color can be determined based on the gradient color of the background layer.
[0096] In some embodiments, the background layer of the target image (for example, background layer 152) can be generated based on the background layer color, and the foreground layer of the target image (for example, foreground layer 151) can be generated based on the foreground layer color. In some embodiments, the target image (for example, target image 150) can be generated based on the background layer and the foreground layer. For more detailed content, reference can be made to Figure 9 its related description, which will not be elaborated here.
[0097] It should be noted that the above description of process 400 is only for illustration and example, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to process 400 under the guidance of this specification. For example, in step 430, the foreground layer color can be determined based on the color of the content information and the background layer color, or based on the color system information and the content information. However, these modifications and changes are still within the scope of this specification.
[0098] Figure 9 is a flowchart of an exemplary image generation method shown in some embodiments of this specification.
[0099] In some embodiments, process 900 may be executed by image color matching system 100 (e.g., processing device 110 or terminal device 120) or image generation system 300. For example, process 900 may be stored in a storage device (e.g., storage device 130, the storage unit of the system) in the form of a program or instructions. When the processor or Figure 3 the modules shown execute the program or instructions, process 900 can be implemented. Only as an example, as Figure 9 shown, after the processing device 110 obtains the image information from the terminal device 120 or the storage device 130, it can determine the background layer color and the foreground layer color of the target image based on the image information, and then generate the target image based on the background layer color and the foreground layer color. Specifically:
[0100] Step 910, obtain image information. In some embodiments, step 910 may be executed by the processing device 110, the terminal device 120, the first acquisition module 210, or the second acquisition module 320.
[0101] The image information may include first image information and second image information. In some embodiments, the second image information may include at least one of an image theme, size, and style, etc. The image theme may reflect the promotional purpose of the target image (e.g., year-end promotion, product promotion, public welfare promotion, etc.). The size may reflect the size of the target image. The style may reflect the application scenario of the target image (e.g., finance, technology, etc.). For example, finance may include but is not limited to stocks, funds, concepts (e.g., electric vehicles), etc.; technology may include but is not limited to aerospace, navigation, etc.
[0102] In some embodiments, the image information may be obtained through a terminal device (e.g., terminal device 120). For example, the user may input the first image information and / or the second image information through the terminal device 120, and the terminal device 120 may transmit the relevant information to the processing device 110. In some embodiments, the first image information and the second image information may be obtained simultaneously or separately.
[0103] Step 920, determine the background layer color of the target image. In some embodiments, step 920 may be executed by the processing device 110, the terminal device 120, the color determination module 220, or the image color matching module 310.
[0104] In some embodiments, the background layer color may be determined based on the image information. For example, the processing device 110 may determine the background layer color based on the first image information. For more content on determining the background layer color, reference can be made to Figure 4 and its related descriptions, which will not be elaborated here.
[0105] Step 930, generate the background layer of the target image. In some embodiments, step 930 may be executed by the processing device 110, the terminal device 120, or the image generation module 330.
[0106] In some embodiments, the background layer of the target image may be generated based on the background layer color. In some embodiments, one or more background layers may be generated. In some embodiments, the generated background layer may include one or more of a single-color background layer, a single-color gradient background layer, and a cross-color gradient background layer, etc. For example, the processing device 110 may generate 3 single-color background layers, or 3 single-color background layers and 5 single-color gradient background layers, or 3 single-color background layers and 2 cross-color gradient background layers, or 10 single-color background layers, 10 single-color gradient background layers, and 10 cross-color gradient background layers, etc. In some embodiments, the number of background layers and / or color categories (e.g., single color and gradient color) may be determined based on the image information. For example, the corresponding number of background layers may be generated based on the number of target images input by the user.
[0107] In some embodiments, the background layer of the target object may be generated based on the image information (e.g., the second image information) and the background layer color. For example, the background layer of the corresponding size may be generated based on the image size and the background layer color. In some embodiments, post-processing (e.g., adding background texture) may be performed on the background layer to generate the background layer of the corresponding target object.
[0108] Step 940, determine the foreground layer color of the target image. In some embodiments, step 940 may be executed by the processing device 110, the terminal device 120, the color matching module 230, or the image color matching module 310.
[0109] In some embodiments, the foreground layer color of the target image may be determined based on the background layer color. In some embodiments, the foreground layer color of the target image may be determined based on the image information (e.g., the first image information) and the background layer color. For more information on determining the foreground layer color, reference may be made to Figure 4 and its related description, which will not be elaborated here.
[0110] Step 950, obtain the foreground layer material from the database. In some embodiments, step 950 may be executed by the processing device 110, the terminal device 120, or the second acquisition module 320.
[0111] In some embodiments, the foreground layer material may include one or more of materials such as illustrations, labels, buttons, etc. In some embodiments, the foreground layer material may be obtained from a database (e.g., storage device 130) based on the foreground layer color. For example, buttons of corresponding colors may be obtained from the storage device 130 based on the foreground layer color. In some embodiments, the foreground layer material may be obtained from a database (e.g., storage device 130) based on the image information. For example, the processing device 110 may obtain materials such as illustrations, buttons, labels, etc. of corresponding color systems from the storage device 130 based on the color system information and the content information. In some embodiments, step 950 may be omitted.
[0112] Step 960, generate the foreground layer of the target image. In some embodiments, step 960 may be executed by the processing device 110, the terminal device 120, or the image generation module 330.
[0113] In some embodiments, the foreground layer of the target image may be generated based on the foreground layer color. In some embodiments, the corresponding number of foreground layers may be generated based on the number of background layers. In some embodiments, the foreground layer of the target object may be generated based on the image information (e.g., the second image information) and the foreground layer color. For example, the foreground layer may be generated based on the content information, theme, style, and foreground layer color. In some embodiments, the foreground layer of the target image may be generated based on a preset layout rule. For example, the processing device 110 may layout the content information such as text, illustrations, buttons, etc. in the foreground layer based on the preset layout rule, and then generate the corresponding foreground layer.
[0114] Step 970, generate the target image. In some embodiments, step 970 may be executed by the processing device 110, the terminal device 120, or the image generation module 330.
[0115] In some embodiments, the target image may be generated based on the foreground layer and the background layer. In some embodiments, the target image may be displayed on a terminal device (e.g., the terminal device 120) for output to the user. In some embodiments, the target image may be adjusted based on the feedback information. For example, the parameters such as the layout, color, size, style, etc. of the target image may be adjusted based on the user's screening record and editing record of the target image.
[0116] It should be noted that the above description of the process 900 is only for illustration and explanation, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to the process 900 under the guidance of this specification. However, these modifications and changes are still within the scope of this specification.
[0117] The image color matching and image generation method provided in some embodiments of this specification: (1) By determining the background layer color based on image information and determining the foreground layer color according to the background layer color, the color matching and rationality between the background layer and the foreground layer can be improved; (2) By determining the hue value, saturation value, and brightness value to determine the background layer color and the foreground layer color, the colors of the foreground layer and the background layer can be made closer to the human visual principle; (3) Generating a corresponding target image based on the determined background layer color and foreground layer color can improve the aesthetic effect, generation success rate, and generation efficiency of the target image.
[0118] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only an example and does not constitute a limitation to this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements, and corrections to this specification. Such modifications, improvements, and corrections are suggested in this specification, so such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of this specification.
[0119] Meanwhile, this specification uses specific terms to describe the embodiments of this specification. Such as "one embodiment", "an embodiment", and / or "some embodiments" mean a certain feature, structure, or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "an embodiment" or "one embodiment" or "an alternative embodiment" mentioned twice or more at different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this specification can be appropriately combined.
[0120] In addition, unless clearly stated in the claims, the order of the processing elements and sequences, the use of numbers and letters, or the use of other names in this specification are not used to limit the order of the processes and methods in this specification. Although various examples are discussed above to illustrate some currently useful invention embodiments, it should be understood that such details only serve the purpose of explanation. The appended claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that conform to the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only through software solutions, such as installing the described system on existing servers or mobile devices.
[0121] Similarly, it should be noted that, in order to simplify the presentation disclosed in this specification and thus assist in the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of this specification, multiple features are sometimes grouped into one embodiment, drawing, or description thereof. However, this method of disclosure does not mean that the features required by the subject matter of this specification are more than those mentioned in the claims. In fact, the features of the embodiments are fewer than all the features of the individual embodiments disclosed above.
[0122] In some embodiments, numbers are used to describe components and the quantity of attributes. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximate", or "substantially" in some examples. Unless otherwise specified, "about", "approximate", or "substantially" indicate that the said numbers allow a variation of ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, and such approximate values may vary according to the characteristics required by individual embodiments. In some embodiments, the numerical parameters should consider the specified significant digits and adopt the method of retaining the general number of digits. Although the numerical ranges and parameters used in some embodiments of this specification to confirm the breadth of their scope are approximate values, in specific embodiments, such numerical settings are made as precise as possible within the feasible range.
[0123] For each patent, patent application, patent application publication, and other materials cited in this specification, such as articles, books, specifications, publications, documents, etc., their entire contents are hereby incorporated into this specification by reference. Except for the application history documents that are inconsistent with or conflict with the content of this specification, and except for the documents that limit the broadest scope of the claims of this specification (currently or subsequently appended to this specification). It should be noted that if there are inconsistencies or conflicts between the descriptions, definitions, and / or uses of terms in the supplementary materials of this specification and the content described in this specification, the descriptions, definitions, and / or uses of terms in this specification shall prevail.
[0124] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, by way of example and not limitation, alternative configurations of the embodiments of this specification can be considered to be consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. An image color matching method, characterized in that, The method includes: Obtaining first image information, where the first image information includes color system information and content information, and the first image information reflects the parameters of the target image to be generated; Determining the background layer color of the target image based on the color system information and / or the content information. Wherein, when the content information includes color sampling of multiple colors, the background layer color is determined based on the color coverage area of the content information; the background layer color includes single-color and gradient colors, and the background layer color is used to generate the background layer of the target image; and Determining the foreground layer color of the target image based on the background layer color, where: When the background layer color and the foreground layer color belong to the same color hue, the background layer color and the foreground layer color are respectively located in the first preset area and the second preset area of the same color hue, and the first preset area and the second preset area are areas formed by different saturation values and / or brightness values in the same color hue; When the background layer color and the foreground layer color belong to different color hues, the color hue of the foreground layer is located within the preset color gamut of the color hue of the background layer, and the preset color gamut is the 60-degree adjacent color hue of the color hue of the background layer; The foreground layer includes the content information, and the foreground layer color is used to generate the foreground layer of the target image.
2. The method according to claim 1, characterized in that The determining the background layer color of the target image based on the color system information includes: Determining the hue value, saturation value, and brightness value using a preset algorithm based on the color system information; Determining the background layer color of the target image based on the hue value, saturation value, and brightness value.
3. The method according to claim 2, wherein When the background layer color is the single color, the saturation value S and the brightness value B of the background layer color satisfy: B - 100 ≥ 20 2 / (S - 100).
4. The method according to claim 2, wherein The gradient color includes single-color gradient color and cross-color gradient color; When the background layer color is the single-color gradient color, the hue value of the background layer color is fixed, and the saturation value S1 and brightness value B1 of the gradient color satisfy the following conditions: If S0 + X > 100, then the saturation value S1 of the gradient color = 100, and the brightness value B1 = B0 + S0 - 100; If B0 + X > 100, then the brightness value B1 of the gradient color = 100, and the saturation value S1 = B0 + S0 - 100; Wherein, S0 and B0 respectively represent the saturation value and brightness value corresponding to the base color of the background layer color, and X is any integer within the range of [20, 40].
5. The method according to claim 4, wherein When the background layer color is the cross-color gradient color, the saturation value and brightness value of the background layer color are both fixed, and the hue value H1 of the gradient color satisfies the following conditions: If H0 + Y > 360, then the hue value H1 of the gradient color = H0 + Y - 360; If H0 - Y < 0, then the hue value H1 of the gradient color = 360 - (Y - H0); Wherein, H0 represents the hue value corresponding to the base color of the background layer color, and Y is any integer within the range of [30, 60].
6. The method according to claim 1, wherein When the first preset area is smaller than the second preset area, the second preset area satisfies: S≥B≥20 2 / (S - 100)+100, 100 / 8≤S≤100 When the first preset area is larger than the second preset area, the second preset area satisfies: 100 / 8 - ≥B≥20 2 / (S - 100)+100, 0≤S≤100 / 8 where S represents the saturation value and B represents the brightness value.
7. The method according to claim 1, wherein When the background layer color and the foreground layer color belong to different hues, determine the foreground layer color based on the following formula: B2 - 100 ≥ 20 2 / (S2 - 100), where 0 < S2 ≤ 100, 0 < B2 ≤ 100; and H - 60 ≤ H2 ≤ H + 60, 0 ≤ H ≤ 360; where B2, S2, and H2 respectively represent the brightness value, saturation value, and hue value corresponding to the foreground layer color, and H represents the hue value corresponding to the background layer color.
8. The method according to any one of claims 1-7, characterized in that, The content information includes at least one of text, illustrations, buttons, and labels; the foreground layer includes multiple layers.
9. The method according to claim 1, wherein Further included: Obtain second image information, which includes at least one of an image theme, size, and style; Generate the background layer of the target image based on the second image information and the background layer color.
10. The method according to claim 1, characterized in that, Further included: Determine the number of background layers based on the first image information; Generate a corresponding number of background layers based on the number of background layers and the background layer color; and Generate a corresponding number of foreground layers based on the number of background layers and the foreground layer color.
11. The method according to claim 1, wherein Further included: Generate the foreground layer of the target image based on the foreground layer color and a preset layout rule.
12. An image generation method, characterized in that, The method includes: Determine the foreground layer color and background layer color of the target image by using the method described in any one of claims 1 - 8; Obtain second image information, which includes at least one of an image theme, size, and style; Generate a background layer based on the second image information and the background layer color; Generate a foreground layer based on the second image information and the foreground layer color; Generate the target image based on the foreground layer and the background layer.
13. An image color matching system, characterized in that, The system includes: A first acquisition module for acquiring first image information, where the first image information includes color system information and content information, and the first image information reflects the parameters of the target image to be generated; A color determination module for determining the background layer color of the target image based on the color system information and / or the content information, where when the content information includes color sampling of multiple colors, determine the background layer color based on the color coverage area of the content information; the background layer color includes single colors and gradient colors, and the background layer color is used to generate the background layer of the target image; A color matching module for determining the foreground layer color of the target image based on the background layer color, where: When the background layer color and the foreground layer color belong to the same type of hue, the background layer color and the foreground layer color are respectively located in the first preset area and the second preset area of the same type of hue, and the first preset area and the second preset area are areas formed by different saturation values and / or brightness values in the same type of hue; When the background layer color and the foreground layer color belong to different hues, the hue of the foreground layer color is located within the preset color gamut of the hue of the background layer color, and the preset color gamut is the 60 - degree adjacent hue of the hue of the background layer color; The foreground layer includes the content information, and the foreground layer color is used to generate the foreground layer of the target image.
14. An image generation system, characterized in that, The system includes: An image color matching module, configured to determine the foreground layer color and the background layer color of a target image by using the method described in any one of claims 1-8; A second acquisition module, configured to acquire second image information, where the second image information includes at least one of an image theme, size, and style; and An image generation module, configured to Generate a background layer based on the second image information and the background layer color; Generate a foreground layer based on the second image information and the foreground layer color; and Generate the target image based on the foreground layer and the background layer.
15. An image color matching device, characterized in that, The device includes: At least one storage medium storing computer instructions; At least one processor, configured to execute the computer instructions to implement the method described in any one of claims 1-11.
16. An image generation device, characterized in that, The device includes: At least one storage medium storing computer instructions; At least one processor, configured to execute the computer instructions to implement the method described in claim 12.
17. A computer-readable storage medium storing computer instructions, where when a computer reads the computer instructions, the computer executes the method described in any one of claims 1-12.
Citation Information
Patent Citations
Color contrast adjusting method, device and equipment
CN113724356A