A method of dynamically generating a color dictionary, and a computer readable medium

By dynamically generating a color dictionary, the RGB values ​​and pixel usage counts of project art assets are periodically statistically analyzed, solving the problems of time-consuming and inaccurate traditional manual review. This achieves efficient and accurate color management and reduces the probability of disharmonious images.

CN122289414APending Publication Date: 2026-06-26SHENGQU INFORMATION TECH SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENGQU INFORMATION TECH SHANGHAI
Filing Date
2024-12-24
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

During project development, traditional manual color matching review of art resources is time-consuming and prone to errors, while existing computer technology management methods are inefficient and cannot fully consider compliance, resulting in inconsistent color styles, which increases costs and maintenance difficulty.

Method used

By dynamically generating color dictionaries, the RGB values ​​and pixel usage counts of project art asset files are periodically statistically analyzed. Color dictionaries and two-dimensional statistical charts are created or updated to assist developers in selecting colors that match the overall color scheme and reduce the occurrence of discordant visuals.

Benefits of technology

It improved the accuracy and efficiency of color matching, reduced manpower and material costs, and ensured the coordination and consistency of the color scheme style of the project's art resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289414A_ABST
    Figure CN122289414A_ABST
Patent Text Reader

Abstract

This application provides a method for dynamically generating a color dictionary and a computer-readable medium. The method includes: periodically analyzing the RGB values ​​and corresponding pixel usage counts used in the color scheme of art resource files that represent the overall color scheme style of a project, to dynamically create or update a color dictionary and a two-dimensional statistical chart representing the RGB values ​​and corresponding pixel usage counts. The color dictionary and the two-dimensional statistical chart are provided for project developers to reference and use in color matching. By using the dynamically generated color dictionary provided in this application for color matching of art resources during project development, developers can promptly grasp and adhere to the overall color scheme style of the project, ensuring the consistency of the overall project art resource color scheme style and preventing jarring or conflicting visuals from appearing during project development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of color management / standardization of art resources during the development of projects (especially game, animation and film development projects), specifically involving a method for dynamically generating a color dictionary and a computer-readable medium. Background Technology

[0002] During the development of a project (especially a game, animation, or film and television development project), the color scheme of the art assets needs to follow the overall color scheme of the project. This requires the project developers, especially the colorists of the art assets, to accurately grasp the color scheme of the project, as well as the colors that can be used and the colors that should be avoided during the color matching process.

[0003] To prevent discordant visuals that clash with the overall color scheme of a project, it's crucial to promptly grasp the color style of art assets and verify the "compliance" of newly added art assets. Traditional art asset color analysis and review typically rely on manual operations, requiring art designers to meticulously check and record the color usage in each art asset file to determine if it conflicts with the overall project color scheme. Searching through folders and viewing art assets in editors is time-consuming and fails to quickly obtain information, hindering large-scale art asset management and increasing the risk of omissions and errors, making it difficult to accurately and comprehensively grasp the color scheme of art assets within a project. Furthermore, the use of fixed color palettes during project development limits the range of colors art designers can choose, failing to flexibly meet their needs and making it difficult to select satisfactory colors.

[0004] While existing methods for managing and inspecting art assets using computer technology have saved manpower and improved efficiency to some extent, they still have some shortcomings. For example, due to the sheer volume of art assets and tens of thousands of files in a project, a full-scan inspection based on preset "compliance" rules would be extremely time-consuming; incremental inspection, on the other hand, requires storing and merging the inspection results of existing art asset files, which also complicates the algorithm. More importantly, "compliance" rules are often difficult to consider comprehensively, leading to inaccurate analysis and inspection results of art assets. Furthermore, for art asset files in game development projects, it is necessary to consider the production specifications, naming conventions, and performance requirements of different types of resources. Different types of resource files often require rewriting inspection rules, which undoubtedly increases game development and maintenance costs. Summary of the Invention

[0005] To overcome the shortcomings of existing methods for analyzing and inspecting project art resources, this application provides a technical solution for dynamically generating a color dictionary. This solution utilizes computer technology to promptly statistically analyze the color scheme of the overall project art resources and dynamically create or update the color dictionary (i.e., color palette) used by project developers (primarily art designers). This technical solution enables art designers to promptly identify the color range and proportion of commonly used colors for the project, automatically reducing the probability of images that clash with the overall project color scheme during the color matching process; thus, better managing and optimizing art resources.

