A color recommendation method, device, equipment and storage medium

By comparing with the standard colors in the color library, determining and recommending the corresponding colors of the sample colors in the uploaded pictures by users, the problems of inconsistency and high maintenance costs caused by the lack of global color management in the prior art are solved, and the standardization of the color library and efficient utilization of resources are achieved.

CN114299170BActive Publication Date: 2025-04-08BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111494048.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-04-08
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

The lack of a global color management mechanism in the prior art has led to a large number of similar and inconsistent colors in the application, and the color resource reuse rate is low, which increases the cost of color maintenance.

Method used

By receiving the sample pictures uploaded by the user, the sample colors in the sample pictures are extracted, and their feature information is compared with the feature information of each standard color in the color library to generate comparison results. When the comparison result is less than or equal to the preset threshold, the corresponding color of the sample color is determined and the color is recommended to the user.

Benefits of technology

Instead of manually identifying similar colors, improve the convergence of standard colors in the color library, standardize the precipitation of colors, avoid the entry of repeated and forked colors, and reduce the cost of color management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299170B_ABST
    Figure CN114299170B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a color recommendation method, device, equipment and storage medium, and relates to the field of computer technology. The embodiments of the present disclosure at least solve the problem of high color management cost in the related art. The method includes: receiving a sample picture uploaded by a user, and extracting a sample color in the sample picture; extracting feature information of the sample color, and comparing the feature information of the sample color with the feature information of each standard color in the color library to generate a comparison result; when the comparison result of the feature information of the sample color with the feature information of at least one standard color in the color library is less than or equal to a preset threshold, the corresponding color of the sample color is determined according to at least one standard color; and the corresponding color is recommended to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a color recommendation method, device, equipment and storage medium. Background Art

[0002] During the development and design of an application (APP), APP developers will upload the colors they need to consume to the color library, and the color library will update the colors uploaded by the developer to the color resource warehouse GIT. Furthermore, when developers are writing code, they can add the color values ​​they need to consume to the code. Later, when the APP is displaying the user interface (UI), it can directly obtain the corresponding colors from GIT for display.

[0003] However, when using the above method, due to the lack of a global color management mechanism in the application, a large number of similar and inconsistent colors and a low reuse rate of color resources will appear, which increases the cost of color maintenance. Summary of the invention

[0004] The present disclosure provides a color recommendation method, device, equipment and storage medium to at least solve the problem of high color maintenance cost in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a color recommendation method is provided, comprising: receiving a sample image uploaded by a user, and extracting a sample color in the sample image; extracting feature information of the sample color, and comparing the feature information of the sample color with feature information of each standard color in a color library to generate a comparison result; when a comparison result of the feature information of the sample color with feature information of at least one standard color in the color library is less than or equal to a preset threshold, determining a corresponding color of the sample color based on at least one standard color; and recommending the corresponding color to the user.

[0006] Optionally, the extracting characteristic information of the sample color includes: extracting the characteristic information of the sample color when the sample color does not exist in the color library.

[0007] Optionally, the above method also includes: when there is a sample color in the color library, or when there is no corresponding color in the color library, or when the user has not consumed the corresponding color, a color identifier corresponding to the sample color is generated, and the color identifier and the sample color are updated to the color resource warehouse GIT; the GIT stores a mapping relationship between standard colors and color identifiers; the color identifier is used to provide a basis for the user to request consumption of the sample color.

[0008] Optionally, the above method also includes: displaying an image upload page including a color type selection box; the color type selection box is used to indicate the color type of the sample color in the sample image, the color type including RGB color and RGBA color; in response to the user's selection operation on the color type selection box, determining the color type of the sample color.

[0009] Optionally, the determining a corresponding color of the sample color based on at least one standard color includes: determining a standard color having a minimum comparison result among the at least one standard color as the corresponding color.

[0010] Optionally, the above-mentioned comparison of the characteristic information of the sample color with the characteristic information of each standard color in the color library to generate a comparison result includes: when the sample color is RGB color, converting the characteristic information of the sample color and the characteristic information of each standard color into a Lab color model; based on the converted Lab color model and the preset CIEDE2000 color difference formula, determining the color difference between the sample color and each standard color as the comparison result.

[0011] Optionally, the above-mentioned comparison of the characteristic information of the sample color with the characteristic information of each standard color in the color library generates a comparison result, including: when the sample color is an RGBA color, based on the characteristic information of the sample color, the characteristic information of each standard color and a preset square difference formula, determining the color difference between the sample color and each standard color as the comparison result; the square difference formula is used to determine the color difference between colors based on the transparency value.

[0012] Optionally, when the sample color is an RGBA color, the color difference between the sample color and each standard color satisfies the following formula:

