Image color matching method, device, equipment and medium
Through an automated color matching method based on color difference characteristics, the problem of low color matching efficiency of creative materials is solved, and the image design style and visual effects are maintained are achieved. At the same time, the color matching efficiency is greatly improved and the advertising update needs are met.
Patent Information
- Application Number
- CN202111348480.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-11-15
AI Technical Summary
The color matching efficiency of creative materials in the prior art is low, and cannot meet the advertising update needs in mobile terminal applications or Internet platforms. Professional designers participate in color matching, resulting in high costs.
By acquiring the initial image to be matched, multiple pixels to be matched are determined, and based on the color difference characteristics between these pixels, the color values are converted to generate a target image matching the initial image to realize automated color matching.
While ensuring that the image design style and visual effects remain unchanged, enrich image color matching materials, improve color matching efficiency, and meet advertising update needs.
Smart Images

Figure CN114299168B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to an image color matching method, device, equipment and medium. Background Art
[0002] Advertisements are an important means of promotion for businesses. In order to improve the conversion rate of advertisements, a large amount of creative materials need to be designed for advertisements, such as product entities, activity themes, background images, advertisement texts, etc., so as to maintain a certain update frequency in mobile terminal applications or Internet platforms, expand the scope of advertisement dissemination, and enhance freshness.
[0003] In the related art, for a product, multiple advertising pictures can be obtained as materials by re-coloring. However, the color matching of advertising pictures often requires professional designers to produce, and the material production efficiency is low, which cannot meet the advertising update needs in various mobile terminal applications or Internet platforms.
[0004] Therefore, it is urgent to propose an image color matching scheme to overcome the technical problems existing in related technologies. Summary of the invention
[0005] The present disclosure provides an image color matching method, device, equipment and medium to at least solve the problem in the related art that the production efficiency of advertising materials is low and the demand for advertising updates cannot be met. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image color matching method, comprising:
[0007] Obtain an initial image to be color matched;
[0008] Determine a plurality of first pixels to be color matched in the initial image;
[0009] According to the color difference characteristics between the plurality of first pixels, the color values of the plurality of first pixels in a preset color space are converted to obtain a plurality of second pixels, so as to generate a target image matching the initial image;
[0010] The color difference features between the plurality of second pixels in the target image correspond to the color difference features between the plurality of first pixels in the initial image.
[0011] According to a second aspect of an embodiment of the present disclosure, there is provided an image color matching device, comprising:
[0012] An acquisition unit, configured to acquire an initial image to be color matched;
[0013] A determining unit, configured to determine a plurality of first pixels to be color matched in an initial image;
[0014] a conversion unit configured to convert the color values of the plurality of first pixels in a preset color space according to the color difference characteristics of the plurality of first pixels to obtain a plurality of second pixels, so as to generate a target image matching the initial image;
[0015] The color difference features between the plurality of second pixels in the target image correspond to the color difference features between the plurality of first pixels in the initial image.
[0016] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a processor and a memory, wherein an executable code is stored on the memory, and when the executable code is executed by the processor, the processor can at least implement the image color matching method in the first aspect.
[0017] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute at least the image color matching method in the first aspect.
[0018] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the image color matching method in the first aspect is implemented.
[0019] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0020] In this solution, an initial image to be color matched is obtained; multiple first pixels to be color matched in the initial image are determined; and the color values of the multiple first pixels in a pre-set color space are converted according to the color difference characteristics between the multiple first pixels to obtain multiple second pixels, so as to generate a target image matching the initial image; wherein the color difference characteristics between the multiple second pixels in the target image correspond to the color difference characteristics between the multiple first pixels in the initial image. In this solution, for multiple pixels to be color matched in the initial image, the color values of the multiple pixels are converted based on the color difference characteristics between the multiple pixels, so as to obtain a target image corresponding to the color difference characteristics in the initial image, thereby realizing automatic color matching for the initial image. While ensuring that the image design style and visual effects remain unchanged, the image color matching materials are greatly enriched, the image color matching efficiency is improved, and it helps to meet the advertising update needs in various mobile terminal applications or Internet platforms.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0023] Figure 1 The figure is a flowchart of an image color matching method according to an exemplary embodiment.
[0024] Figure 2 It is a schematic diagram showing the principle of an image color matching method according to an exemplary embodiment.
[0025] Figure 3 It is a schematic diagram showing the principle of another image color matching method according to an exemplary embodiment.
[0026] Figure 4 The figure is a schematic diagram showing the structure of an image color matching device according to an exemplary embodiment.
[0027] Figure 5 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0028] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0030] At present, in order to improve the advertising conversion rate, it is necessary to design a large amount of materials for advertising creativity, such as product entities, event themes, background pictures, advertising copy, etc., so as to maintain a certain update frequency in mobile terminal applications or Internet platforms, expand the scope of advertising dissemination, and enhance freshness.
[0031] Taking banner images as an example, in the related art, for a banner image of a certain product, more banner images are usually obtained as materials by re-coloring. However, the color matching of banner images often requires professional designers to produce, and the material production efficiency is low, which cannot meet the advertising update needs in various mobile terminal applications or Internet platforms. In addition, in the related color matching scheme, color matching rules can also be pre-extracted based on sample images, and the banner images can be adjusted based on the color matching rules, but such methods usually cannot maintain the original design style and image effects (such as gradient effects, etc.) in the banner image, resulting in poor banner image effects after re-coloring.
[0032] In response to at least one of the above technical problems, the present disclosure proposes an image color matching method, device, equipment and medium to achieve automatic image color matching and improve image color matching efficiency.
[0033] The core principle of this technical solution is: for an initial image to be color matched, a plurality of pixels to be color matched in the initial image are determined (for distinction, referred to as first pixels in this disclosure). Furthermore, for the plurality of first pixels to be color matched in the initial image, the color values of the plurality of first pixels are converted based on the color difference characteristics between the plurality of first pixels to obtain a plurality of second pixels, thereby generating a target image corresponding to the color difference characteristics in the initial image, and realizing automatic color matching for the initial image. Since the color difference characteristics between the plurality of second pixels in the target image correspond to the color difference characteristics between the plurality of first pixels in the initial image, the target image retains the design style of the initial image and image effects such as gradient effects. In this way, while ensuring that the image design style and visual effects remain unchanged, the image color matching materials are greatly enriched, the image color matching efficiency is improved, and it helps to meet the advertising update requirements in various mobile terminal applications or Internet platforms.
[0034] Based on the above core principles, the technical solution provided by the present disclosure can be applied to various image processing scenarios that require adjustment of image color matching. Among them, the images to be color matched include but are not limited to pictures and videos. Various image processing scenarios are, for example, advertising material production scenarios, film and television post-production scenarios, and short video production scenarios. In the above image processing scenarios, optionally, in response to an image color matching request issued by a user, the present technical solution can be executed to return a target image to the user, or multiple target images can be returned to the user to provide a variety of images with richer color matching. Taking the advertising material production scenario as an example, in this scenario, it is necessary to batch produce supporting materials for advertising pictures. The technical solution provided by the present disclosure automatically matches the color of advertising pictures based on color difference features to retain the original design style and image effects of the advertising pictures, so that the advertising materials finally produced in batches are consistent with the original advertising pictures in design style and image effects. It is worth noting that in the present disclosure, the image to be color matched is referred to as the initial image, and the image finally obtained that retains the original design style and image effects is referred to as the target image.
[0035] The image color matching scheme provided by the present disclosure can be executed by an electronic device, which can be a terminal device such as a smart phone, a tablet computer, a PC, a laptop, etc. In an optional embodiment, the electronic device can also be implemented as a service device for executing the image color matching scheme, such as a server, a server cluster, a cloud server, etc.
[0036] After introducing the core principles, application scenarios, and execution devices, the following describes an image color matching method, device, equipment, and medium provided by the present disclosure in combination with specific embodiments.
[0037] Figure 1 is a flowchart of an image color matching method according to an exemplary embodiment. Figure 1 As shown, the image color matching method includes the following steps:
[0038] In step 101, an initial image to be color matched is obtained;
[0039] In step 102, a plurality of first pixels to be color matched in an initial image are determined;
[0040] In step 103, the color values of the plurality of first pixels in a preset color space are converted according to the color difference characteristics between the plurality of first pixels to obtain a plurality of second pixels, so as to generate a target image matching the initial image.
[0041] It is worth noting that in this embodiment, the color difference characteristics between multiple pixels are used to reflect the image design style and visual effect. In simple terms, the color difference characteristics between multiple pixels are essentially used to describe the differences in color components of multiple pixels, so as to extract the relationship between multiple pixels in visual characteristics. This relationship can be directly used to reflect the design style and visual effect of the image, for example, the gradient color effect and contrast color effect in the advertising picture.
[0042] From the perspective of color, in order to keep the image design style and visual effects before and after color matching consistent, the color difference features can be retained in the target image so as to retain the image design style and visual effects before color matching. That is to say, in this embodiment, the color difference features between the multiple second pixels in the target image correspond to the color difference features between the multiple first pixels in the initial image. The correspondence between the two color difference features here can be realized as having the same numerical correspondence on a certain visual feature quantity. Alternatively, the correspondence between the two color difference features can also be realized as having a proportional numerical correspondence on a certain visual feature quantity.
[0043] In order to facilitate the representation of the above-mentioned color difference characteristics, a color space is also introduced in this embodiment. The color space involved in this embodiment is also called a color model or a color model, which is an abstract mathematical model used to describe the visual components of color. Simply put, a set of parameter values can be used to represent various colors in a color space. Different color spaces use different types of parameters to represent colors, that is, different dimensions are used to describe color characteristics. Common color spaces include the three primary color model (RedGreenBlue, RGB), the hue saturation lightness space (Hue Saturation Lightness, HSL), and the like.
[0044] Take HSL as an example. HSL is a method of representing points in RGB in a cylindrical coordinate system and is one of the most widely used color spaces. HSL contains three components, each of which is used to represent the visual characteristics of the corresponding pixel from a different dimension. Among them, hue refers to the color reflected from or projected from an object, and hue is usually measured according to position from a standard color wheel. Saturation refers to the purity of the color, that is, the proportion of a certain color component in the current pixel. The higher the saturation, the greater the proportion of a certain color component in the current pixel. Generally speaking, the higher the saturation, the purer the color can be perceived visually, and the lower the saturation, the grayer the color can be perceived visually. Brightness refers to the ratio of the light intensity of the luminous body to the area of the light source, indicating the brightness of the color. Brightness can be defined as the brightness of the light source unit, that is, the luminous intensity per unit projection area. In fact, the brightness perceived by the human eye is determined by the light reflected or transmitted by the color.
[0045] In addition, for ease of description, in this embodiment, the pixel to be matched in the initial image is referred to as the first pixel, and the pixel corresponding to the first pixel in the final target image is referred to as the second pixel. Here, the correspondence between the first pixel and the second pixel refers to the correspondence in the layer where the pixels are located, which can also be understood as the corresponding relationship between the positions of the two in the image space.
[0046] After introducing the basic concepts involved in this embodiment, the implementation methods corresponding to each step are introduced below.
[0047] First, in step 101, an initial image to be color matched can be obtained. In this embodiment, the image to be color matched is referred to as the initial image, wherein the image to be color matched can be a picture or a video. Taking the advertising material production scenario as an example, in this scenario, it is necessary to batch produce supporting materials for advertising images. In an optional embodiment, in step 101, the relevant designer can upload the advertising image for which supporting materials need to be produced as the initial image. In another optional embodiment, in step 101, the execution device can also obtain the image to be color matched from the image library as the initial image. For example, taking the advertising update scenario as an example, in step 101, the advertising images corresponding to each advertisement can be obtained from the advertising image library based on the update cycle set for each advertisement, so as to re-color the advertising images that need to be updated.
[0048] In step 102, a plurality of first pixels to be color matched in the initial image are determined. Specifically, pixels to be re-color matched may be selected from the initial image as first pixels.
[0049] In an optional embodiment, the first pixel that needs to be re-colored can be selected according to the type of image elements contained in the initial image. Specifically, in step 102, the initial image can be divided into multiple layers according to the type of image elements; then, a layer composed of image elements to be colored is determined from the multiple layers as the target layer, and the pixels in the target layer are used as the first pixel. In practical applications, the type of image elements can be determined according to the content of the image elements, such as text elements, logo elements, background elements, and product elements. The image elements can be text, pictures, videos (such as advertising videos, etc.), which are not limited in this embodiment. Optionally, the color matching requirements of the image elements are determined according to the image adjustment requirements, and then the target layer to be colored is determined according to the color matching requirements.
[0050] For example, suppose the initial image is Figure 2Based on the banner image shown, text elements (i.e. XXXX), background elements (i.e. the background image of the mountain graphic), and logo elements (i.e. 123 company) can be identified from the banner image according to the image element type. Furthermore, the above three image elements can be divided into different layers to obtain a text layer, an image layer, and a logo layer. Among them, the text elements belong to the text layer, the background elements belong to the image layer, and the logo elements belong to the logo layer. Since the logo elements in the logo layer usually do not need to be recolored, while the text layer and the image layer need to be recolored, the text layer and the image layer can be used as the target layers, and multiple pixels in the target layer can be used as the first pixels.
[0051] In another optional implementation, the first pixel that needs to be recolored can be selected from the initial image by visual focus. For example, the image element at the geometric center of the initial image is used as the target image element, and multiple pixels in the target image element are used as the first pixels. Figure 3 Taking the banner picture shown in the figure as an example, the image elements in the visual focus area of one-third to two-thirds in the vertical direction of the initial image are used as target image elements, and a plurality of pixels in the target image elements are used as first pixels.
[0052] Of course, in practical applications, other methods can be used to determine the multiple first pixels to be color matched in the initial image, which will not be described here. Regardless of the method, the purpose is to filter out the pixels that need to be re-colored from the initial image to provide a basis for subsequent color conversion.
[0053] After selecting the first pixel to be matched from the initial image, in step 103, the color values of the multiple first pixels in a preset color space are converted according to the color difference characteristics between the multiple first pixels to obtain multiple second pixels, so as to generate a target image matching the initial image.
[0054] In an optional embodiment, it is assumed that the initial image includes a banner image, and it is assumed that the target layer includes an image layer and / or a text layer in the banner image. Based on the above assumption, step 103 can be implemented as follows:
[0055] Acquire first color values of multiple first pixels in a color space; convert the first color values of the multiple first pixels according to a predetermined conversion rule and color difference characteristics of the multiple first pixels to obtain second color values corresponding to the multiple first pixels in the color space; generate a target image according to the second color values of the multiple first pixels.
[0056] Specifically, in the above steps, for multiple first pixels in the image layer and / or the text layer, the multiple first pixels are converted into a color space to obtain first color values corresponding to the multiple first pixels. The first color values corresponding to the multiple first pixels include but are not limited to any one or more of the following: first hue values, saturation, and brightness of the multiple first pixels in the color space. For example, multiple first pixels are traversed in the image layer and / or the text layer, and the color values corresponding to the multiple first pixels are converted into color components in the HSL space, i.e., hue values, saturation, and brightness, thereby obtaining an array (i.e., first color values) consisting of color components corresponding to the multiple first pixels. Of course, the color space pre-set in this embodiment may also be other types of color spaces, such as RGB, hue value saturation brightness (HSV) space, etc., which are not limited here.
[0057] Taking the HSL space as an example, the color value conversion process of the image layer and the text layer is explained below.
[0058] For the image layer, optionally, it is assumed that the color difference feature includes a hue difference relationship. Here, the hue difference relationship can be understood as the difference relationship between any first pixel and other first pixels in hue value, specifically, the hue value difference between any first pixel and other first pixels.
[0059] Based on this, it is assumed that the first color value includes the first hue value of each first pixel in the HSL space, and the second color value includes the second hue value of multiple first pixels in the HSL space. Based on the above assumption, in the above steps, according to the predetermined conversion rule and the color difference characteristics of the multiple first pixels, the first color value is converted to obtain the second color value corresponding to the multiple first pixels in the color space, which can be implemented as follows:
[0060] For the multiple first pixels in the image layer, a hue adjustment parameter is obtained; and the difference between the first hue values corresponding to the multiple first pixels in the initial image and the hue adjustment parameter is used as the second hue values corresponding to the multiple first pixels.
[0061] Specifically, a random value a (such as any value from 0 to 360) can be generated as a hue adjustment parameter. Then, traverse multiple first pixels in the image layer, and subtract the random value a from the first hue value corresponding to each first pixel, so as to obtain the second hue values corresponding to the multiple first pixels. Through this step, while changing the hue value, the hue difference relationship between the multiple first pixels can also be retained, so that the hue difference values in the image before and after the conversion are consistent, ensuring the image design style and visual effect. It can be understood that the implementation principle of the above steps will be explained below using gradient colors as an example. Assuming that the initial image has a gradient color effect, in this case, it can be known that the first hue values of some first pixels in the initial image show a gradient trend. Then, the second hue value obtained by subtracting the same random value must also retain the same gradient trend. Therefore, the target image obtained based on the second hue values corresponding to the multiple first pixels can still present a unified gradient color effect.
[0062] Furthermore, after obtaining the second hue values corresponding to multiple first pixels, in the above steps, the implementation method of generating the target image according to the second color value may include: using the second hue values of the multiple first pixels as the hue values corresponding to multiple second pixels in the target image, so that the hue difference relationship between the multiple pixels in the target image is the same as the hue difference relationship between the multiple pixels in the initial image.
[0063] Optionally, since the first color values of the plurality of first pixels include the saturation and / or brightness of the plurality of first pixels in the HSL space, based on this, the saturation corresponding to the plurality of first pixels can also be used as the saturation corresponding to the plurality of second pixels in the target image. Alternatively, the brightness corresponding to the plurality of first pixels can be used as the brightness corresponding to the plurality of second pixels in the target image. In this way, by retaining the saturation and brightness in the initial image, the similarity between the target image and the initial image in terms of image design style and visual effect can be improved.
[0064] In this way, the color conversion of multiple first pixels in the image layer can be completed through the above steps, so as to obtain an image layer with the same image design style and visual effect, so as to generate the final target image.
[0065] For the text layer, optionally, it is assumed that the first color value includes the first hue values of the multiple first pixels in the color space. Based on the above assumption, according to the predetermined conversion rules and the color difference characteristics between the multiple first pixels, the first color values of the multiple first pixels are converted to obtain the second color values corresponding to the multiple first pixels in the color space, which can be implemented as follows:
[0066] According to the second hue values of the plurality of pixels in the image layer, the primary hue value in the image layer is obtained; for the plurality of first pixels in the text layer, the primary hue value is used as the hue value corresponding to the plurality of second pixels in the target image.
[0067] In the above steps, in an optional embodiment, a k-means clustering algorithm may be used to calculate the second hue values of multiple pixels in the image layer to obtain the primary hue value in the image layer. Further, for multiple first pixels in the text layer, the calculated primary hue value is set as the hue value corresponding to multiple second pixels in the target image.
[0068] Of course, in addition to the above k-means algorithm, other algorithms can be used to obtain the main hue value in the image layer, which will not be expanded here, such as median cut method, octree algorithm, etc.
[0069] Similarly, since the first color values of the plurality of first pixels in the text layer also include the saturation and / or brightness of the plurality of first pixels in the HSL space, similar to the setting method described above, the similarity between the target image and the initial image in image design style and visual effect can be improved by retaining the saturation and brightness in the initial image.
[0070] In this way, by extracting the main hue value of the image layer after conversion as the hue value of the text layer, a text layer that is more similar to the design style of the image layer can be obtained, thereby retaining the image design style and visual effect before the transformation in the text layer to generate the final target image.
[0071] In this embodiment, for the initial image to be color matched, multiple pixels to be color matched in the initial image are determined. Furthermore, for the multiple pixels to be color matched in the initial image, the color values of the multiple pixels are converted based on the color difference characteristics between the multiple pixels, so as to obtain a target image corresponding to the color difference characteristics in the initial image, and realize automatic color matching for the initial image. Since the color difference characteristics between the multiple second pixels in the target image correspond to the color difference characteristics between the multiple first pixels in the initial image, the target image retains the design style of the initial image and image effects such as gradient effects. While ensuring that the image design style and visual effects remain unchanged, the image color matching materials are greatly enriched, the image color matching efficiency is improved, and it helps to meet the advertising update needs in various mobile terminal applications or Internet platforms.
[0072] Figure 4 FIG. 1 is a schematic diagram showing a structure of an image color matching device according to an exemplary embodiment. Figure 4 The device includes an acquisition unit, a determination unit, and a conversion unit.
[0073] An acquisition unit, configured to acquire an initial image to be color matched;
[0074] A determining unit, configured to determine a plurality of first pixels to be color matched in an initial image;
[0075] a conversion unit configured to convert the color values of the plurality of first pixels in a preset color space according to the color difference characteristics of the plurality of first pixels to obtain a plurality of second pixels, so as to generate a target image matching the initial image;
[0076] The color difference features between the plurality of second pixels in the target image correspond to the color difference features between the plurality of first pixels in the initial image.
[0077] Optionally, the determination unit is specifically configured to: divide the initial image into multiple layers according to the type of image elements; determine a layer composed of image elements to be matched in color from the multiple layers as the target layer, and use each pixel in the target layer as the first pixel.
[0078] Optionally, the target layer includes an image layer and / or a text layer.
[0079] Optionally, the conversion unit is specifically configured to: obtain first color values of multiple first pixels in a preset color space; convert the first color values of the multiple first pixels according to a predetermined conversion rule and color difference characteristics of the multiple first pixels to obtain second color values corresponding to the multiple first pixels in the preset color space; and generate a target image according to the second color values of the multiple first pixels.
[0080] Optionally, the initial image includes an image layer and / or a text layer.
[0081] Based on this, when the conversion unit obtains the first color value of each first pixel in a preset color space, it is specifically configured as follows: for multiple first pixels in the image layer and / or text layer, the multiple first pixels are converted into a preset color space to obtain the first color values corresponding to the multiple first pixels.
[0082] The first color value includes any one or more of first hue values, saturation, and brightness of a plurality of first pixels in a preset color space.
[0083] Optionally, the color difference feature includes a hue difference relationship; the first color value includes a first hue value of a plurality of first pixels in a preset color space, and the second color value includes a second hue value of a plurality of first pixels in a preset color space.
[0084] Based on this, when the conversion unit converts the first color values of multiple first pixels according to a predetermined conversion rule and the color difference characteristics of multiple first pixels to obtain the second color values corresponding to the multiple first pixels in a predetermined color space, the conversion unit is specifically configured as follows: for the multiple first pixels in the image layer, obtain the hue adjustment parameter; and use the difference between the first hue value corresponding to the multiple first pixels in the initial image and the hue adjustment parameter as the second hue value corresponding to the multiple first pixels.
[0085] Furthermore, when the conversion unit generates a target image based on the second color value, it is specifically configured to: use the second hue values corresponding to the multiple first pixels as the hue values corresponding to the multiple second pixels in the target image, so that the hue difference relationship between the multiple second pixels in the target image is the same as the hue difference relationship between the multiple first pixels in the initial image.
[0086] Optionally, the first color value includes first hue values of a plurality of first pixels in a preset color space.
[0087] Based on this, when the conversion unit converts the first color values of the plurality of first pixels according to the predetermined conversion rule and the color difference characteristics of the plurality of first pixels to obtain the second color values corresponding to the plurality of first pixels in the predetermined color space, the conversion unit is specifically configured as follows:
[0088] According to the second hue values of the plurality of pixels in the image layer, the primary hue value in the image layer is obtained; for the plurality of first pixels in the text layer, the primary hue value is used as the hue value corresponding to the plurality of second pixels in the target image.
[0089] Optionally, the first color value includes saturation and / or brightness of the plurality of first pixels in a preset color space.
[0090] Based on this, the conversion unit is also specifically configured to use the saturation corresponding to multiple first pixels as the saturation corresponding to multiple second pixels in the target image; and / or, use the brightness corresponding to multiple first pixels as the brightness corresponding to multiple second pixels in the target image.
[0091] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0092] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0093] In one possible design, the above Figure 4 The structure of the image color matching device shown can be implemented as an electronic device. Figure 5 As shown, the electronic device may include: a processor 21 and a memory 22. The memory 22 stores executable codes, and when the executable codes are executed by the processor 21, the processor 21 can at least implement the image color matching method provided in the above-mentioned embodiment.
[0094] The structure of the electronic device may further include a communication interface 23 for communicating with other devices or a communication network.
[0095] In addition, the present disclosure also provides a computer-readable storage medium including instructions, wherein the medium stores executable code, and when the executable code is executed by a processor of a wireless router, the processor executes the image color matching method provided in the aforementioned embodiments. Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0096] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, which implements the image color matching method provided in the above embodiments when the computer program / instruction is executed by a processor. The computer program / instruction is implemented by a program running on a terminal or a server.
[0097] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0098] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image color matching method, characterized in that: include: Obtain an initial image to be color matched; Determine a plurality of first pixels to be color matched in the initial image, wherein the plurality of first pixels are screened from the initial image based on visual emphasis; According to the color difference characteristics between the plurality of first pixels, color values of the plurality of first pixels in a preset color space are converted to obtain a plurality of second pixels, so as to generate a target image matching the initial image; wherein the color difference features between the plurality of second pixels in the target image correspond to the color difference features between the plurality of first pixels in the initial image; The method of converting the color values of the multiple first pixels in a preset color space according to the color difference characteristics between the multiple first pixels to obtain multiple second pixels to generate a target image matching the initial image includes: obtaining the first color values of the multiple first pixels in the color space; converting the first color values of the multiple first pixels according to a predetermined conversion rule and the color difference characteristics between the multiple first pixels to obtain the second color values of the multiple first pixels in the color space; generating the target image according to the second color values of the multiple first pixels, wherein the first color value includes any one or more of the first hue value, saturation, and brightness of the multiple first pixels in the color space.
2. The image color matching method according to claim 1, characterized in that: The determining of a plurality of first pixels to be color matched in the initial image comprises: Dividing the initial image into multiple layers according to image element types; A layer composed of image elements to be color matched is determined from the multiple layers as a target layer, and multiple pixels in the target layer are used as first pixels.
3. The image color matching method according to claim 2, characterized in that: The target layer includes an image layer and / or a text layer.
4. The image color matching method according to claim 1, characterized in that: The initial image includes an image layer and / or a text layer; The obtaining first color values of the plurality of first pixels in the color space comprises: For the multiple first pixels in the image layer and / or the text layer, the multiple first pixels are converted into the color space to obtain first color values of the multiple first pixels.
5. The image color matching method according to claim 4, characterized in that: The color difference feature includes a hue difference relationship; the first color value includes a first hue value of the plurality of first pixels in the color space, and the second color value includes a second hue value of the plurality of first pixels in the color space; The converting the first color values of the plurality of first pixels according to a predetermined conversion rule and the color difference characteristics between the plurality of first pixels to obtain the second color values of the plurality of first pixels in the color space includes: For the plurality of first pixels in the image layer, obtaining a hue adjustment parameter; Using the difference between the first hue values of the plurality of first pixels in the initial image and the hue adjustment parameter as the second hue values corresponding to the plurality of first pixels; Generating the target image according to the second color values of the plurality of first pixels comprises: The second hue values corresponding to the multiple first pixels are used as the hue values corresponding to the multiple second pixels in the target image, so that the hue difference relationship between the multiple second pixels in the target image is the same as the hue difference relationship between the multiple first pixels in the initial image.
6. The image color matching method according to claim 4, characterized in that: The first color value comprises a first hue value of the plurality of first pixels in the color space; The converting the first color values of the plurality of first pixels according to a predetermined conversion rule and the color difference characteristics between the plurality of first pixels to obtain the second color values of the plurality of first pixels in the color space includes: Acquire a primary hue value in the image layer according to the second hue values of the plurality of first pixels in the image layer; For the multiple first pixels in the text layer, the primary hue value is used as the hue value corresponding to the multiple second pixels in the target image.
7. The image color matching method according to claim 5 or 6, characterized in that: The first color value includes the saturation and / or brightness of the plurality of first pixels in the color space; the method further includes: Using the saturations corresponding to the plurality of first pixels as the saturations corresponding to the plurality of second pixels in the target image; and / or The brightness corresponding to the plurality of first pixels is used as the brightness corresponding to the plurality of second pixels in the target image.
8. An image color matching device, characterized in that: include: An acquisition unit, configured to acquire an initial image to be color matched; a determining unit configured to determine a plurality of first pixels to be color matched in the initial image, wherein the plurality of first pixels are screened from the initial image based on visual emphasis; a conversion unit configured to convert the color values of the plurality of first pixels in a preset color space according to the color difference characteristics between the plurality of first pixels to obtain a plurality of second pixels, so as to generate a target image matching the initial image; The conversion unit is specifically configured to: obtain first color values of the plurality of first pixels in the color space; convert the first color values of the plurality of first pixels according to a predetermined conversion rule and color difference characteristics between the plurality of first pixels to obtain second color values of the plurality of first pixels in the color space; Generate the target image according to the second color values of the plurality of first pixels, wherein the first color value includes any one or more of the first hue value, saturation, and brightness of the plurality of first pixels in the color space; The color difference characteristics between the plurality of second pixels in the target image correspond to the color difference characteristics between the plurality of first pixels in the initial image.
9. The image color matching device according to claim 8, characterized in that: The determining unit is specifically configured to: Dividing the initial image into multiple layers according to image element types; A layer composed of image elements to be color matched is determined from the multiple layers as a target layer, and multiple pixels in the target layer are used as first pixels.
10. The image color matching device according to claim 9, characterized in that: The target layer includes an image layer and / or a text layer.
11. The image color matching device according to claim 9, characterized in that: The initial image includes an image layer and / or a text layer; When acquiring the first color values of the plurality of first pixels in the color space, the conversion unit is specifically configured as follows: For the multiple first pixels in the image layer and / or the text layer, the multiple first pixels are converted into the color space to obtain first color values of the multiple first pixels.
12. The image color matching device according to claim 11, characterized in that: The color difference feature includes a hue difference relationship; the first color value includes a first hue value of the plurality of first pixels in the color space, and the second color value includes a second hue value of the plurality of first pixels in the color space; When the conversion unit converts the first color values of the plurality of first pixels according to a predetermined conversion rule and the color difference characteristics between the plurality of first pixels to obtain the second color values of the plurality of first pixels in the color space, the conversion unit is specifically configured as follows: For the plurality of first pixels in the image layer, obtaining a hue adjustment parameter; Using the difference between the first hue values of the plurality of first pixels in the initial image and the hue adjustment parameter as the second hue values corresponding to the plurality of first pixels; When the conversion unit generates the target image according to the second color values of the plurality of first pixels, the conversion unit is specifically configured as follows: The second hue values corresponding to the multiple first pixels are used as the hue values corresponding to the multiple second pixels in the target image, so that the hue difference relationship between the multiple second pixels in the target image is the same as the hue difference relationship between the multiple first pixels in the initial image.
13. The image color matching device according to claim 11, characterized in that: The first color value comprises a first hue value of the plurality of first pixels in the color space; When the conversion unit converts the first color values of the plurality of first pixels according to a predetermined conversion rule and the color difference characteristics between the plurality of first pixels to obtain the second color values of the plurality of first pixels in the color space, the conversion unit is specifically configured as follows: Acquire a primary hue value in the image layer according to the second hue values of the plurality of first pixels in the image layer; For the multiple first pixels in the text layer, the primary hue value is used as the hue value corresponding to the multiple second pixels in the target image.
14. The image color matching device according to claim 12 or 13, characterized in that: The first color value includes the saturation and / or brightness of the plurality of first pixels in the color space; the conversion unit is further specifically configured to: Using the saturations corresponding to the plurality of first pixels as the saturations corresponding to the plurality of second pixels in the target image; and / or The brightness corresponding to the plurality of first pixels is used as the brightness corresponding to the plurality of second pixels in the target image.
15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image color matching method as described in any one of claims 1 to 7. 16 . A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute the image color matching method according to any one of claims 1 to 7.
17. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the image color matching method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image data processing method and device and computer equipment
CN112927314A