[0006] On one hand, this application provides a method for dynamically generating a color dictionary. The method includes: periodically counting the RGB values ​​used in the color scheme of art resource files that can represent the overall color scheme of the project (i.e., conform to the overall color scheme of the project), and the corresponding number of times the pixels are used; creating or updating a color dictionary for project developers to use for color matching based on the results of the statistics; and a two-dimensional statistical chart representing the RGB values ​​and the corresponding number of times the pixels are used; the color dictionary only contains the colors corresponding to the RGB values ​​with the most frequent number of times the pixels are used.

[0007] The art resource files representing the overall color scheme of the project can be added by the developers or dynamically during development. By using commonly used color values ​​that conform to the overall project color scheme to dynamically create or update the color dictionary used by developers (mainly art designers), not only is the accuracy and efficiency of color matching improved, but the probability of images that are inconsistent with the overall project color scheme is also effectively reduced.

[0008] Furthermore, the art resource files that represent the overall color scheme of the project are placed in a preset storage path on the server. The server periodically traverses all art resource files in the preset storage path to count the RGB values ​​used in the color scheme and the corresponding number of times the pixels are used, thereby creating or updating the color dictionary and the two-dimensional statistical chart.

[0009] Preferably, the method further includes: when the number of newly added files under the preset storage path exceeds the preset number, triggering the server to re-count the RGB values ​​used in the color schemes of all art resource files under the preset storage path, as well as the corresponding number of times pixels are used, and creating or updating the color dictionary and the two-dimensional statistical chart.

[0010] Furthermore, in order to successfully perform the above statistics on different types of art resource files, Python's OS module can be used to traverse all art resource files in the preset storage path and use the Image class therein to implement the statistics.

[0011] Furthermore, the creation or updating of the color field includes: sorting the statistically obtained RGB values ​​according to the number of times each corresponding pixel is used, extracting the colors corresponding to the RGB values ​​with the most frequent use of the pixel, or excluding the colors corresponding to the RGB values ​​with fewer than a preset number of uses of the pixel, in order to create or update the color dictionary.

[0012] Preferably, the two-dimensional statistical graph is a two-dimensional color distribution graph, and the higher the brightness of the color block in the two-dimensional color distribution graph, the higher the number of times the corresponding pixel is used.

[0013] Corresponding to the above method, another aspect of this application provides a computer-readable medium. The computer-readable medium stores program code; when the program code is executed by a processor, it implements the above-described method for dynamically generating a color dictionary.

[0014] The technical solution provided in this application enables project developers to grasp the overall color scheme of the project in a timely and intuitive manner, assisting them in efficiently selecting colors that match the overall color scheme and ensuring the harmony of the color scheme of the overall project's art resources. Compared with existing methods for analyzing and inspecting project art resources, the technical solution provided in this application not only saves manpower and material costs but also better ensures the harmony of the overall project's color scheme without the need to set complex inspection rules. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 A flowchart of one embodiment of the method for dynamically generating a color dictionary provided in this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] like Figure 1As shown, in one embodiment, the method for dynamically generating a color dictionary provided in this application includes the following steps:

[0019] S1. Organize the art resource files that represent the overall color scheme of the project and save them to the preset storage path.

[0020] This step primarily involves identifying the art resource files that represent the overall color scheme of the project (i.e., those that conform to the overall project color scheme), and then saving these files in a pre-defined storage path. Specifically, representative 3D art resources can be selected from the project, such as 3D characters and scenes. These files should include models, textures, materials, animations, effects, and various configuration files. Create a folder named "ArtResources" and save the identified art resource files in this folder. The art resource files representing the overall color scheme of the project can be added by the developer or dynamically during development.

[0021] Preferably, the sorted art resource files are stored centrally in a preset storage path on the development server.

[0022] S2. Periodically analyze the RGB values ​​used in the color scheme of the art resource file and the corresponding number of times the pixels are used;

[0023] Specifically, this can be achieved by using Python's `os` module to iterate through all art resource files in the preset storage path. A Python script can be written to recursively traverse all art resource files in the "ArtResources" folder using the `os.wall()` function of the `os` module. During the traversal, the Image class from the `Pill` library is used to count the RGB value of each pixel in all art resource files in the "ArtResources" folder, as well as the total number of times the corresponding RGB value appears in the "ArtResources" file.

[0024] S3. Based on the results of the statistics, create or update a color dictionary and a two-dimensional statistical graph representing RGB values ​​and the number of times the corresponding pixels are used.

[0025] The color dictionary contains only the colors corresponding to the most frequently used RGB values ​​of the pixel. By using commonly used color values ​​that conform to the overall project color scheme to dynamically create or update the color dictionary used by developers (mainly art designers), not only can the accuracy and efficiency of color matching be improved, but the probability of images that are inconsistent with the overall project color scheme can also be effectively reduced.