[0013] △S=max[(r1-r2) 2 ,(r1-r2-a1+a2) 2 ]+max[(g1-g2) 2 ,(g1-g2-a1+a2) 2 ]

[0014] +max[(b1-b2) 2 ,(b1-b2-a1+a2) 2 ]

[0015] Among them, △S is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color.

[0016] According to a second aspect of an embodiment of the present disclosure, a color recommendation device is provided, including a receiving unit, an extracting unit, a generating unit, a determining unit and a recommending unit; the receiving unit is used to receive a sample image uploaded by a user; the extracting unit is used to extract a sample color in the sample image; the extracting unit is also used to extract feature information of the sample color; the generating unit is used to compare the feature information of the sample color with the feature information of each standard color in a color library to generate a comparison result; the determining unit is used to determine a corresponding color of the sample color according to at least one standard color when a comparison result between the feature information of the sample color and the feature information of at least one standard color in the color library is less than or equal to a preset threshold; and the recommending unit is used to recommend the corresponding color to the user.

[0017] Optionally, the extraction unit is specifically used to extract feature information of the sample color when the sample color does not exist in the color library.

[0018] Optionally, the above-mentioned device also includes an updating unit; a generating unit is also used to generate a color identifier corresponding to the sample color when there is a sample color in the color library, or when there is no corresponding color in the color library, or when the user has not consumed the corresponding color; the color identifier is used to provide a basis for the user to request consumption of the sample color; the updating unit is used to update the color identifier and the sample color to the color resource warehouse GIT; the GIT stores the mapping relationship between standard colors and color identifiers.

[0019] Optionally, the above-mentioned device also includes a display unit; the display unit is used to display a picture upload page including a color type selection box; the color type selection box is used to indicate the color type of the sample color in the sample picture, and the color type includes RGB color and RGBA color; the determination unit is also used to determine the color type of the sample color in response to the user's selection operation on the color type selection box.

[0020] Optionally, the above-mentioned determination unit is specifically used to: determine the standard color with the smallest comparison result among at least one standard color as the corresponding color.

[0021] Optionally, the above-mentioned generation unit is specifically used to: when the sample color is RGB color, convert the characteristic information of the sample color and the characteristic information of each standard color into a Lab color model; based on the converted Lab color model and the preset CIEDE2000 color difference formula, determine the color difference between the sample color and each standard color as the comparison result.

[0022] Optionally, the above-mentioned generation unit is specifically used to: when the sample color is RGBA color, based on the characteristic information of the sample color, the characteristic information of each standard color and a preset square difference formula, determine the color difference between the sample color and each standard color as a comparison result; the square difference formula is used to determine the color difference between colors based on the transparency value.

[0023] Optionally, when the sample color is an RGBA color, the color difference between the sample color and each standard color satisfies the following formula:

[0024] △S=max[(r1-r2) 2 ,(r1-r2-a1+a2) 2 ]+max[(g1-g2) 2 ,(g1-g2-a1+a2) 2 ]+max[(b1-b2) 2 ,(b1-b2-a1+a2) 2 ]

[0025] Among them, △S is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color.

[0026] According to a third aspect of an embodiment of the present disclosure, a server is provided, comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement a color recommendation method as provided in the first aspect and any possible design thereof.

[0027] 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 a processor of a server, the server is enabled to execute the color recommendation method provided by the first aspect and any possible design thereof.

[0028] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes computer instructions. When the computer instructions are executed on a server, the server executes the color recommendation method provided by the first aspect and any possible design thereof.

[0029] The technical solution provided by the above embodiment has at least the following beneficial effects: based on the sample picture uploaded by the user, the sample color in the sample picture is obtained, and further the characteristic information of the sample color is compared with the characteristic information of each standard color in the color library to obtain the comparison result. Furthermore, when there is at least one standard color whose corresponding comparison result is less than or equal to the preset threshold, the corresponding color of the sample color is determined from at least one standard color, and the sample color is recommended to the user. In this way, it can replace the manual identification of similar colors, improve the convergence of standard colors in the color library, facilitate the precipitation of standardized colors in the color library, avoid the entry of repeated and bifurcated colors, and improve the cost of color management.

[0030] 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

[0031] 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.

[0032] Figure 1 is a structural schematic diagram of a color recommendation system according to an exemplary embodiment;

[0033] Figure 2 is one of the flowchart diagrams of a color recommendation method according to an exemplary embodiment;

[0034] Figure 3 is a second flowchart diagram of a color recommendation method according to an exemplary embodiment;

[0035] Figure 4 is a third flowchart of a color recommendation method according to an exemplary embodiment;

[0036] Figure 5 is a fourth flowchart of a color recommendation method according to an exemplary embodiment;

