Data processing method, device and server for image color
Patent Information
- Application Number
- CN202211534284.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-12-02
AI Technical Summary
但是,基于上述方法具体实施时,用户操作较为繁琐、复杂,处理效率相对较低
[0055]基于本说申请提供的图像色彩的数据处理方法、装置和服务器,可以先获取目标图像,以及针对目标图像的色彩处理参数;并通过对目标图像进行色彩扫描,得到基于目标格式的目标色彩区域图片;根据所述色彩处理参数,对目标色彩区域图片进行色彩提取,以得到目标色彩区域图片中的相应的像素单位的色彩码;再对目标色彩区域图片中的像素单位的色彩码进行去重处理,得到去重后的像素单位的色彩码;进而可以根据去重后的像素单位的色彩码,生成针对目标图像的色卡文件。从而可以有效地简化用户操作,自动、高效地通过处理目标图像,生成得到较为全面、满足用户需求且准确度较高的色卡文件。
Smart Images

Figure CN115810057B_ABST
Abstract
Description
Technical Field
[0001] This specification belongs to the field of image processing technology, and in particular relates to image color data processing methods, apparatus and servers. Background Technology
[0002] Users often need to obtain and use the color chart file of the original image when using image software for image design or image editing.
[0003] Based on existing methods, users mostly need to manually select individual pixels in the image using the color picker pen or color picker tool built into the image software. Then, they need to manually verify and filter the extracted colors to generate the required color chart file. However, in practice, this method is cumbersome and complex, resulting in relatively low processing efficiency. Furthermore, this method is prone to incomplete manual color picking or duplicate colors, leading to poor accuracy in the final color chart file and affecting subsequent image data processing.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a data processing method, apparatus, and server for image color, which can effectively simplify user operations and automatically and efficiently generate color chart files that meet user needs and have high accuracy by processing target images.
[0006] This application provides a data processing method for image color, including:
[0007] Acquire a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution;
[0008] By performing color scanning on the target image, a target color region image based on the target format is obtained;
[0009] Based on the color processing parameters, color extraction is performed on the target color region image to obtain the color code of the corresponding pixel unit in the target color region image;
[0010] The color codes of pixels in the target color region image are deduplicated to obtain the deduplicated color codes of pixels.
[0011] Generate a color chart file for the target image based on the color code of the deduplicated pixel units.
[0012] In one embodiment, acquiring the target image includes:
[0013] Receive the initial image input by the user and display the user interface related to the initial image;
[0014] The user selects an initial image through the user interface.
[0015] Based on the selection operation, the image region selected by the user in the initial image is determined as the target image.
[0016] In one embodiment, obtaining color processing parameters for the target image includes:
[0017] Obtain image features of the target image; wherein the image features include at least one of the following: the number of color blocks in the image, the size of the color blocks in the image, and the gradient trend of colors in the image;
[0018] Based on the image features of the target image, a matching color recognition difference threshold and color recognition resolution are determined as the color processing parameters of the target image.
[0019] In one embodiment, based on the image features of the target image, a matching color recognition difference threshold and color recognition resolution are determined as color processing parameters for the target image, including:
[0020] Based on the image features of the target image, determine the type of color change in the target image;
[0021] Based on the color change type of the target image, a matching color recognition difference threshold and color recognition resolution are determined from a preset set of reference parameters, which serve as recommended values for the color processing parameters of the target image.
[0022] Show the user recommended values for the color processing parameters of the target image, and receive the user's operation data for the recommended values of the color processing parameters of the target image;
[0023] Based on the operation data and the recommended values of the color processing parameters of the target image, the color processing parameters of the target image are determined.
[0024] In one embodiment, a target color region image based on a target format is obtained by color scanning of the target image, including:
[0025] By performing a color scan on the target image, multiple layers of the target image are traversed.
[0026] Based on the traversal results of multiple layers, the images are stitched and glued together to obtain a target color region image based on the target format.
[0027] In one embodiment, color extraction is performed on the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image, including:
[0028] The corresponding pixel unit is determined based on the color recognition resolution.
[0029] Iterate through the color data of each corresponding pixel unit in the target color region image;
[0030] During the traversal, the color data of two adjacent pixel units are compared, and two adjacent pixel units that meet the similarity requirements are merged according to the color recognition difference threshold to obtain the color code of the corresponding pixel unit in the target color region image; wherein, the color code of the pixel unit also carries the position coordinates of the pixel unit.
[0031] In one embodiment, the color code includes an RGB code.
[0032] In one embodiment, deduplication of the color codes of pixel units in the target color region image is performed to obtain the deduplicated color codes of pixel units, including:
[0033] Using a preset hash function, the color code of each pixel is converted into a corresponding hash value;
[0034] The preset hash algorithm is invoked to determine the non-adjacent pixel units that meet the repetition requirement by comparing the hash values of the pixel units.
[0035] Based on the position coordinates of the pixel units, the color codes of non-adjacent pixel units that meet the repetition requirement are merged to obtain the deduplicated color codes of the pixel units.
[0036] In one embodiment, generating a color chart file for the target image based on the color code of the deduplicated pixel units includes:
[0037] Based on the position coordinates of the pixel units, the color codes of the deduplicated pixel units are arranged according to the preset sorting rules to obtain the initial color chart file;
[0038] Determine the target color code that matches the target application;
[0039] The color codes in the initial color chart file are converted into the target color codes to obtain a color chart file for the target image.
[0040] In one embodiment, after converting the color code of a pixel unit into a corresponding hash value using a preset hash function, the method further includes:
[0041] Calculate the image hash value of the target color region image based on the hash value of the pixel units in the target color region image;
[0042] Based on the image hash value of the target color region image, a preset color chart library is searched to determine whether a matching preset template color chart file exists in the preset color chart library; wherein, the preset color chart library stores multiple preset template color chart files; the preset template color chart file also carries a corresponding template image hash value;
[0043] If a matching preset template color chart file exists in the preset color chart library, the preset template color chart file is selected as the color chart file for the target image.
[0044] In one embodiment, after generating a color chart file for the target image, the method further includes:
[0045] In response to user-initiated trigger operations, call the relevant interfaces to display the color chart file for the target image to the user in the target application.
[0046] This application also provides an image color data processing apparatus, including:
[0047] An acquisition module is used to acquire a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution;
[0048] The scanning module is used to obtain a target color region image based on the target format by performing color scanning on the target image;
[0049] The extraction module is used to extract colors from the target color region image according to the color processing parameters, so as to obtain the color code of the corresponding pixel unit in the target color region image;
[0050] The deduplication module is used to deduplicate the color codes of pixel units in the target color region image to obtain the deduplicated color codes of pixel units.
[0051] The generation module is used to generate a color chart file for the target image based on the color code of the deduplicated pixel units.
[0052] This application also provides a server, including a processor and a memory for storing processor-executable instructions, wherein the processor executes the instructions to implement the relevant steps of the image color data processing method.
[0053] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, perform the following steps: acquiring a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; obtaining a target color region image based on a target format by color scanning the target image; extracting colors from the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image; performing deduplication processing on the color code of the pixel unit in the target color region image to obtain the deduplicated color code of the pixel unit; and generating a color chart file for the target image based on the deduplicated color code of the pixel unit.
[0054] This application also provides a computer program product comprising a computer program that, when executed by a processor, implements the relevant steps of the image color data processing method.
[0055] Based on the image color data processing method, apparatus, and server provided in this application, a target image and color processing parameters for the target image can be obtained first. Then, by performing color scanning on the target image, a target color region image based on the target format is obtained. According to the color processing parameters, color extraction is performed on the target color region image to obtain the color code of the corresponding pixel unit in the target color region image. Next, deduplication processing is performed on the color codes of the pixel units in the target color region image to obtain the deduplicated color codes of the pixel units. Finally, a color chart file for the target image can be generated based on the deduplicated pixel unit color codes. This effectively simplifies user operations, automatically and efficiently generating a more comprehensive, user-satisfying, and highly accurate color chart file by processing the target image. Attached Figure Description
[0056] To more clearly illustrate the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a schematic flowchart of an image color data processing method provided in one embodiment of this specification;
[0058] Figure 2 This is a schematic diagram illustrating an embodiment of the image color data processing method provided in this specification, applied in a scenario example.
[0059] Figure 3This is a schematic diagram illustrating an embodiment of the image color data processing method provided in this specification, applied in a scenario example.
[0060] Figure 4 This is a schematic diagram illustrating an embodiment of the image color data processing method provided in this specification, applied in a scenario example.
[0061] Figure 5 This is a schematic diagram illustrating an embodiment of the image color data processing method provided in this specification, applied in a scenario example.
[0062] Figure 6 This is a schematic diagram illustrating an embodiment of the image color data processing method provided in this specification, applied in a scenario example.
[0063] Figure 7 This is a schematic diagram of the structural composition of a server provided in one embodiment of this specification;
[0064] Figure 8 This is a schematic diagram of the structural composition of an image color data processing device provided in one embodiment of this specification. Detailed Implementation
[0065] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0066] See Figure 1 As shown in the embodiments of this specification, an image color data processing method is provided. Specifically, this method is applied to the server side. In specific implementation, the method may include the following:
[0067] S101: Obtain the target image and color processing parameters for the target image; wherein the color processing parameters include at least: color recognition difference threshold and color recognition resolution;
[0068] S102: Obtain a target color region image based on the target format by performing color scanning on the target image;
[0069] S103: Based on the color processing parameters, extract colors from the target color region image to obtain the color code of the corresponding pixel unit in the target color region image;
[0070] S104: Perform deduplication on the color codes of pixel units in the target color region image to obtain the deduplicated color codes of pixel units.
[0071] S105: Generate a color chart file for the target image based on the color code of the deduplicated pixel units.
[0072] In some embodiments, the image color data processing method described above can be specifically applied to the server side. See details. Figure 2 As shown, users can interact with the server through the client to complete the corresponding image color data processing methods.
[0073] Specifically, the server may include a server applied to the cloud platform side, capable of data transmission, data processing, and other functions. Specifically, the server may be, for example, an electronic device with data computing, storage, and network interaction capabilities. Alternatively, the server may be a software program running on the electronic device, providing support for data processing, storage, and network interaction. In this embodiment, the number of servers is not specifically limited. The server may be a single server, several servers, or a server cluster formed by several servers.
[0074] The client can specifically include a front-end applied to the user side, capable of data collection, data transmission, and other functions. Specifically, the client can be an electronic device such as a desktop computer, tablet computer, laptop computer, or mobile phone. Alternatively, the client can also be a software application that runs on the aforementioned electronic devices. For example, it could be a mapping app running on a mobile phone.
[0075] In practice, a target application for image data processing, such as Sketch, can be deployed on the client side.
[0076] Specifically, "Sketch" can refer to a vector drawing application used for interactive design. Of course, the target applications listed above are merely illustrative. In actual implementation, depending on the specific circumstances and processing requirements, the target applications may also include other types of software applications that support image data processing, such as Photoshop. This specification does not limit this.
[0077] Furthermore, a target plugin is also deployed on the client side that can be associated with the target application and perform specific image color data processing by calling the relevant interfaces of the target application.
[0078] Specifically, the aforementioned target plugin may include a plugin program written based on the image color data processing method provided in this specification and associated with the target application.
[0079] Specifically, the aforementioned target plugin can include a program plugin developed using JavaScript and CocoaScript, and implemented using webpack and the scaffolding tool skpm. Furthermore, this target plugin can connect to the target application through relevant interfaces provided by the target application (e.g., Sketch's JavaScript API) to support modifying and accessing relevant file data within the target application, as well as obtaining user-defined settings data, providing data sources, and so on.
[0080] In practice, users can launch the target application through the client and use it to perform image data processing on the input image, such as image editing and image design. During the processing, when users need to extract colors from the image or generate and use a color chart file related to the image, they can trigger the launch of the target plugin through the client. The target plugin will then determine the target image to be extracted or the color chart file to be generated. Subsequently, the target plugin can automatically process the target image, extract relevant color data, and generate a color chart file for the target image using the image color data processing methods provided in this manual.
[0081] In some embodiments, the acquisition of the target image described above may include the following:
[0082] S1: Receive the initial image input by the user and display the operation interface about the initial image to the user;
[0083] S2: Receive the user's selection operation for the initial image through the operation interface;
[0084] S3: Based on the selection operation, determine the image region selected by the user in the initial image as the target image.
[0085] In practice, depending on the user's specific needs, the initial image input by the user can also be directly determined as the target image.
[0086] Based on the above embodiments, the target image to be extracted or the color chart file to be generated can be accurately obtained, meeting the diverse needs of users.
[0087] In some embodiments, the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution. Furthermore, the aforementioned color data parameters may also include: a custom color code to be filtered out, a custom color code format, etc.
[0088] Specifically, the aforementioned color recognition difference threshold can be understood as a threshold parameter used to determine whether two colors can be classified as the same color based on their similarity. Specifically, when high accuracy is required, or the overall color variation is small, a smaller threshold parameter can be set as the color recognition difference threshold. Conversely, when low accuracy is required, or the overall color variation is large, a larger threshold parameter can be set as the color recognition difference threshold.
[0089] The aforementioned color recognition resolution can be understood as the smallest pixel unit used for extracting and processing color data. For details, please refer to [link / reference]. Figure 3 As shown, the color recognition resolution can be 1x1 pixels, 2x2 pixels, or 3x3 pixels, etc. In practical implementation, when high accuracy is required, processing efficiency is less critical, or the color variations in the image are complex, a smaller pixel unit can be set as the color recognition resolution. Conversely, when low accuracy is required, processing efficiency is more critical, or the color variations in the image are simpler, a larger pixel unit can be set as the color recognition resolution.
[0090] In some embodiments, the acquisition of color processing parameters for the target image described above may include the following:
[0091] S1: Obtain image features of the target image; wherein the image features include at least one of the following: the number of color blocks in the image, the size of the color blocks in the image, and the gradient trend of colors in the image;
[0092] S2: Based on the image features of the target image, determine the matching color recognition difference threshold and color recognition resolution as the color processing parameters of the target image.
[0093] In practice, the target image can be extracted by calling the image feature extraction model to obtain the required image features.
[0094] Based on the above embodiments, color processing parameters that yield better processing results for the target image can be determined by acquiring and utilizing the image features of the target image.
[0095] In some embodiments, see Figure 4 As shown above, the matching color recognition difference threshold and color recognition resolution are determined as color processing parameters for the target image. In specific implementation, this may include the following:
[0096] S1: Determine the type of color change in the target image based on its image features;
[0097] S2: Based on the color change type of the target image, determine the matching color recognition difference threshold and color recognition resolution from the preset reference parameter set as recommended values for the color processing parameters of the target image;
[0098] S3: Show the user recommended values for the color processing parameters of the target image, and receive the user's operation data for the recommended values of the color processing parameters of the target image;
[0099] S4: Determine the color processing parameters of the target image based on the operation data and the recommended values of the color processing parameters of the target image.
[0100] The preset reference parameter set contains multiple reference parameter groups. Each reference parameter group corresponds to a color change type of the image, and each reference parameter group includes at least a set of color recognition difference thresholds and color recognition resolutions that match the corresponding color change type.
[0101] In practice, a large number of historical operation records and related historical images can be collected when color chart files of historical images are generated; image features of historical images can be extracted, and color processing parameters used in historical operation records can be extracted at the same time; then the image features and color processing parameters can be combined as sample data; the sample data can be clustered to obtain multiple clusters; each cluster contains a set of color processing parameters, and each cluster corresponds to a combination of image features; then the combination of image features of a cluster can be determined as a color change type of an image, and the color processing parameters contained in the cluster can be determined as a set of reference parameters that match the color change type of the image.
[0102] In practice, the color change type of the target image can be determined first based on its image features. Then, based on the color change type of the target image, a preset set of reference parameters is retrieved to automatically determine the matching color recognition difference threshold and color recognition resolution that match the color change type of the target image. These are then presented as recommended values for color processing parameters that are suitable for the target image and have good subsequent processing effects, and are displayed and recommended to the user.
[0103] Furthermore, depending on the specific circumstances, the above recommended values can be directly used as the color processing parameters for the target image; alternatively, based on the user's specific needs, the client can be used to further modify and adjust the above recommended values to ultimately obtain color processing parameters that meet the user's personalized requirements.
[0104] Based on the above embodiments, user operations can be effectively simplified, helping users to efficiently and accurately determine the color processing parameters that are suitable for the target image and have a better processing effect.
[0105] In some embodiments, the above-mentioned method of obtaining a target color region image based on a target format by color scanning of the target image may specifically include the following: traversing multiple layers of the target image by color scanning; and stitching and pasting the layers together based on the traversal results to obtain a target color region image based on the target format.
[0106] The target format may specifically include PNG format, etc. Of course, depending on the specific circumstances and processing requirements, and considering the specific characteristics of the target application, the target format may also include other suitable formats such as JPG format. This specification does not limit this.
[0107] In some embodiments, the above-described color extraction of the target color region image to obtain the color code of the corresponding pixel unit in the target color region image may include the following:
[0108] S1: Determine the corresponding pixel unit based on the color recognition resolution;
[0109] S2: Traverse the color data of each corresponding pixel unit in the target color region image;
[0110] S3: During the traversal, the color data of two adjacent pixel units are compared, and two adjacent pixel units that meet the similarity requirements are merged according to the color recognition difference threshold to obtain the color code of the corresponding pixel unit in the target color region image; wherein, the color code of the pixel unit also carries the position coordinates of the pixel unit.
[0111] Specifically, two adjacent pixel units that meet the similarity requirement can refer to two adjacent pixel units whose color distance is less than or equal to the color recognition difference threshold.
[0112] Based on the above embodiments, two adjacent pixel units with the same or similar color data can be accurately identified and merged in a timely manner to avoid duplication and redundancy in the color chart files generated subsequently.
[0113] In some embodiments, the color code may specifically include an RGB code. Specifically, the RGB code can be understood as a color code designed for computer devices such as servers, facilitating backend data processing.
[0114] The color data includes color data based on the RGB color space, such as color data based on the sRGB color gamut. Furthermore, the color data includes R channel data, G channel data, and B channel data.
[0115] Specifically, the aforementioned RGB (or RGB color space) refers to a color space based on the three primary colors R (Red), G (Green), and B (Blue), which are superimposed to varying degrees to produce a rich and wide range of colors. Specifically, in a Cartesian coordinate system, a cube of unit length is used to represent color based on the three primary colors of red, green, and blue. The eight common colors—black, blue, green, cyan, red, purple, yellow, and white—are respectively placed at the eight vertices of the cube. Typically, black is placed at the origin of the three-dimensional Cartesian coordinate system, and red, green, and blue are placed on the three coordinate axes respectively. The entire cube can be placed within the first octet.
[0116] The aforementioned sRGB color gamut can be considered a universal standard color gamut, a color language commonly used in computer devices.
[0117] In practice, the color data of each corresponding pixel unit in the target color region image can be determined according to the following formula:
[0118]
[0119] Where R is the pixel unit R channel data, R i Here, n represents the R-channel data of pixel i within a pixel unit, n is the number of pixels in the pixel unit, i is the pixel number within the pixel unit, and B represents the B-channel data of the pixel unit. i G represents the B-channel data of pixel number i in the pixel unit, and G represents the G-channel data in the pixel unit. i This is the G channel data for pixel number i in the pixel unit.
[0120] Furthermore, the R channel data (R), B channel data (B), and G channel data (G) of a pixel can be combined to obtain the color code of that pixel, for example, it can be represented as (R, G, B).
[0121] In some embodiments, comparing the color data of two adjacent pixel units and merging the color codes of two adjacent pixel units that meet the similarity requirements according to a color recognition difference threshold may specifically include:
[0122] S1: Compare the color data of two adjacent pixel units, and determine the two adjacent pixel units that meet the similarity requirements based on the color recognition difference threshold.
[0123] S2: Merge the color codes of two adjacent pixel units that meet the similarity requirements to obtain the color code of the merged pixel unit.
[0124] In some embodiments, see Figure 5 As shown, the above method compares the color data of two adjacent pixel units and determines two adjacent pixel units that meet the similarity requirements based on the color recognition difference threshold. In specific implementation, this may include the following:
[0125] S1: Calculate the color distance between two adjacent pixel units based on their color data;
[0126] S2: Compare the color distance between two adjacent pixel units with the color recognition difference threshold to obtain the corresponding comparison result;
[0127] S3: Based on the comparison results, if the color distance between two adjacent pixel units is less than or equal to the color recognition difference threshold, then the two adjacent pixel units are determined to be adjacent pixel units that meet the similarity requirements.
[0128] In practice, the color distance between two adjacent pixel units can be calculated using the following formula:
[0129]
[0130] Where D is the color distance between two adjacent pixel units, R1, G1 and B1 can be the R channel data, G channel data and B channel data of one pixel unit in two adjacent pixel units respectively, and R2, G2 and B2 can be the R channel data, G channel data and B channel data of the other pixel unit in two adjacent pixel units respectively.
[0131] In some embodiments, the color codes of two adjacent pixel units that meet the similarity requirement are merged. In specific implementations, this may include the following:
[0132] S1: Obtain the position coordinates of the color codes of two adjacent pixel units that meet the similarity requirements;
[0133] S2: Arrange the color codes of two adjacent pixel units that meet the similarity requirements according to the preset sorting rules;
[0134] S3: Based on the arrangement result, retain the color code of the first pixel unit among two adjacent pixel units that meet the similarity requirement, and use it as the color code of the merged pixel unit.
[0135] The preset sorting rules can specifically include top-to-bottom and left-to-right sorting rules.
[0136] In some embodiments, after arranging the color codes of two adjacent pixel units that meet the similarity requirements according to a preset sorting rule, the method may further include the following:
[0137] S1: Calculate the average value of the color codes of two adjacent pixel units that meet the similarity requirements.
[0138] S2: Combine the average value of the color codes of two adjacent pixel units that meet the similarity requirement with the position coordinates of the color code of the first pixel unit among the two adjacent pixel units that meet the similarity requirement to obtain the color code of the merged pixel unit.
[0139] In some embodiments, see Figure 6 As shown, the above-described deduplication process for the color codes of pixels in the target color region image yields the deduplicated color codes of pixels. In practice, this can include the following:
[0140] S1: Using a preset hash function, the color code of the pixel unit is converted into the corresponding hash value;
[0141] S2: Call the preset hash algorithm to determine the non-adjacent pixel units that meet the repetition requirement by comparing the hash values of the pixel units;
[0142] S3: Based on the position coordinates of the pixel units, merge the color codes of non-adjacent pixel units that meet the repetition requirement to obtain the deduplicated color codes of the pixel units.
[0143] Specifically, non-adjacent pixel units that meet the repeatability requirement can refer to two or more (e.g., three, four, etc.) non-adjacent pixel units whose hash value difference is less than or equal to a preset difference threshold.
[0144] The aforementioned preset hash algorithm may specifically include the MD5 (Message-Digest Algorithm) algorithm, etc.
[0145] Based on the above embodiments, by first converting the pixel code into the corresponding hash value, the characteristics of the hash value and the advantages of the hash algorithm can be fully utilized to efficiently and quickly find pixel units with repeated colors in non-adjacent pixel units and merge them with a low amount of data processing, so as to further avoid duplicate redundancy in the color card file generated subsequently.
[0146] In some embodiments, the above-mentioned invocation of a preset hash algorithm determines non-adjacent pixel units that meet the repetition requirement by comparing the hash values of pixel units. In specific implementations, this may include the following:
[0147] S1: Call the preset hash algorithm to calculate the difference in hash values between non-adjacent pixel units in batches; and check whether the difference in hash values between non-adjacent pixel units is less than or equal to the preset hash value threshold.
[0148] S2: Non-adjacent pixel units whose detected hash value difference is less than or equal to a preset hash value threshold are identified as non-adjacent pixel units that meet the repeatability requirement.
[0149] In some embodiments, the color codes of non-adjacent pixel units that meet the repeatability requirement are merged based on the position coordinates of the pixel units to obtain the deduplicated color codes of the pixel units. In specific implementations, this may include the following:
[0150] S1: Arrange the color codes of non-adjacent pixel units that meet the repetition requirements according to the preset sorting rules.
[0151] S2: Based on the arrangement result, retain the color code of the first pixel unit among the non-adjacent pixel units that meet the repeatability requirement, and use it as the color code of the deduplicated pixel unit.
[0152] In some embodiments, after deduplicating the color codes of pixel units in the target color region image to obtain the deduplicated color codes of pixel units, the method may further include: using a heap sort algorithm to perform a second deduplication process on the deduplicated color codes of pixel units, so as to further identify and merge the color codes of pixel units with relatively similar colors (e.g., color codes belonging to relatively similar gradient colors).
[0153] In practice, the deduplicated pixel color codes can first be projected onto a coordinate space with the R-axis, G-axis, and B-axis as coordinate axes to obtain multiple data points, denoted as the first data points. Then, using a heap sort algorithm along the R-axis, multiple data points whose R-axis coordinate parameter difference values are less than a preset coordinate parameter difference threshold are selected from the multiple first data points, and these are designated as the second data points. Next, using the heap sort algorithm along the G-axis, multiple data points whose G-axis coordinate parameter difference values are less than a preset coordinate parameter difference threshold are selected from the multiple second data points, and these are designated as the third data points. Finally, using the heap sort algorithm along the B-axis, multiple data points whose G-axis coordinate parameter difference values are less than a preset coordinate parameter difference threshold are selected from the multiple third data points. Multiple data points whose B-axis coordinate parameter differences are less than a preset value are designated as the fourth data point. The color code of the pixel unit corresponding to the fourth data point is determined as the color code of the pixel unit to be merged in the second round, which has a relatively close color. The color codes of the pixel units to be merged in the second round are then merged to obtain the color codes of the pixel units after the second round of merging. The color codes of the remaining pixel units (excluding the color codes of the pixel units to be merged in the second round) after deduplication are combined with the color codes of the pixel units after the second round of merging to obtain the final color codes of the pixel units that meet the requirements. Subsequently, a color chart file with relatively good effect and accuracy can be generated using the color codes of the pixel units that meet the requirements.
[0154] Based on the above embodiments, the characteristics of the heap sort algorithm can be utilized to efficiently and accurately identify the color codes of pixel units to be merged in the large number of deduplicated pixel units with relatively low processing cost, effectively reducing the amount of data processing and the complexity of data processing; at the same time, it also makes the operation process relatively more stable and reliable.
[0155] In some embodiments, the above-mentioned generation of a color chart file for the target image based on the color code of the deduplicated pixel units may include the following:
[0156] S1: Based on the position coordinates of the pixel units, arrange the color codes of the deduplicated pixel units according to the preset sorting rules to obtain the initial color chart file;
[0157] S2: Determine the target color code that matches the target application;
[0158] S3: Convert the color codes in the initial color chart file into the target color codes to obtain a color chart file for the target image.
[0159] Based on the above embodiments, color chart files that are arranged in order and have a user-friendly interface can be generated relatively quickly, so that users can read and use them in the target application.
[0160] In practice, a sorting algorithm can be used to efficiently generate a color chart file for the target image based on the color code of the deduplicated pixel units.
[0161] Specifically, the target color code can be a format that matches the target application and is easy for users to read and use in the target application.
[0162] In some embodiments, the target color code may specifically include: Hex code, etc. Specifically, the aforementioned Hex code can be understood as a user-oriented, user-friendly color code that is easy for users to read and use.
[0163] In some embodiments, after converting the color code of a pixel unit into a corresponding hash value using a preset hash function, the method may further include the following:
[0164] S1: Calculate the image hash value of the target color region image based on the hash value of the pixel units in the target color region image;
[0165] S2: Based on the image hash value of the target color region image, search the preset color chart library to determine whether there is a matching preset template color chart file in the preset color chart library; wherein, the preset color chart library stores multiple preset template color chart files; the preset template color chart file also carries a corresponding template image hash value;
[0166] S3: If a matching preset template color chart file exists in the preset color chart library, the preset template color chart file is selected as the color chart file for the target image.
[0167] The aforementioned preset color card library can be stored in a cache for quick retrieval.
[0168] Furthermore, the preset template color chart files are generated in advance based on the corresponding template images; and the preset template color chart files stored in the preset color chart library also carry the corresponding template image hash values.
[0169] Based on the above embodiments, in some cases, matching can also be performed in a preset color chart library based on the image hash value of the target color region image, and the existing preset template color chart file can be used as the color chart file of the target image, thereby effectively avoiding repeated data processing and further reducing the amount of data processing.
[0170] In some embodiments, if it is determined that there is no matching preset template color card file in the preset color card library, the method provided in this specification can be applied to traverse the color data of each corresponding pixel unit in the target color area image to regenerate a color card file for the target image.
[0171] In some embodiments, after obtaining the color chart file of the target image, the method may further include:
[0172] S1: Obtain the image hash value of the target color region image;
[0173] S2: Based on the image hash value of the target color region image, search the preset color chart library to determine whether there is a matching preset template color chart file in the preset color chart library;
[0174] S3: If it is determined that there is no matching preset template color card file in the preset color card library, the color card file of the target image is added as a new preset template color card file and the image details of the target color area are stored in the preset color card library.
[0175] In some embodiments, after generating a color chart file for the target image, the method may further include the following: responding to a user-initiated trigger operation and calling relevant interfaces to display the color chart file for the target image to the user in the target application.
[0176] Based on the above embodiments, users can directly display and use the color chart file of the target image in the target application through the target plugin, so that users can directly perform image data processing such as image design and image editing on the target image in the target application.
[0177] In some embodiments, after displaying a color chart file for a target image to the user through a corresponding interface in the target application, the method may further include the following: receiving an adjustment operation from the user for the color chart file of the target image; and fine-tuning the color chart file of the target image according to the adjustment operation to obtain a color chart file of the target image that meets the user's requirements.
[0178] As can be seen from the above, the image color data processing method provided in the embodiments of this specification can first acquire a target image and color processing parameters for the target image; then, by performing color scanning on the target image, a target color region image based on the target format is obtained; according to the color processing parameters, color extraction is performed on the target color region image to obtain the color code of the corresponding pixel unit in the target color region image; then, deduplication processing is performed on the color code of the pixel unit in the target color region image to obtain the deduplicated pixel unit color code; and finally, a color chart file for the target image can be generated based on the deduplicated pixel unit color code. This effectively simplifies user operations, automatically and efficiently generating a more comprehensive, user-satisfying, and highly accurate color chart file by processing the target image.
[0179] This specification also provides a server, including a processor and a memory for storing processor-executable instructions. Specifically, the processor can perform the following steps according to the instructions: acquiring a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; obtaining a target color region image based on a target format by color scanning the target image; extracting colors from the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image; performing deduplication processing on the color codes of the pixel units in the target color region image to obtain deduplicated pixel unit color codes; and generating a color chart file for the target image based on the deduplicated pixel unit color codes.
[0180] To execute the above instructions more accurately, please refer to... Figure 7 As shown in the embodiments of this specification, another specific server is also provided, wherein the server includes a network communication port 701, a processor 702, and a memory 703. The above structures are connected by internal cables so that the various structures can perform specific data interaction.
[0181] Specifically, the network communication port 701 can be used to acquire a target image and color processing parameters for the target image; wherein the color processing parameters include at least: color recognition difference threshold and color recognition resolution.
[0182] The processor 702 is specifically configured to: perform color scanning on the target image to obtain a target color region image based on the target format; extract colors from the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image; perform deduplication processing on the color code of the pixel unit in the target color region image to obtain the deduplicated pixel unit color code; and generate a color chart file for the target image based on the deduplicated pixel unit color code.
[0183] The memory 703 can be used to store the corresponding instruction program.
[0184] In this embodiment, the network communication port 701 can be a virtual port bound to different communication protocols, thereby enabling the sending or receiving of different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. Furthermore, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM or CDMA; it can also be a Wi-Fi chip; or it can be a Bluetooth chip.
[0185] In this embodiment, the processor 702 can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. This specification is not limiting.
[0186] In this embodiment, the memory 703 may include multiple layers. In a digital system, anything that can store binary data can be a memory. In an integrated circuit, a circuit with storage function but no physical form is also called a memory, such as RAM, FIFO, etc. In a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0187] This specification also provides a computer-readable storage medium based on the above-described image color data processing method. The computer-readable storage medium stores computer program instructions that, when executed, implement: acquiring a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; obtaining a target color region image based on a target format by color scanning the target image; extracting colors from the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image; performing deduplication processing on the color codes of the pixel units in the target color region image to obtain the deduplicated color codes of the pixel units; and generating a color chart file for the target image based on the deduplicated color codes of the pixel units.
[0188] In this embodiment, the storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), cache, hard disk drive (HDD), or memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface configured according to standards specified in the communication protocol for network connection communication.
[0189] In this embodiment, the specific functions and effects implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other embodiments, and will not be repeated here.
[0190] This specification also provides a computer program product comprising a computer program that, when executed by a processor, performs the following steps: acquiring a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; obtaining a target color region image based on a target format by color scanning the target image; extracting colors from the target color region image according to the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image; performing deduplication processing on the color code of the pixel unit in the target color region image to obtain the deduplicated pixel unit color code; and generating a color chart file for the target image based on the deduplicated pixel unit color code.
[0191] See Figure 8 As shown, at the software level, this specification also provides an image color data processing apparatus, which may specifically include the following structural modules:
[0192] The acquisition module 801 is specifically used to acquire a target image and color processing parameters for the target image; wherein, the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution;
[0193] The scanning module 802 can be used to obtain a target color region image based on the target format by performing color scanning on the target image;
[0194] The extraction module 803 can be specifically used to extract colors from the target color region image according to the color processing parameters, so as to obtain the color code of the corresponding pixel unit in the target color region image;
[0195] The deduplication module 804 is specifically used to deduplicate the color codes of pixel units in the target color region image to obtain the deduplicated color codes of pixel units.
[0196] The generation module 805 can be used to generate a color chart file for the target image based on the color code of the deduplicated pixel units.
[0197] In some embodiments, when the acquisition module 801 is specifically implemented, the target image can be acquired in the following manner: receiving an initial image input by the user and displaying an operation interface about the initial image to the user; receiving the user's selection operation on the initial image through the operation interface; and determining the image area selected by the user in the initial image as the target image based on the selection operation.
[0198] In some embodiments, when the acquisition module 801 is specifically implemented, it can acquire color processing parameters for the target image in the following manner: acquire image features of the target image; wherein, the image features include at least one of the following: the number of color blocks in the image, the size of the color blocks in the image, and the gradient trend of colors in the image; and determine a matching color recognition difference threshold and color recognition resolution based on the image features of the target image as color processing parameters of the target image.
[0199] In some embodiments, when the acquisition module 801 is specifically implemented, it can determine the matching color recognition difference threshold and color recognition resolution as color processing parameters of the target image based on the image features of the target image in the following manner: determining the color change type of the target image based on the image features of the target image; determining the matching color recognition difference threshold and color recognition resolution from a preset reference parameter set based on the color change type of the target image as recommended values of color processing parameters of the target image; displaying the recommended values of color processing parameters of the target image to the user and receiving operation data from the user regarding the recommended values of color processing parameters of the target image; determining the color processing parameters of the target image based on the operation data and the recommended values of color processing parameters of the target image.
[0200] In some embodiments, when the scanning module 802 is specifically implemented, it can obtain a target color region image based on the target format by performing color scanning on the target image in the following manner: by performing color scanning on the target image, multiple layers of the target image are traversed; according to the traversal results of multiple layers, they are stitched and glued together to obtain a target color region image based on the target format.
[0201] In some embodiments, when the extraction module 803 is specifically implemented, it can extract color from the target color region image according to the color processing parameters in the following manner to obtain the color code of the corresponding pixel unit in the target color region image: determine the corresponding pixel unit according to the color recognition resolution; traverse the color data of each corresponding pixel unit in the target color region image; during the traversal, compare the color data of two adjacent pixel units, and merge two adjacent pixel units that meet the similarity requirements according to the color recognition difference threshold to obtain the color code of the corresponding pixel unit in the target color region image; wherein, the color code of the pixel unit also carries the position coordinates of the pixel unit.
[0202] In some embodiments, the color code may specifically include RGB code, etc.
[0203] In some embodiments, when the deduplication module 804 is specifically implemented, the color codes of pixel units in the target color region image can be deduplicated in the following manner to obtain the deduplicated color codes of pixel units: using a preset hash function, the color codes of pixel units are converted into corresponding hash values; a preset hash algorithm is called, and by comparing the hash values of pixel units, non-adjacent pixel units that meet the repetition requirement are determined; based on the position coordinates of the pixel units, the color codes of non-adjacent pixel units that meet the repetition requirement are merged to obtain the deduplicated color codes of pixel units.
[0204] In some embodiments, when the generation module 805 is specifically implemented, it can generate a color chart file for the target image based on the color codes of the deduplicated pixel units in the following manner: arranging the color codes of the deduplicated pixel units according to the position coordinates of the pixel units and a preset sorting rule to obtain an initial color chart file; determining the target color code that matches the target application; and converting the color codes in the initial color chart file into the target color codes to obtain a color chart file for the target image.
[0205] In some embodiments, when the generation module 805 is specifically implemented, after converting the color code of the pixel unit into the corresponding hash value using a preset hash function, it can also be used to calculate the image hash value of the target color region image based on the hash value of the pixel unit in the target color region image; based on the image hash value of the target color region image, it searches a preset color chart library to determine whether a matching preset template color chart file exists in the preset color chart library; wherein, the preset color chart library stores multiple preset template color chart files; the preset template color chart file also carries a corresponding template image hash value; if it is determined that a matching preset template color chart file exists in the preset color chart library, the preset template color chart file is determined as the color chart file for the target image.
[0206] In some embodiments, after generating a color chart file for the target image, the device can also be used to respond to a user-initiated trigger operation and call relevant interfaces to display the color chart file for the target image to the user in the target application.
[0207] It should be noted that the units, devices, or modules described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. For ease of description, the above devices are described by dividing them into various modules according to their functions. Of course, in implementing this specification, the functions of each module can be implemented in one or more software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection between the devices or units shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0208] As can be seen from the above, the image color data processing device provided in the embodiments of this specification can effectively simplify user operations and automatically and efficiently generate a more comprehensive color card file that meets user needs and has high accuracy by processing the target image.
[0209] While this specification provides the steps of operation for the methods described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or client product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. The terms "first," "second," etc., are used to denote names and do not indicate any particular order.
[0210] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0211] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this specification can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of this specification can essentially be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of this specification.
[0212] Although this specification has been described by way of examples, those skilled in the art will recognize that many variations and modifications are possible without departing from the spirit of this specification, and it is intended that the appended claims cover such variations and modifications without departing from the spirit of this specification.
Claims
1. A method for processing image color data, characterized in that, include: Acquire a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; By performing color scanning on the target image, a target color region image based on the target format is obtained; Based on the color processing parameters, color extraction is performed on the target color region image to obtain the color code of the corresponding pixel unit in the target color region image; The color codes of pixels in the target color region image are deduplicated to obtain the deduplicated color codes of pixels. Generate a color chart file for the target image based on the color code of the deduplicated pixel units; The process involves extracting colors from the target color region image based on the color processing parameters to obtain the color code of the corresponding pixel unit in the target color region image. This includes: determining the corresponding pixel unit based on the color recognition resolution; traversing the color data of each corresponding pixel unit in the target color region image; comparing the color data of two adjacent pixel units during the traversal; and merging two adjacent pixel units that meet the similarity requirements based on the color recognition difference threshold to obtain the color code of the corresponding pixel unit in the target color region image. The color code of the pixel unit also carries the position coordinates of the pixel unit, and the two adjacent pixel units that meet the similarity requirements are two adjacent pixel units whose color distance is less than or equal to the color recognition difference threshold. The process of deduplicating the color codes of pixel units in the target color region image to obtain deduplicated pixel unit color codes includes: using a preset hash function to convert the color codes of pixel units into corresponding hash values; calling a preset hash algorithm to determine non-adjacent pixel units that meet the repetition requirement by comparing the hash values of pixel units; and merging the color codes of non-adjacent pixel units that meet the repetition requirement based on the position coordinates of the pixel units to obtain the deduplicated pixel unit color codes. After converting the color code of a pixel unit into a corresponding hash value using a preset hash function, the method further includes: calculating the image hash value of the target color region image based on the hash value of the pixel unit in the target color region image; searching a preset color chart library based on the image hash value of the target color region image to determine whether a matching preset template color chart file exists in the preset color chart library; wherein, the preset color chart library stores multiple preset template color chart files; the preset template color chart file also carries a corresponding template image hash value; if it is determined that a matching preset template color chart file exists in the preset color chart library, the preset template color chart file is determined as the color chart file for the target image.
2. The method according to claim 1, characterized in that, Acquire the target image, including: Receive the initial image input by the user and display the user interface related to the initial image; The user selects an initial image through the user interface. Based on the selection operation, the image region selected by the user in the initial image is determined as the target image.
3. The method according to claim 1, characterized in that, Obtain the color processing parameters for the target image, including: Obtain image features of the target image; wherein the image features include at least one of the following: the number of color blocks in the image, the size of the color blocks in the image, and the gradient trend of colors in the image; Based on the image features of the target image, a matching color recognition difference threshold and color recognition resolution are determined as the color processing parameters of the target image.
4. The method according to claim 3, characterized in that, Based on the image features of the target image, a matching color recognition difference threshold and color recognition resolution are determined as color processing parameters for the target image, including: Based on the image features of the target image, determine the type of color change in the target image; Based on the color change type of the target image, a matching color recognition difference threshold and color recognition resolution are determined from a preset set of reference parameters, which serve as recommended values for the color processing parameters of the target image. Show the user recommended values for the color processing parameters of the target image, and receive the user's operation data for the recommended values of the color processing parameters of the target image; Based on the operation data and the recommended values of the color processing parameters of the target image, the color processing parameters of the target image are determined.
5. The method according to claim 1, characterized in that, By performing color scanning on the target image, a target color region image based on the target format is obtained, including: By performing a color scan on the target image, multiple layers of the target image are traversed. Based on the traversal results of multiple layers, the images are stitched and glued together to obtain a target color region image based on the target format.
6. The method according to claim 1, characterized in that, The color code includes RGB code.
7. The method according to claim 1, characterized in that, Based on the color code of the deduplicated pixel units, a color chart file for the target image is generated, including: Based on the position coordinates of the pixel units, the color codes of the deduplicated pixel units are arranged according to the preset sorting rules to obtain the initial color chart file; Determine the target color code that matches the target application; The color codes in the initial color chart file are converted into the target color codes to obtain a color chart file for the target image.
8. The method according to claim 1, characterized in that, After generating a color chart file for the target image, the method further includes: In response to user-initiated trigger operations, call the relevant interfaces to display the color chart file for the target image to the user in the target application.
9. An image color data processing device, characterized in that, include: An acquisition module is used to acquire a target image and color processing parameters for the target image; wherein the color processing parameters include at least: a color recognition difference threshold and a color recognition resolution; The scanning module is used to obtain a target color region image based on the target format by performing color scanning on the target image; The extraction module is used to extract colors from the target color region image according to the color processing parameters, so as to obtain the color code of the corresponding pixel unit in the target color region image; The deduplication module is used to deduplicate the color codes of pixel units in the target color region image to obtain the deduplicated color codes of pixel units. The generation module is used to generate a color chart file for the target image based on the color code of the deduplicated pixel units. Specifically, the extraction module is used to: determine the corresponding pixel units based on the color recognition resolution; traverse the color data of each corresponding pixel unit in the target color region image; during the traversal, compare the color data of two adjacent pixel units, and merge two adjacent pixel units that meet the similarity requirements according to the color recognition difference threshold to obtain the color code of the corresponding pixel unit in the target color region image; wherein, the color code of the pixel unit also carries the position coordinates of the pixel unit, and the two adjacent pixel units that meet the similarity requirements are two adjacent pixel units whose color distance is less than or equal to the color recognition difference threshold. Specifically, the deduplication module is used to: convert the color code of a pixel unit into a corresponding hash value using a preset hash function; call a preset hash algorithm to determine non-adjacent pixel units that meet the repetition requirement by comparing the hash values of the pixel units; and merge the color codes of non-adjacent pixel units that meet the repetition requirement according to the position coordinates of the pixel units to obtain the deduplicated color code of the pixel unit. The generation module is further configured to: after converting the color code of a pixel unit into a corresponding hash value using a preset hash function, calculate the image hash value of the target color region image based on the hash value of the pixel unit in the target color region image; search a preset color chart library based on the image hash value of the target color region image to determine whether a matching preset template color chart file exists in the preset color chart library; wherein the preset color chart library stores multiple preset template color chart files; the preset template color chart file also carries a corresponding template image hash value; if it is determined that a matching preset template color chart file exists in the preset color chart library, determine the preset template color chart file as the color chart file for the target image.
10. A server, characterized in that, It includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Image color detection method and mobile terminal
CN110335257A
Color card manufacturing method and device, electronic equipment and storage medium
CN112102440A