Color display method, device, electronic device and readable medium
By determining the target area of the target image in the HSB color mode, obtaining the color information of each pixel point and generating chart data to display the color distribution situation, the problem that the existing technology cannot accurately display the color distribution, and improving the accuracy of batch printing sex and image recognition efficiency.
Patent Information
- Application Number
- CN202111386597.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-11-22
AI Technical Summary
In the HSB color mode, the prior art cannot accurately display the distribution of individual colors in the image, resulting in batch printing errors and low image recognition efficiency.
By determining the target area of the target image, HSB color information of each pixel point is obtained, chart data is generated, and the chart is displayed based on the data to display the color distribution situation.
It realizes automatic generation of charts matching the target image, displays color distribution, avoids batch printing errors, and improves image recognition efficiency and accuracy.
Smart Images

Figure CN114063944B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a color display method, device, electronic device and computer-readable medium. Background Art
[0002] When printing images in large batches, if you replace the ink cartridge midway, the batch printing may fail or some of the images may not meet the printing requirements.
[0003] Therefore, it is necessary to be able to determine the distribution of each color based on the image to predict in advance whether the printing consumables need to be replaced to avoid batch printing errors.
[0004] In addition, during the image recognition process, the efficiency and accuracy of target recognition in the image can also be improved based on the distribution of each color in the image.
[0005] Currently, there is no technical solution that can accurately display the distribution of each color in the HSB color mode, which cannot avoid errors in batch printing and cannot improve the efficiency and accuracy of image recognition. Summary of the invention
[0006] In view of this, the embodiments of this specification provide a color display method, device, electronic device and computer-readable medium to display the distribution of each color in the HSB color mode.
[0007] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0008] A color display method, comprising:
[0009] determining a target region of a target image;
[0010] Obtaining color information of each pixel in the target area; the color information includes color parameters of the HSB color mode;
[0011] generating chart data according to the color parameters;
[0012] A chart is generated and displayed based on the chart data.
[0013] In some embodiments, determining the target image specifically includes:
[0014] Determine the selection criteria entered by the user;
[0015] If the selection condition is the entire area, then all pixels of the target image are determined as the target area;
[0016] If the selection condition is a partial area, the target image is cropped based on the coordinate value of the partial area to obtain a cropped area, and the cropped area is used as the target area.
[0017] In some embodiments, obtaining the color information of each pixel in the target area specifically includes:
[0018] Determining a configuration file of the target image;
[0019] Find the color parameter of the HSB color mode corresponding to each pixel point in the target area recorded in the configuration file;
[0020] Generates a color parameter array based on the color parameters.
[0021] In some embodiments, generating chart data according to the color parameters specifically includes:
[0022] Obtain a preset color configuration table; the color configuration table includes multiple color names and a color value range corresponding to each color name;
[0023] Traverse the color parameter array, and find the number of colors corresponding to each color in the color value range;
[0024] Each color and the number of colors corresponding to each color are used as chart data.
[0025] In some embodiments, the types of the chart specifically include: a bar chart, a ring chart, or a sector chart.
[0026] In some embodiments, generating and displaying a chart based on the chart data specifically includes:
[0027] determining a chart type for the chart;
[0028] Determine, according to the chart type, a chart generation component corresponding to the picture type;
[0029] The chart data is input into the chart generation component so that the search chart generation component generates a chart matching the chart type.
[0030] In some embodiments, obtaining the color information of each pixel in the target area specifically includes:
[0031] Get one or more target colors input by the user;
[0032] Color information in the target area that matches a target color parameter of the target color is obtained.
[0033] In some embodiments, before determining the target area of the target image, the method further includes:
[0034] Get the amount of storage space occupied by the image selected by the user;
[0035] If the data volume is greater than a preset data volume, compressing the image so that the data volume is not greater than the preset data volume;
[0036] Use the compressed image as the target image.
[0037] Another aspect of the present invention provides a color display device, including:
[0038] A determination device, used for determining a target area of a target image;
[0039] A computing device, used to obtain color information of each pixel in the target area; the color information includes color parameters of HSB color mode;
[0040] a conversion device for generating chart data according to the color parameters;
[0041] A display device is used to generate and display a chart based on the chart data.
[0042] Another aspect of the present invention provides an electronic device, comprising:
[0043] at least one processor; and,
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0046] determining a target region of a target image;
[0047] Obtaining color information of each pixel in the target area; the color information includes color parameters of the HSB color mode;
[0048] generating chart data according to the color parameters;
[0049] A chart is generated and displayed based on the chart data.
[0050] Another aspect of the present invention further provides a computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to perform the color display method as described above.
[0051] One embodiment of the present specification can achieve at least the following beneficial effects: the present invention can automatically generate a chart that matches the target image, and the distribution of colors in the target image can be displayed in the chart, so as to adjust whether the ink cartridges of corresponding colors need to be replaced during batch printing based on the distribution, and can also perform target recognition based on the distribution, thereby improving recognition efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0053] Figure 1 It is a flow chart of a color display method shown in an embodiment of the present invention.
[0054] Figure 2 This is an example diagram of a color display method in actual use in an embodiment of the present invention.
[0055] Figure 3 This is another example diagram of a color display method in actual use in an embodiment of the present invention.
[0056] Figure 4 A schematic diagram of the structure of a color display device provided in an embodiment of this specification;
[0057] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0058] In the embodiment of the present invention, the image in the HSB color mode is mainly involved, and the color in the image in the HSB color mode is displayed. In the HSB color mode, H (hues) represents hue, S (saturation) represents saturation, and B (brightness) represents brightness. The medium corresponding to the HSB color mode is the human eye.
[0059] Due to the needs of batch printing or image recognition, it should be possible to obtain the color distribution of an image. In the prior art, there is no relevant technical solution to directly obtain the distribution of each color in the image. Therefore, an embodiment of the present invention provides a color display method for directly displaying the distribution of each color in the image, so as to reduce the error rate when batch printing images or improve the efficiency and accuracy of image recognition.
[0060] Figure 1It is a flow chart of a color display method shown in an embodiment of the present invention.
[0061] An embodiment of the present invention provides a color display method, including:
[0062] S100, determining a target area of a target image;
[0063] In the embodiment of the present invention, the execution subject may be an electronic device, a server, a cloud server, or a processing device capable of executing the color display method. It may be implemented in the form of an app, an application program, a web program, etc.
[0064] In the embodiment of the present invention, the target image may be an image that needs to display color distribution, and may be specified by the user or processed in batches.
[0065] Determining the target image specifically includes:
[0066] Determine the selection criteria entered by the user;
[0067] If the selection condition is the entire area, then all pixels of the target image are determined as the target area;
[0068] If the selection condition is a partial area, the target image is cropped based on the coordinate value of the partial area to obtain a cropped area, and the cropped area is used as the target area.
[0069] In the embodiment of the present invention, a selection condition may be set, and different areas in the target image may be selected as the target area according to different selection conditions.
[0070] The selection condition may be the entire area or a partial area, wherein the entire area may be the default selection. When the user does not select, the entire area of the target image is used as the target area by default.
[0071] When the image has large pixels, selecting the entire area may affect the operation speed. Of course, in some cases, such as image recognition of a specific target in the target image or batch printing of only part of the image, you can select a partial area as the selection condition.
[0072] The partial area may be pixel coordinates, an area determined by circling, or an area circled by a preset shape template. The preset shape template may be a rectangle, a square, a circle, etc., and may be set according to actual needs.
[0073] When the selection condition is a partial area, the target area can be cropped and the cropped area is used as the target area.
[0074] It can be understood that in the embodiment of the present invention, the image, the target image, etc. can all be in HSB color mode.
[0075] S200, obtaining color information of each pixel in the target area; the color information includes color parameters of HSB color mode.
[0076] In an embodiment of the present invention, there are multiple pixels in the target area, each pixel includes its own color information, which may include color parameters of the HSB color mode, such as H: 0.0864, S: 0.9763, B: 0.9922. Of course, other methods that can express the color parameters of the HSB color mode are not limited, as long as the color information can reflect the color parameters of the HSB color mode of the pixel.
[0077] Of course, the number of corresponding pixels varies depending on the target area.
[0078] S300: Generate chart data according to the color parameters.
[0079] In the embodiment of the present invention, after obtaining the color information, the icon data is generated according to the color parameters in the color information. The parameters representing the corresponding colors in the chart data can be generated according to the number of different colors, and each color corresponds to a different number to determine the length, width, height and other parameters in the graphics to be displayed.
[0080] The chart data may include a data structure for generating the chart data. Of course, the data format of the chart data can be set in different data formats according to different types of charts.
[0081] The chart data may specifically include: chart type, number of display items, and specific parameters of each item, such as horizontal coordinate, vertical coordinate, width, height, etc. It may also include the name of the basic function called, the name of the chart, the unit of the chart display, etc. The number of color parameters matches the parameters representing the number of display items in the chart data, that is, one color corresponds to a series displayed in the chart, which may be a bar in a bar chart, or each ring in a ring chart, etc.
[0082] S400: Generate and display a chart based on the chart data.
[0083] In the embodiment of the present invention, a chart component can be called or a code corresponding to the chart data can be executed to generate and display a chart. The distribution of each color in the target image can be displayed in the chart. Among them, the chart component is a pre-generated component. When the chart component is initialized and the chart data is passed in, a chart with data can be generated.
[0084] It can be understood that in the embodiment of the present invention, the chart used is determined by the chart type according to the data structure, and different data structures can correspond to different chart types.
[0085] The displayed chart may be displayed at a specified location, which may be a window of a web page, a display interface of a specified terminal, a display area of a specified program, etc. It is sufficient that the above-mentioned chart can be displayed. The specific type of the chart is not specifically limited here. The type of the chart may specifically include: a bar chart, a ring chart, or a sector chart.
[0086] It can be seen from the above embodiments that the present invention can automatically generate a chart that matches the target image, and the distribution of colors in the target image can be displayed in the chart. Then, based on the distribution, it can be adjusted whether the ink cartridges of corresponding colors need to be replaced during batch printing, and the target can be identified based on the distribution, thereby improving the efficiency and accuracy of identification.
[0087] In the above embodiment, it is introduced that the color information of each pixel in the target area is obtained.
[0088] In the embodiment of the present invention, obtaining the color information of each pixel in the target area specifically includes:
[0089] Determining a configuration file of the target image;
[0090] Find the color parameter of the HSB color mode corresponding to each pixel point in the target area recorded in the configuration file;
[0091] Generates a color parameter array based on the color parameters.
[0092] In the embodiment of the present invention, the target image may correspond to a configuration file, wherein the configuration file records the color parameters of the HSB color mode. The color parameters of each pixel point may be found out according to the configuration file so as to generate chart data.
[0093] The generating of chart data according to the color parameters specifically includes:
[0094] Obtain a preset color configuration table; the color configuration table includes multiple color names and a color value range corresponding to each color name;
[0095] Traverse the color parameter array, and find the number of colors corresponding to each color in the color value range;
[0096] Each color and the number of colors corresponding to each color are used as chart data.
[0097] In the embodiment of the present invention, a preset color configuration table may be pre-configured for color parameters. The preset color configuration table may include a color value range corresponding to each color.
[0098] For example:
[0099] Black: b<0.2.
[0100] White: s<0.1 and b>0.8.
[0101] Red: h<0.04 or h>0.95 and s>0.7 and b>0.7.
[0102] Orange: h>0.04 and h<0.1 and s>0.7 and b>0.7.
[0103] Of course, other colors can also be set according to actual needs, as long as each color has its own corresponding value range.
[0104] In an embodiment of the present invention, each pixel point can be traversed, and the pixel point position and color information corresponding to each pixel point are obtained until the color information of all pixels is obtained, and then chart data is generated. Among them, the chart data may include each color and the number of pixels corresponding to each color. The maximum value is used as a reference value to determine the maximum value range that can be displayed in the chart. Taking a bar chart as an example, in an embodiment of the present invention, the number of elements in the color parameter array is the number of bar chart columns. The chart data is traversed, and the maximum value range of the bar chart is determined based on the largest value of the element in the color parameter array. The color parameter array is traversed, and the number corresponding to the color is used as the text space at the bottom of the chart. The number of elements is used as a picture bar chart, and a bar chart of the corresponding height is drawn. When the traversal is completed, the chart data is generated.
[0105] The generating and displaying of a chart based on the chart data specifically includes:
[0106] determining a chart type for the chart;
[0107] Determine, according to the chart type, a chart generation component corresponding to the picture type;
[0108] The chart data is input into the chart generation component so that the search chart generation component generates a chart matching the chart type.
[0109] In the embodiment of the present invention, a chart can be generated based on the chart data and displayed.
[0110] The chart generation component can be determined according to different chart types. Different chart generation components correspond to different generation methods and generate different types of charts. Of course, the chart generation component can also be an application with the function of generating charts. Different types of charts are generated according to different chart data.
[0111] In the embodiment of the present invention, the user can also specify the color to be displayed.
[0112] The step of obtaining the color information of each pixel in the target area specifically includes:
[0113] Get one or more target colors input by the user;
[0114] Color information in the target area that matches a target color parameter of the target color is obtained.
[0115] In the embodiment of the present invention, before generating the chart data, the target color input by the user can also be obtained, and the target color parameter of the target color is used as the color information in the target area. The user can input the specific value of the target color, or input the name of the specific color. The color information can be determined based on the target color input by the user. A more personalized display can be performed.
[0116] In the embodiment of the present invention, if the pixels of the image are too large, calculation errors or freezes may occur. Therefore, in the embodiment of the present invention, before determining the target area of the target image, the method further includes:
[0117] Get the amount of storage space occupied by the image selected by the user;
[0118] If the data volume is greater than a preset data volume, compressing the image so that the data volume is not greater than the preset data volume;
[0119] Use the compressed image as the target image.
[0120] In the embodiment of the present invention, the data volume of the image can also be pre-determined. If the data volume is greater than the preset data volume, the image is first compressed to improve the processing efficiency while ensuring the image effect as much as possible.
[0121] Figure 2 This is an example diagram of a color display method in actual use in an embodiment of the present invention.
[0122] The horizontal axis is the color of the target image, and the vertical axis is the number of each color. Based on the embodiment of the present invention, the distribution of each color in the target area of the target image can be intuitively displayed, and the image in the HSB color mode can be intuitively displayed to the user to prepare for other subsequent processes.
[0123] Figure 3 This is another example diagram of a color display method in actual use in an embodiment of the present invention.
[0124] and Figure 2 Different, Figure 3 You can use a pie chart to show the color distribution in the image.
[0125] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 4 The embodiments of this specification provide corresponding to Figure 1 A schematic diagram of the structure of a color display device. Figure 4 As shown, the device may include:
[0126] The determining means 41 is used to determine the target area of the target image;
[0127] A calculation device 42, used to obtain color information of each pixel in the target area; the color information includes color parameters of HSB color mode;
[0128] Converting means 43, for generating chart data according to said color parameters;
[0129] The display device 44 is used to generate and display a chart based on the chart data.
[0130] It is understood that the above modules refer to computer programs or program segments for executing one or more specific functions. In addition, the distinction between the above modules does not mean that the actual program codes must also be separated.
[0131] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0132] Figure 5 The embodiments of this specification provide corresponding to Figure 1 A schematic diagram of the structure of an electronic device. Figure 5 As shown, the electronic device 500 may include:
[0133] at least one processor 510; and,
[0134] A memory 530 in communication with the at least one processor; wherein,
[0135] The memory 530 stores instructions 520 executable by the at least one processor 510. The instructions are executed by the at least one processor 510 to enable the at least one processor 510 to:
[0136] A color display method, characterized by comprising:
[0137] determining a target region of a target image;
[0138] Obtaining color information of each pixel in the target area; the color information includes color parameters of the HSB color mode;
[0139] generating chart data according to the color parameters;
[0140] A chart is generated and displayed based on the chart data.
[0141] Based on the same idea, the embodiment of this specification also provides a computer-readable medium corresponding to the above method. The computer-readable medium stores computer-readable instructions, which can be executed by a processor to implement the following method:
[0142] determining a target region of a target image;
[0143] Obtaining color information of each pixel in the target area; the color information includes color parameters of the HSB color mode;
[0144] generating chart data according to the color parameters;
[0145] A chart is generated and displayed based on the chart data.
[0146] The above describes specific embodiments of the present specification. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0147] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other.
[0148] The devices, electronic devices and methods provided in the embodiments of this specification correspond to each other, and therefore, the devices and electronic devices also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding devices and equipment will not be repeated here.
[0149] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0150] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0151] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0152] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0153] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0155] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0157] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0158] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0159] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0160] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0161] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0162] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A color display method, characterized in that: include: Get images to be printed in batches; Determining a target area of the images to be batch printed; Obtaining color information of each pixel in the target area of the image to be batch printed; the color information includes color parameters of the HSB color mode; Generate chart data according to the color parameters of each pixel in the target area of the image to be batch printed; Generate and display a chart based on the chart data; the chart is used to represent the distribution of colors in the images to be batch printed, so as to adjust the ink cartridges of each color during batch printing according to the distribution of colors in the images to be batch printed; The step of obtaining the color information of each pixel in the target area of the image to be batch printed specifically includes: Determining a configuration file of the images to be batch printed; Searching for color parameters of the HSB color mode corresponding to each pixel point in the target area of the image to be batch printed recorded in the configuration file; Generate a color parameter array based on the color parameters; The step of generating chart data according to the color parameters of each pixel in the target area of the image to be batch printed comprises: Obtain a preset color configuration table; the color configuration table includes multiple color names and a color value range corresponding to each color name; Traversing the color parameter array, and determining the number of colors corresponding to each color according to the color value range; Each color and the number of colors corresponding to each color are used as chart data; The generating and displaying of a chart based on the chart data includes: determining a chart type for the chart; Determine, according to the chart type, a chart generation component corresponding to the chart type; The chart data is input into the chart generation component so that the chart generation component generates a chart matching the chart type.
2. The method according to claim 1, characterized in that: Determining the target area of the images to be batch printed specifically includes: Determine the selection criteria entered by the user; If the selection condition is the entire area, then determining all the pixels of the images to be batch printed is the target area of the images to be batch printed; If the selection condition is a partial area, the images to be batch-printed are cropped based on the coordinate values of the partial area to obtain a cropped area, and the cropped area is used as the target area of the images to be batch-printed.
3. The method according to claim 1, characterized in that The types of the chart specifically include: a bar chart, a ring chart or a sector chart.
4. The method according to claim 1, characterized in that: The step of obtaining the color information of each pixel in the target area of the image to be batch printed specifically includes: Get one or more target colors input by the user; Color information matching a target color parameter of the target color in a target area of the image to be batch printed is obtained.
5. The method according to claim 1, characterized in that Before determining the target area of the images to be batch printed, the method further includes: Get the amount of storage space occupied by the image selected by the user; If the data volume is greater than a preset data volume, compressing the image so that the data volume is not greater than the preset data volume; The compressed images are used as images to be printed in batches.
6. A color display device, characterized in that: include: A determination device, used for acquiring images to be batch printed and determining a target area of the images to be batch printed; A computing device, used for obtaining color information of each pixel in the target area of the image to be batch printed; the color information includes color parameters of the HSB color mode; A conversion device, for generating chart data according to the color parameters of each pixel in the target area of the image to be batch printed; A display device, used for generating and displaying a chart based on the chart data; the chart is used to represent the distribution of colors in the images to be batch printed, so as to adjust the ink cartridges of each color during batch printing according to the distribution of colors in the images to be batch printed; The step of obtaining the color information of each pixel in the target area of the image to be batch printed specifically includes: Determining a configuration file of the images to be batch printed; Searching for color parameters of the HSB color mode corresponding to each pixel point in the target area of the image to be batch printed recorded in the configuration file; Generate a color parameter array based on the color parameters; The step of generating chart data according to the color parameters of each pixel in the target area of the image to be batch printed comprises: Obtain a preset color configuration table; the color configuration table includes multiple color names and a color value range corresponding to each color name; Traversing the color parameter array, and determining the number of colors corresponding to each color according to the color value range; Each color and the number of colors corresponding to each color are used as chart data; The generating and displaying of a chart based on the chart data includes: determining a chart type for the chart; Determine, according to the chart type, a chart generation component corresponding to the chart type; The chart data is input into the chart generation component so that the chart generation component generates a chart matching the chart type.
7. An electronic device comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Get images to be printed in batches; Determining a target area of the images to be batch printed; Obtaining color information of each pixel in the target area of the image to be batch printed; the color information includes color parameters of the HSB color mode; Generate chart data according to the color parameters of each pixel in the target area of the image to be batch printed; Generate and display a chart based on the chart data; the chart is used to represent the distribution of colors in the images to be batch printed, so as to adjust the ink cartridges of each color during batch printing according to the distribution of colors in the images to be batch printed; The step of obtaining the color information of each pixel in the target area of the image to be batch printed specifically includes: Determining a configuration file of the images to be batch printed; Searching for color parameters of the HSB color mode corresponding to each pixel point in the target area of the image to be batch printed recorded in the configuration file; Generate a color parameter array based on the color parameters; The step of generating chart data according to the color parameters of each pixel in the target area of the image to be batch printed comprises: Obtain a preset color configuration table; the color configuration table includes multiple color names and a color value range corresponding to each color name; Traversing the color parameter array, and determining the number of colors corresponding to each color according to the color value range; Each color and the number of colors corresponding to each color are used as chart data; The generating and displaying of a chart based on the chart data includes: determining a chart type for the chart; Determine, according to the chart type, a chart generation component corresponding to the chart type; The chart data is input into the chart generation component so that the chart generation component generates a chart matching the chart type.
8. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the color display method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Color discrimination method and terminal
CN104077567A