[0037] Figure 6 is a schematic structural diagram of a color recommendation device according to an exemplary embodiment;

[0038] Figure 7The figure is a schematic diagram showing the structure of a server according to an exemplary embodiment. DETAILED DESCRIPTION

[0039] 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.

[0040] 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.

[0041] In addition, in the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present disclosure, "multiple" means two or more than two.

[0042] The color recommendation method provided by the embodiment of the present disclosure may be applicable to a color recommendation system. Figure 1 Show Figure 1 A schematic diagram of the structure of the color recommendation system is shown in FIG. Figure 1 As shown, the color recommendation system 10 is used to solve the problem of high color management cost in the related art. The color recommendation system 10 includes a color recommendation device 11 and a server 12. The color recommendation device 11 is connected to the server 12. The color recommendation device 11 and the server 12 can be connected in a wired manner or in a wireless manner, which is not limited in the embodiment of the present disclosure.

[0043] The server 12 is used to receive sample colors uploaded by users and send the sample colors to the color recommendation device.

[0044] Meanwhile, the server 12 also includes a preset color library, which includes a plurality of standard colors.

[0045] It should be noted that the standard color is obtained by the server by converging the similarity of the colors uploaded by users in a historical time period.

[0046] The color recommendation device 11 may be used to perform data interaction with the server 12 . For example, the color recommendation device 11 may obtain sample colors uploaded by a user and standard colors in a color library from the server 12 .

[0047] The color recommendation device 11 can also execute the color recommendation method in the embodiment of the present disclosure, for example, by determining the color difference between the sample color and each standard color, and judging whether there is a corresponding color of the sample color in the color library based on the determined color difference, and recommending the corresponding color to the user.

[0048] Meanwhile, the server 12 also includes a color resource repository GIT, which stores a mapping relationship between standard colors and color identifiers.

[0049] For example, when the user is writing the process code of the APP, the color identifier can be directly written into the code. Furthermore, when the APP is running, the standard color corresponding to the color identifier can be directly obtained from GIT.

[0050] It should be noted that the color recommendation device 11 and the server 12 may be independent devices or integrated into the same device, and the present invention does not make any specific limitation to this.

[0051] When the color recommendation device 11 and the server 12 are integrated into the same device, the communication between the color recommendation device 11 and the server 12 is the communication between the internal modules of the device. In this case, the communication process between the two is the same as the communication process between the color recommendation device 11 and the server 12 when they are independent of each other.

[0052] In the following embodiments provided by the present invention, the present invention is described by taking the case where the color recommendation device 11 and the server 12 are independently configured.

[0053] In practical applications, the color recommendation method provided in the embodiment of the present invention can be applied to a color recommendation device or a server. The color recommendation method provided in the embodiment of the present invention is described below by taking the application of the color recommendation method to a server as an example in conjunction with the accompanying drawings.

[0054] like Figure 2 As shown, the color recommendation method provided by the embodiment of the present disclosure includes the following S201-S206.

[0055] S201. The server receives a sample image uploaded by a user.

[0056] As a possible implementation, the server displays a picture upload page, and the user can select to input a sample picture in the picture upload box of the picture upload page and click the sample picture upload control. Accordingly, the server receives the sample picture uploaded by the user.

[0057] S202: The server extracts sample colors from the sample image.

[0058] The color type of the sample color can be RGB color or RGBA color.

[0059] As a possible implementation manner, the server may obtain the sample color from the sample image based on a preset extraction program.

[0060] The specific implementation method of this step can refer to the existing technology and will not be described in detail here.

[0061] S203: The server extracts characteristic information of the sample color.

[0062] As a possible implementation manner, after obtaining the sample color, the server obtains feature information of the sample color.

[0063] It should be noted that the characteristic information of the sample color may be the color value of the sample color.

[0064] For the specific implementation of this step, please refer to the subsequent description of the embodiment of the present disclosure, which will not be repeated here.

[0065] S204: The server compares the characteristic information of the sample color with the characteristic information of each standard color in the color library to generate a comparison result.

[0066] The color library includes color values ​​of multiple standard colors, and the characteristic information of each standard color is the color value of the standard color.

[0067] As a possible implementation, the server determines the color type of the sample color, and based on different color types, uses different color difference calculation steps to determine the color difference between the sample color and each standard color, and uses the determined color difference as the comparison result.

[0068] For the specific implementation of this step, please refer to the subsequent description of the embodiment of the present disclosure, which will not be repeated here.

[0069] It should be noted that each standard color is obtained by converging multiple colors according to the similarity between color values ​​by the server.

[0070] S205: When a comparison result between the characteristic information of the sample color and the characteristic information of at least one standard color in the color library is less than or equal to a preset threshold, the server determines a corresponding color of the sample color according to the at least one standard color.