[0026] This step can be achieved by: after traversing all the art resource files in the "ArtResources" folder, you can obtain each RGB value and the number of times its pixels are used.

[0027] Then, the statistically obtained RGB values ​​are sorted according to the number of times each pixel is used. Colors corresponding to the most frequently used RGB values ​​are extracted, or colors corresponding to RGB values ​​whose pixel usage is less than a preset number are excluded, in order to create or update the color dictionary. For example, a threshold for the number of times a pixel is used can be set to remove RGB values ​​with fewer than 100 references when creating the color dictionary.

[0028] Next, the color dictionary and the two-dimensional statistical graph are created or updated using Python. The color dictionary (i.e., color palette) and the two-dimensional statistical graph are provided for color matching reference by project developers (especially graphic designers). At this point, the color dictionary and the two-dimensional statistical graph can be generated by calling the matplotlib library in Python to generate images.

[0029] For example, based on the statistical data, a two-dimensional color distribution map is generated, showing the distribution of color values ​​and pixel usage frequency for each referenced item, using a comparison relationship of "pixels / 20 references". In this two-dimensional color distribution map, the higher the brightness of the color block corresponding to the RGB value, the higher the number of times the corresponding pixel is used.

[0030] Furthermore, in addition to periodically triggering the above statistics and creating or updating the color dictionary and two-dimensional statistical chart, an incremental triggering mechanism can also be used to trigger the above statistical process. For example, when the number of new files added under the preset storage path exceeds the preset number, the server is triggered to recalculate the RGB values ​​used in the color schemes of all art resource files under the preset storage path, as well as the corresponding number of pixel usages, and to create or update the color dictionary and the two-dimensional statistical chart.

[0031] To ensure that all developers (especially art designers) on the same project can synchronously access the latest color dictionary and 2D statistical chart, the above method uses a development server. After creating or updating the color dictionary and 2D statistical chart, the development server synchronizes them to the development environments of each developer or art designer on the corresponding project.

[0032] Corresponding to the above method, another aspect of this application provides a computer-readable medium. The computer-readable medium stores program code; when executed by a processor, the program code implements the above-described method for dynamically generating a color dictionary. The computer-readable medium may be, but is not limited to, various types of flash memory, hard disks, optical disks, and network storage devices.

[0033] Finally, it should be noted that the above descriptions are merely some embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of dynamically generating a color dictionary, characterized by, The method includes: periodically counting the RGB values ​​used in the color scheme of art resource files that represent the overall color scheme style of the project, as well as the corresponding number of times the pixels are used; creating or updating a color dictionary for project developers to use for color matching based on the results of the statistics; and a two-dimensional statistical chart representing the RGB values ​​and the corresponding number of times the pixels are used; the color dictionary only contains the colors corresponding to the RGB values ​​with the most frequent number of times the pixels are used.

2. The method of claim 1, wherein, The art resource files that represent the overall color scheme of the project are placed in a preset storage path on the server. The server periodically traverses all art resource files in the preset storage path to count the RGB values ​​used in the color scheme and the corresponding number of times the pixels are used, and then creates or updates the color dictionary and the two-dimensional statistical chart.

3. The method of claim 2, wherein, The method further includes: using Python's OS module to traverse all art resource files in the preset storage path and using the Image class to perform the statistics.

4. The method of claim 1, wherein, The method further includes: sorting the statistically obtained RGB values ​​according to the number of times each corresponding pixel is used, extracting the colors corresponding to a number of RGB values ​​with the most frequent use of the pixel, or excluding the colors corresponding to a number of RGB values ​​with fewer than a preset number of uses of the pixel, in order to create or update the color dictionary.

5. The method of claim 2, wherein, The method further includes: when the number of new files added under the preset storage path exceeds the preset number, triggering the server to recalculate the RGB values ​​used in the color schemes of all art resource files under the preset storage path, as well as the corresponding number of times pixels are used, and creating or updating the color dictionary and the two-dimensional statistical chart.

6. The method of claim 1 or 5, wherein, The two-dimensional statistical chart is a two-dimensional color distribution chart; the higher the brightness of the color block in the two-dimensional color distribution chart, the higher the number of times the corresponding pixel is used.

7. A computer readable medium characterized by The computer-readable medium stores program code; when the program code is executed by a processor, it implements the method for dynamically generating a color dictionary as described in any one of claims 1-6.