[0071] As a possible implementation, the server determines whether there is at least one color difference less than or equal to a preset threshold value among the determined color differences. If there is at least one color difference less than or equal to the preset threshold value, the server determines the standard color corresponding to the at least one color difference as the corresponding color of the sample color.

[0072] It should be noted that the preset threshold may be a threshold set in advance in the server by the operation and maintenance personnel of the color recommendation system, or may be a threshold generated by the server based on the determined color difference.

[0073] As another possible implementation, the server sorts the determined color differences from small to large, and selects the standard colors corresponding to the first n smallest color differences as the corresponding colors of the sample colors.

[0074] In this case, the nth color difference is the preset threshold. n can be preset by the operation and maintenance personnel, for example, n can be 5.

[0075] S206: The server recommends a corresponding color to the user.

[0076] As a possible implementation manner, the server sends characteristic information of the corresponding color or a color identifier of the corresponding color to the user's device.

[0077] It should be noted that the color identifier can be used to uniquely identify a corresponding color.

[0078] The technical solution provided by the above embodiment has at least the following beneficial effects: based on the sample picture uploaded by the user, the sample color in the sample picture is obtained, and further the characteristic information of the sample color is compared with the characteristic information of each standard color in the color library to obtain the comparison result. Furthermore, when there is at least one standard color whose corresponding comparison result is less than or equal to the preset threshold, the corresponding color of the sample color is determined from at least one standard color, and the sample color is recommended to the user. In this way, it can replace the manual identification of similar colors, improve the convergence of standard colors in the color library, facilitate the precipitation of standardized colors in the color library, avoid the entry of repeated and bifurcated colors, and improve the cost of color management.

[0079] In one design, Figure 3 As shown, the color recommendation method provided by the embodiment of the present disclosure further includes the following S207:

[0080] S207: The server determines whether there is a sample color in the color library.

[0081] As a possible implementation, the server determines whether the sample color exists in the multiple standard colors included in the color library based on the characteristic information of the sample color. If the characteristic information of any standard color in the color library is the same as the characteristic information of the sample color, the server determines that the sample color exists in the color library. If the characteristic information of each standard color in the color library is different from the characteristic information of the sample color, the server determines that the sample color does not exist in the color library.

[0082] After S207, the above S203 provided in the embodiment of the present disclosure may specifically include the following S2031.

[0083] S2031. When the sample color does not exist in the color library, the server extracts feature information of the sample color.

[0084] In another case, if the sample color exists in the color library, the server directly obtains the characteristic information of the sample color from the color library.

[0085] The technical solution provided by the above embodiment has at least the following beneficial effects: when the sample color does not exist in the color library, the sample color feature information is extracted. In this way, when the sample color does not exist in the color library, an implementation method for obtaining the feature information of the sample color is provided, thereby ensuring that the subsequent comparison results can be obtained.

[0086] In one design, when developers write code, they insert color values ​​into the code. When making global changes or replacements, they need to modify each color value, which is inefficient. Therefore, in order to improve the work efficiency of developers, Figure 3 As shown, the color recommendation method provided by the embodiment of the present disclosure also includes the following S208-S209.

[0087] S208: If the sample color exists in the color library, or the corresponding color does not exist in the color library, or the user has not consumed the corresponding color, the server generates a color identifier corresponding to the sample color.

[0088] The color identifier is used to provide a basis for users to request consumption sample colors.

[0089] In one case, when there is any standard color in the color library whose color value is the same as the color value of the sample color, the server determines that the sample color exists in the color library.

[0090] In another case, if, in the determined comparison results, there is no color difference that is less than or equal to the preset threshold, the server determines that there is no corresponding color in the color library.

[0091] In the third case, after the server recommends the corresponding color to the user, if the user still initiates a request to consume the sample color, the server determines that the user has not consumed the corresponding color.

[0092] In either case, the server generates a color identifier corresponding to the sample color.

[0093] It should be noted that the sample colors correspond to the color identifiers one by one.

[0094] S209: The server updates the color identifier and the sample color to the color resource repository GIT.

[0095] The GIT stores a mapping relationship between standard colors and color identifiers.

[0096] As a possible implementation, the server updates the sample color as a new standard color to the GIT. At the same time, the server also updates the color identifier corresponding to the new standard color to the GIT.

[0097] The technical solution provided by the above embodiment has at least the following beneficial effects: when a color identifier is used to uniquely identify the corresponding color, when developers are writing code, they can replace the color value with the color identifier and insert it into the code. At the same time, when global modification or replacement is required, the color identifier can be directly modified or replaced, which can greatly improve the work efficiency of developers. At the same time, the above technical means can also open up the design and development process, implement color design specifications, avoid developers from using any color at will, and standardize the use of APP colors.

[0098] In one design, in order to be able to determine the color type of the sample color in the sample image uploaded by the user, such as Figure 4 As shown, the color recommendation method provided by the embodiment of the present disclosure further includes the following S301-S302.

[0099] S301. The server displays a picture upload page including a color type selection box.

[0100] The color type selection box is used to indicate the color type of the sample color in the sample image, and the color type includes RGB color and RGBA color.

[0101] As a possible implementation, the server displays a color type selection box while displaying the image upload box and the image upload control on the image upload page.

[0102] S302: The server determines a sample type of the sample color in response to a user's selection operation on a color type selection box.

[0103] As a possible implementation manner, the server determines the selection result in the color type selection box as the sample type of the sample color in response to the user's selection operation on the color type selection box.

[0104] The technical solution provided by the above embodiment has at least the following beneficial effects: by adopting the above technical means, it is possible to provide an implementation method for determining the color type of the sample color of the sample picture uploaded by the user.

[0105] In one design, in order to improve the accuracy of the determined corresponding color, the above S205 provided in the embodiment of the present disclosure specifically includes the following S2051:

[0106] S2051. The server determines the standard color with the smallest comparison result among at least one standard color as the corresponding color.

[0107] The technical solution provided by the above embodiment has at least the following beneficial effects: the comparison result is the smallest, that is, the smaller the color difference between the determined standard color and the sample color is, the closer it is to the sample color. In this way, the standard color with the smallest color difference is used as the corresponding color of the sample color, which can make the determined corresponding color closest to the sample color, thereby improving the accuracy of the corresponding color.

[0108] In one design, since the color types of the sample color include RGB and RGBA, and different color types require different execution steps for determining the color difference, in order to determine the color difference between the sample color and the standard color, such as Figure 5 As shown, S204 provided in the embodiment of the present disclosure may specifically include S2041-S2042.

[0109] S2041. When the sample color is an RGB color, the server converts the characteristic information of the sample color and the characteristic information of each standard color into a Lab color model.

[0110] As a possible implementation manner, the server converts the sample color, the first color value, the second color value, and the third color value in the RGB color value of each standard color into the Lab sample mode according to a preset conversion method.

[0111] The specific implementation method of this step can refer to the specific description in the prior art and will not be repeated here.

[0112] S2042: The server determines the color difference between the sample color and each standard color as a comparison result based on the converted Lab color model and the preset CIEDE2000 color difference formula.

[0113] In some embodiments, when the color difference between the sample color and the standard color is calculated based on the damaged CIEDE2000 color difference formula, the color difference between the sample color and the standard color satisfies the following formula:

[0114]

[0115] in, is the color difference between the sample color and the standard color, is the brightness of the sample color, are the color channels of the sample color, is the brightness of the standard color, are the color channels of the standard colors, △L' is the brightness difference, △C' is the chroma difference, △H' is the hue difference, k L , k C , k H are the preset parameter factors, S C , S L , S H are weight functions for correcting the uniformity of color control, R T It is a rotation function used to correct the deflection of the major axis direction of the blue area tolerance ellipse of the color space.

[0116] The following is a specific formula used to determine the parameters in the above formula 1:

[0117]

[0118] Among them, when i=1, is the chroma of the sample color. When i=2, The chroma of the standard color.

[0119]

[0120] in, It is the average chroma of the sample color and the standard color.

[0121]

[0122] Wherein, G is the adjustment factor of the a* axis of the color space.

[0123]

[0124] Among them, a' i The alpha parameter that modifies the color according to the adjustment factor G.

[0125]

[0126] In the case of i=1, C i' is the average chroma of the sample color. In the case of i = 2, C i ' is the average chroma of the standard color.

[0127]

[0128] Among them, h' i To correct the hue, use Measurement on a 2D plane Angular position relative to the positive a-axis.

[0129]

[0130] △C'=C'2-C'1 Formula 9

[0131]

[0132] Among them, △h' is the corrected hue difference.

[0133]

[0134]

[0135]

[0136]

[0137] in, It is the arithmetic mean of the corrected hue.

[0138]

[0139] Where T is a function of the hue angle.

[0140]

[0141] Here, θ is the rotation angle determined by the hue.

[0142]

[0143]

[0144]

[0145]

[0146] R T =-sin(2△θ)R C Formula 21

[0147] Among them, R TIt is a rotation function used to correct the deflection of the major axis direction of the blue area tolerance ellipse of the color space.

[0148] In this step, the specific implementation of the CIEDE2000 color difference formula can be referred to the specific description in the prior art, which will not be repeated here.

[0149] As another possible implementation, when the sample color is an RGB color, the server may also determine the color difference between the sample color and each standard color based on the converted Lab color model and a preset CIELAB color difference formula.

[0150] The technical solution provided by the above embodiment has at least the following beneficial effects: the use of the CIEDE2000 color difference formula can not only reflect the color difference between the sample color and the standard color, but also make the color difference calculation result consistent with the visual judgment of the human eye, thereby ensuring the accuracy of the recommendation result.

[0151] In one design, when the sample color uploaded by the user is RGBA color, since the above CIEDE2000 color difference formula cannot be well adapted to RGBA color, in order to determine the color difference between RGBA colors, S204 provided in the embodiment of the present disclosure may further include the following S2043.

[0152] S2043. When the sample color is an RGBA color, the server determines the color difference between the sample color and each standard color as a comparison result based on the feature information of the sample color, the feature information of each standard color, and a preset square difference formula.

[0153] Here, the squared difference formula is used to determine the color difference between colors based on the transparency value.

[0154] As a possible implementation manner, the server obtains feature information of the sample color and feature information of the standard color, and calculates the color difference between the sample color and each standard color based on the obtained feature information and a preset square difference formula.

[0155] In some embodiments, when the sample color is an RGBA color, the color difference between the sample color and each standard color satisfies the following formula:

[0156]

[0157] Among them, △S is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color.

[0158] Exemplarily, the first color value may be red, the second color value may be blue, and the third color value may be green.

[0159] The technical solution provided by the above embodiment has at least the following beneficial effects: for RGBA color, a method for calculating the color difference of RGBA with transparency is provided. At the same time, since the transparency value is integrated into the above formula, the accuracy of the color difference calculation of RGBA color can be ensured.

[0160] Figure 6 FIG. 1 is a schematic diagram showing a structure of a color recommendation device according to an exemplary embodiment. Figure 6 As shown, the color recommendation device 40 provided by the embodiment of the present disclosure includes a receiving unit 401 , an extracting unit 402 , a generating unit 403 , a determining unit 404 and a recommending unit 405 .

[0161] The receiving unit 401 is used to receive sample images uploaded by users.

[0162] The extraction unit 402 is used to extract the sample color in the sample image.

[0163] The extraction unit 402 is also used to extract characteristic information of the sample color.

[0164] The generating unit 403 is used to compare the characteristic information of the sample color with the characteristic information of each standard color in the color library to generate a comparison result.

[0165] The determination unit 404 is configured to determine a corresponding color of the sample color according to the at least one standard color when a comparison result between the characteristic information of the sample color and the characteristic information of at least one standard color in the color library is less than or equal to a preset threshold.

[0166] The recommendation unit 405 is used to recommend corresponding colors to the user.

[0167] Optional, such as Figure 6 As shown, the extraction unit 402 provided in the embodiment of the present disclosure is specifically used for:

[0168] When the sample color does not exist in the color library, feature information of the sample color is extracted.

[0169] Optional, such as Figure 6 As shown, the device 40 provided by the embodiment of the present disclosure also includes an updating unit 406.

[0170] The generating unit 403 is further configured to generate a color identifier corresponding to the sample color when the sample color exists in the color library, or when the corresponding color does not exist in the color library, or when the user has not consumed the corresponding color. The color identifier is used to provide a basis for the user to request the consumption of the sample color.

[0171] The updating unit 406 is used to update the color identifier and the sample color to the color resource repository GIT. The GIT stores the mapping relationship between the standard color and the color identifier.

[0172] Optional, such as Figure 6 As shown, the device 40 provided in this embodiment of the present disclosure also includes a display unit 407.

[0173] The display unit 407 is used to display a picture upload page including a color type selection box. The color type selection box is used to indicate the color type of the sample color in the sample picture, and the color type includes RGB color and RGBA color.

[0174] The determination unit 404 is further configured to determine the color type of the sample color in response to a user's selection operation on the color type selection box.

[0175] Optional, such as Figure 6 As shown, the determination unit 404 provided in the embodiment of the present disclosure is specifically used for:

[0176] The standard color with the smallest comparison result among at least one standard color is determined as the corresponding color.

[0177] Optional, such as Figure 6 As shown, the generation unit 403 provided in the embodiment of the present disclosure is specifically used for:

[0178] When the sample color is an RGB color, the feature information of the sample color and the feature information of each standard color are converted into a Lab color model.

[0179] Based on the converted Lab color model and the preset CIEDE2000 color difference formula, the color difference between the sample color and each standard color is determined as the comparison result.

[0180] Optional, such as Figure 6 As shown, the generation unit 403 provided in the embodiment of the present disclosure is specifically used for:

[0181] When the sample color is an RGBA color, the color difference between the sample color and each standard color is determined as a comparison result based on the characteristic information of the sample color, the characteristic information of each standard color, and a preset square difference formula. The square difference formula is used to determine the color difference between colors based on the transparency value.

[0182] Optional, such as Figure 6 As shown, in the device 40 provided by the embodiment of the present disclosure, when the sample color is RGBA color, the color difference between the sample color and each standard color satisfies the following formula:

[0183] △S=max[(r1-r2) 2 ,(r1-r2-a1+a2) 2 ]+max[(g1-g2) 2 ,(g1-g2-a1+a2) 2 ]+max[(b1-b2) 2 ,(b1-b2-a1+a2) 2 ]

[0184] Among them, △S is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color.

[0185] 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.

[0186] Figure 7 Schematic diagram of the structure of a server provided by the present disclosure. Figure 7 The server 50 may include at least one processor 501 and a memory 503 for storing processor executable instructions. The processor 501 is configured to execute instructions in the memory 503 to implement the color recommendation method in the above embodiment.

[0187] In addition, the server 50 may further include a communication bus 502 and at least one communication interface 504 .

[0188] The processor 501 may be a central processing unit (CPU), a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution.

[0189] Communication bus 502 may include a pathway for transmitting information between the above-mentioned components.

[0190] The communication interface 504 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0191] The memory 503 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory may be independent and connected to the processing unit via a bus. The memory may also be integrated with the processing unit.

[0192] The memory 503 is used to store instructions for executing the solution of the present disclosure, and the execution is controlled by the processor 501. The processor 501 is used to execute the instructions stored in the memory 503, so as to realize the functions in the method of the present disclosure.

[0193] As an example, combining Figure 6 The functions implemented by the receiving unit 401, the extracting unit 402, the generating unit 403, the determining unit 404, the recommending unit 405, the updating unit 406 and the displaying unit 407 in the color recommendation device 40 are similar to those implemented by the receiving unit 401, the extracting unit 402, the generating unit 403, the determining unit 404, the recommending unit 405, the updating unit 406 and the Figure 7 The function of processor 501 in is the same.

[0194] In a specific implementation, as an embodiment, the processor 501 may include one or more CPUs, such as Figure 7 CPU0 and CPU1 in.

[0195] In a specific implementation, as an embodiment, the server 50 may include multiple processors, such as Figure 7 501 and processor 507 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0196] In a specific implementation, as an embodiment, the server 50 may further include an output device 505 and an input device 506. The output device 505 communicates with the processor 501 and may display information in a variety of ways. For example, the output device 505 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 506 communicates with the processor 501 and may receive user input in a variety of ways. For example, the input device 506 may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0197] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the server 50, and the server 50 may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0198] In addition, the present disclosure also provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of a server, the server can execute the color recommendation method provided in the above embodiment.

[0199] In addition, the present disclosure also provides a computer program product, including computer instructions. When the computer instructions are executed on a server, the server executes the color recommendation method provided in the above embodiment.

[0200] 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 claims.

Claims

1. A color recommendation method, characterized in that: include: Receive a sample image uploaded by a user, and extract a sample color from the sample image; Extracting characteristic information of the sample color, and comparing the characteristic information of the sample color with characteristic information of each standard color in a color library to generate a comparison result, including: when the sample color is an RGBA color, based on the characteristic information of the sample color, characteristic information of each standard color and a preset square difference formula, determining the color difference between the sample color and each standard color as the comparison result; the square difference formula is used to determine the color difference between colors based on a transparency value; When a comparison result between the characteristic information of the sample color and the characteristic information of at least one standard color in the color library is less than or equal to a preset threshold, determining a corresponding color of the sample color according to the at least one standard color; The corresponding color is recommended to the user.

2. The color recommendation method according to claim 1, characterized in that: The step of extracting characteristic information of the sample color includes: When the sample color does not exist in the color library, feature information of the sample color is extracted.

3. The color recommendation method according to claim 1, characterized in that: The method further comprises: If the sample color exists in the color library, or the corresponding color does not exist in the color library, or the user has not consumed the corresponding color, a color identifier corresponding to the sample color is generated, and the color identifier and the sample color are updated to the color resource warehouse GIT; the GIT stores a mapping relationship between standard colors and color identifiers; the color identifier is used to provide a basis for the user to request consumption of the sample color.

4. The color recommendation method according to claim 1, characterized in that: The method further comprises: Displaying a picture upload page including a color type selection box; the color type selection box is used to indicate the color type of the sample color in the sample picture, and the color type includes RGB color and RGBA color; In response to the user's selection operation on the color type selection box, the color type of the sample color is determined.

5. The color recommendation method according to claim 1, characterized in that: The step of determining a color corresponding to the sample color according to the at least one standard color comprises: The standard color with the smallest comparison result among the at least one standard color is determined as the corresponding color.

6. The color recommendation method according to any one of claims 1 to 5, characterized in that: The step of comparing the characteristic information of the sample color with the characteristic information of each standard color in the color library to generate a comparison result includes: When the sample color is an RGB color, the characteristic information of the sample color and the characteristic information of each standard color are converted into a Lab color model; Based on the converted Lab color model and the preset CIEDE2000 color difference formula, the color difference between the sample color and each standard color is determined as the comparison result.

7. The color recommendation method according to claim 1, characterized in that: When the sample color is an RGBA color, the color difference between the sample color and each standard color satisfies the following formula: ΔS=max[(r1-r2) 2 ,(r1-r2-a1+a2) 2 ]+max[(g1-g2) 2 ,(g1-g2-a1+a2) 2 ]+max[(b1-b2) 2 ,(b1-b2-a1+a2) 2 ] Among them, ΔS is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color; the first color value, the second color value and the third color value are three different colors in the standard colors.

8. A color recommendation device, characterized in that: It includes a receiving unit, an extracting unit, a generating unit, a determining unit and a recommending unit; The receiving unit is used to receive sample pictures uploaded by users; The extraction unit is used to extract the sample color in the sample image, including: when the sample color is an RGBA color, based on the feature information of the sample color, the feature information of each standard color and a preset square difference formula, determining the color difference between the sample color and each standard color as the comparison result; the square difference formula is used to determine the color difference between colors based on the transparency value; The extraction unit is further used to extract characteristic information of the sample color; The generating unit is used to compare the characteristic information of the sample color with the characteristic information of each standard color in the color library to generate a comparison result; The determining unit is configured to determine a corresponding color of the sample color according to the at least one standard color when a comparison result between the characteristic information of the sample color and the characteristic information of at least one standard color in the color library is less than or equal to a preset threshold; The recommendation unit is used to recommend the corresponding color to the user.

9. The color recommendation device according to claim 8, characterized in that: The extraction unit is specifically used for: When the sample color does not exist in the color library, feature information of the sample color is extracted.

10. The color recommendation device according to claim 8, characterized in that: The device also includes an updating unit; The generating unit is further configured to generate a color identifier corresponding to the sample color when the sample color exists in the color library, or when the corresponding color does not exist in the color library, or when the user has not consumed the corresponding color; the color identifier is used to provide a basis for the user to request consumption of the sample color; The updating unit is used to update the color identification and the sample color into a color resource repository GIT; the GIT stores a mapping relationship between standard colors and color identifications.

11. The color recommendation device according to claim 8, characterized in that: The device also includes a display unit; The display unit is used to display a picture upload page including a color type selection box; the color type selection box is used to indicate the color type of the sample color in the sample picture, and the color type includes RGB color and RGBA color; The determining unit is further configured to determine the color type of the sample color in response to the user's selection operation on the color type selection box.

12. The color recommendation device according to claim 8, characterized in that: The determining unit is specifically configured to: The standard color with the smallest comparison result among the at least one standard color is determined as the corresponding color.

13. The color recommendation device according to any one of claims 8 to 12, characterized in that: The generating unit is specifically used for: When the sample color is an RGB color, the characteristic information of the sample color and the characteristic information of each standard color are converted into a Lab color model; Based on the converted Lab color model and the preset CIEDE2000 color difference formula, the color difference between the sample color and each standard color is determined as the comparison result.

14. The color recommendation device according to claim 8, characterized in that: When the sample color is an RGBA color, the color difference between the sample color and each standard color satisfies the following formula: ΔS=max[(r1-r2) 2 ,(r1-r2-a1+a2) 2 ]+max[(g1-g2) 2 ,(g1-g2-a1+a2) 2 ]+max[(b1-b2) 2 ,(b1-b2-a1+a2) 2 ] Among them, ΔS is the color difference between the sample color and each standard color, r1 is the first color value in the characteristic information of the sample color, r2 is the first color value in the characteristic information of each standard color, a1 is the transparency value in the characteristic information of the sample color, a2 is the transparency value in the characteristic information of each standard color, g1 is the second color value in the characteristic information of the sample color, g2 is the second color value in the characteristic information of each standard color, b1 is the third color value in the characteristic information of the sample color, and b2 is the third color value in the characteristic information of each standard color; the first color value, the second color value and the third color value are three different colors in the standard colors.

15. A server, characterized in that: include: A processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the color recommendation method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the color recommendation method according to any one of claims 1 to 7.

17. A computer program product comprising instructions, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed on a server, the server is caused to execute the color recommendation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for determining a coloration product recommendation

    CN113196412A

  • Color matching method and device, computer equipment and storage medium

    CN113240765A