Image optimization method and device for color ink screen
By calculating the color distribution and color concentration of the target image of the color ink screen, image classification and optimization using suitable algorithms, the problem of poor color display effect of color ink screens in the existing technology is solved, and a fuller and brighter color display and gradient natural color effect is achieved.
Patent Information
- Application Number
- CN202510260525.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When displaying color images in existing color ink screens, due to the limitations of the filter, the color display effect is poor, and a fixed algorithm cannot effectively process different types of images.
By calculating the color distribution and color concentration of the target image, the image is classified as a structural or natural image, and the color level algorithm and jitter algorithm are used for image optimization respectively.
It is implemented to optimize according to the color characteristics of the image before displaying, improve the color display effect of the ink screen, and avoid the problem of poor color display effect.
Smart Images

Figure CN119832868A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image optimization method and device for a color ink screen. Background Art
[0002] The color ink screen achieves the function of color display by superimposing a color filter on the black and white ink screen. Compared with other mainstream displays, it has the advantages of energy saving and eye protection.
[0003] At present, due to the limitation of the filter, the color ink screen can only display a limited number of colors; before displaying the color image, the color conversion processing is usually performed on the color image to be displayed based on a fixed algorithm, resulting in the problem of poor color display effect. Summary of the invention
[0004] In order to solve the problems existing in the above-mentioned prior art, the purpose of this application is to provide an image optimization method and device for a color ink screen.
[0005] In a first aspect, the present application provides an image optimization method for a color ink screen, comprising:
[0006] Obtain the target image to be displayed on the ink screen and calculate the color distribution of the target image;
[0007] Based on the color distribution, the color concentration of the target image is calculated; the color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors;
[0008] If the color concentration is greater than the adaptive threshold, the target image is classified as a structural image; if the color concentration is not greater than the adaptive threshold, the target image is classified as a natural image; the adaptive threshold is obtained according to the supported colors of the ink screen;
[0009] In response to the target image being a structural image, the structural image is optimized by a color scale algorithm; in response to the target image being a natural image, the natural image is optimized by a dithering algorithm; and an optimized target image is obtained.
[0010] In one embodiment, the step of optimizing the structural image by using a color scale algorithm includes:
[0011] Calculate the degree of proximity between each pixel in the structural image and the supporting color;
[0012] The pixel value of the closest supporting color is used as the pixel value of the corresponding pixel to obtain the optimized target image; when adjacent pixels of different colors approach the same supporting color, the adjacent pixels of different colors are replaced with other supporting colors.
[0013] In one embodiment, when adjacent pixels of different colors approach the same supported color, the step of replacing adjacent pixels of different colors with other supported colors includes:
[0014] Determine the adjacent color regions to which adjacent pixels of different colors belong;
[0015] Identify the boundaries between adjacent color areas;
[0016] If the dividing line is a closed curve, the pixel values of the adjacent pixels are replaced with the reference support color; the reference support color is the support color closest to the main color; the main color is the color with the highest proportion in the target image;
[0017] If the dividing line is a non-closed curve, the pixel values of the adjacent pixels are replaced with the neighborhood support color; the neighborhood support color is the support color corresponding to the color area adjacent to the gap of the dividing line.
[0018] In one embodiment, the step of optimizing the natural image by using a dithering algorithm includes:
[0019] Adjusting the color of the natural image according to the saturation of the natural image to obtain an adjusted natural image;
[0020] The pixel value of each pixel in the adjusted natural image is obtained by byte shifting to obtain a scaled pixel value;
[0021] Compare the scaled pixel value of each pixel with the jittered pixel value of the corresponding position in the jitter matrix to obtain the jittered image data; if the scaled pixel value is greater than the jittered pixel value, the corresponding pixel takes the value of 1 in the corresponding color channel, otherwise it takes the value of 0;
[0022] According to a preset display color table, the color representation of the jittered image data is determined to obtain an optimized target image; the display color table is configured according to the ink screen.
[0023] In one embodiment, the step of adjusting the color of the natural image according to the saturation of the natural image to obtain the adjusted natural image includes:
[0024] If the saturation of the natural image is less than a preset value, a saturation gain operation is performed on the natural image according to the resolution and saturation of the ink screen to obtain an adjusted natural image; the saturation gain includes increasing the saturation of the image according to a saturation gain coefficient.
[0025] In one embodiment, the step of performing a saturation gain operation on a natural image according to the resolution and saturation of the ink screen includes:
[0026] Determine the dither matrix and the number of simulated colors of the dither algorithm according to the resolution;
[0027] Calculate the number of similar colors corresponding to the same simulated color in the natural image;
[0028] According to the ratio of the number of similar colors to the total number of colors in the natural image, the saturation gain coefficient is obtained;
[0029] Based on the saturation gain coefficient, the natural image is adjusted to obtain an adjusted natural image.
[0030] In a second aspect, the present application provides an image optimization device for a color ink screen, the device comprising:
[0031] The data processing module is used to obtain the target image to be displayed on the ink screen and calculate the color distribution of the target image; based on the color distribution, the color concentration of the target image is calculated; the color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors;
[0032] An image classification module, for classifying a target image as a structural image if the color concentration is greater than an adaptive threshold; and for classifying the target image as a natural image if the color concentration is not greater than the adaptive threshold;
[0033] The image optimization module is used to optimize the structural image by a color scale algorithm in response to the target image being a structural image; and to optimize the natural image by a dithering algorithm in response to the target image being a natural image; and to obtain the optimized target image.
[0034] In a third aspect, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the first aspect of the present application are implemented.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any one of the methods in the first aspect of the present application when the computer program is executed by a processor.
[0036] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect of the present application.
[0037] The image optimization method for a color ink screen described in the present application can accurately reflect the color characteristics of the target image by calculating the color concentration of the target image based on the color distribution as an indicator; wherein the color concentration measures the color complexity of the target image by combining the main color proportion and the number of colors of the target image; the target image is classified by comparing the color concentration with the adaptive threshold, and the target image can be classified by considering the number of colors supported by the ink screen, so as to facilitate the subsequent optimization of the target image by a suitable algorithm; the color scale algorithm is used to optimize structural images with simple colors, so that the ink screen can display rich and bright colors; the dithering algorithm is used to optimize structural images with complex colors, so that the ink screen can present gradual and natural colors; the above method effectively avoids the problem of poor color display effect by optimizing the target image according to the color characteristics before display. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 is a flowchart of steps of an image optimization method for a color ink screen in an embodiment;
[0040] Figure 2 is a flowchart of steps for optimizing a structural image by using a color scale algorithm in one embodiment;
[0041] Figure 3 is a flowchart of steps in which adjacent pixels of different colors are replaced with other supported colors in one embodiment;
[0042] Figure 4 is a flow chart of steps for optimizing a natural image by using a dithering algorithm in one embodiment;
[0043] Figure 5 is a flowchart of steps for performing saturation gain on a natural image according to the resolution and saturation of an ink screen in an embodiment;
[0044] Figure 6 The present invention is a structural block diagram of an image optimization device for a color ink screen in one embodiment. DETAILED DESCRIPTION
[0045] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0046] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0047] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0048] In an exemplary embodiment, Figure 1 As shown, the present application provides an image optimization method for a color ink screen, comprising the following steps S2 to S8:
[0049] S2, obtaining a target image to be displayed on the ink screen, and calculating the color distribution of the target image.
[0050] Specifically, the image data of the target image to be displayed on the color ink screen is obtained, including the pixel value data of the RGB three-color channels; the data in the RGB color space is converted into the HSV color space, and the distribution histogram of H (color) is calculated.
[0051] S4, based on the color distribution, calculate the color concentration of the target image; the color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors.
[0052] It should be noted that due to the hysteresis effect of the ink particles of the ink screen, the ink screen can display the same content for a long time with extremely low energy consumption, so it is widely used in static displays, such as labels, billboards, and conference table signs; the images that need to be displayed are usually structural images with a large text area or natural images with a large pattern area; these two types of images can be distinguished based on their color distribution histograms.
[0053] Specifically, based on the color distribution histogram, the peak-to-valley difference is obtained by subtracting the maximum value from the minimum value in the color distribution. The peak-to-valley difference can reflect the color uniformity of the target image; the total number of colors can reflect the color richness of the target image; the color concentration is obtained by directly summing or weighted summing the reciprocal of the main color proportion and the total number of colors. Therefore, the color concentration can well reflect the color characteristics of the target image.
[0054] S6, if the color concentration is greater than the adaptive threshold, the target image is classified as a structural image; if the color concentration is not greater than the adaptive threshold, the target image is classified as a natural image. The adaptive threshold is obtained according to the supported colors of the ink screen.
[0055] It is understandable that structural images usually have obvious edges, single and bright colors, while natural images usually have unclear edges and more gradient colors; because the characteristics of these two types of images are quite different, different algorithms need to be used for color optimization.
[0056] Specifically, the current color ink screen has a variety of color configurations, such as a black-white-red three-color screen, a yellow-red black-white four-color screen, and a black-white-yellow-red-blue-green six-color screen. For screens of different color types, the image classification threshold can be changed so that the method can be adaptively used for various color ink screens; according to the number of supported colors that the ink screen can display, the corresponding adaptive threshold is obtained;
[0057] Preferably, although black and white are not colors, they are included in the calculation of the number of supported colors. For example, the number of supported colors of a six-color screen is 6. The peak-to-valley difference is taken as the average supported color ratio, and the total number of colors is twice the number of supported colors. The adaptive threshold is calculated according to the following formula:
[0058]
[0059] Where T is the adaptive threshold and n is the number of supported colors.
[0060] Furthermore, after determining the adaptive threshold according to the number of supported colors that the ink screen can display, if the color concentration of the target image is greater than the adaptive threshold, it can be judged that the color of the target image is relatively concentrated and single, and it is a structural image; if the color concentration of the target image is not greater than the adaptive threshold, it can be judged that the color of the target image is relatively rich, and it is a natural image.
[0061] S8, in response to the target image being a structural image, optimizing the structural image by a color scale algorithm; in response to the target image being a natural image, optimizing the natural image by a dithering algorithm; and obtaining an optimized target image.
[0062] Specifically, through the color gradation algorithm, the colors in the structural image are converted into the supporting colors closest to the RGB values, which can make the display colors of the structural image after color conversion on the ink screen more full and bright, and can also reduce the data processing time of the ink screen; through the dithering algorithm, the difference in human eye sensitivity to spatial frequency is utilized, and an ordered noise pattern is used to reduce the step effect during color gradient, thereby improving image smoothness and making the transition of gradient color display on the ink screen softer.
[0063] The above-mentioned image optimization method for color ink screen can accurately reflect the color characteristics of the target image by calculating the color concentration based on the color distribution of the target image as an indicator; wherein the color concentration measures the color complexity of the target image by combining the main color proportion and the number of colors of the target image; the target image is classified by comparing the color concentration with the adaptive threshold, and the target image can be classified by considering the number of colors supported by the ink screen, so as to facilitate the subsequent optimization of the target image by a suitable algorithm; the color simple structural image is optimized by the color scale algorithm, so that the ink screen can display rich and bright colors; the complex color structural image is optimized by the dithering algorithm, so that the ink screen can present a gradient and natural color; the above-mentioned method effectively avoids the problem of poor color display effect by optimizing the target image according to the color characteristics before display.
[0064] In an exemplary embodiment, Figure 2 As shown, performing image optimization on a structural image by using a color scale algorithm includes the following steps S822 to S824:
[0065] S822, calculating the degree of proximity between each pixel point in the structural image and the supporting color.
[0066] Specifically, first calculate the difference between the RGB value of each pixel in the structural image and the RGB value of each supporting color of the ink screen, then sum the squares of the differences of the three channels to obtain the corresponding supporting color with the smallest sum of squares. This supporting color is the supporting color that the pixel is closest to.
[0067] S824, taking the pixel value of the closest supported color as the pixel value of the corresponding pixel point to obtain an optimized target image; when adjacent pixels of different colors approach the same supported color, the adjacent pixels of different colors are replaced with other supported colors.
[0068] Specifically, the original pixel value is replaced by the pixel value of the closest supported color of each pixel point to obtain the color-optimized target image; when the closest supported colors of adjacent areas are the same, the inner boundary or texture of the image will be lost. Therefore, in this case, the pixel value of the boundary line of the adjacent areas needs to be replaced by the pixel value of other supported colors.
[0069] In an exemplary embodiment, Figure 3 As shown, when adjacent pixels of different colors approach the same supported color, the adjacent pixels of different colors are replaced with other supported colors, including the following steps S8242 to S8248:
[0070] S8242, determine the adjacent color areas to which adjacent pixels of different colors belong.
[0071] Specifically, when calculating the closest supporting color of each pixel of the target image, if two adjacent pixels with different pixel values simultaneously approach the same supporting color, first determine the two adjacent color regions where the two pixels are located in the target image.
[0072] S8244, identifying the boundary between adjacent color areas.
[0073] Specifically, a boundary line between two adjacent color regions is obtained, and positions of pixels constituting the boundary line are determined.
[0074] S8246, if the dividing line is a closed curve, the pixel values of the adjacent pixels are replaced with a reference support color; the reference support color is the support color closest to the main color; the main color is the color with the highest proportion in the target image.
[0075] Specifically, based on the position of the dividing line pixel point, determine whether the dividing line is closed. If the dividing line is a closed curve, the two adjacent color areas are in a relationship of inclusion and being included. Replacing them with the same supporting color will cause the boundary of the included color area to be lost. In this case, the included color area can be displayed by converting the color of the dividing line into a reference supporting color. The dividing line pixel point is the adjacent pixel point.
[0076] Preferably, when selecting reference supported colors, the supporting colors of the ink screen can be listed from first to last as alternative reference supported colors according to the approaching color ratio from large to small; the approaching color ratio includes the sum of the proportions of colors in the target image that will be replaced by the supporting color; if the dividing line color is not closest to the first alternative reference supported color, the pixel value of the dividing line is replaced with the pixel value of the first alternative reference supported color; if the dividing line color is closest to the first alternative reference supported color, the pixel value of the dividing line is replaced with the pixel value of the second alternative reference supported color.
[0077] S8248, if the boundary line is a non-closed curve, the pixel values of the adjacent pixels are replaced with the neighborhood support color; the neighborhood support color is the support color corresponding to the color area adjacent to the gap of the boundary line.
[0078] Specifically, if the boundary line is a non-closed curve, the pixel value of the boundary line is replaced by the pixel value of the supporting color that is close to the neighborhood color region adjacent to the gap of the boundary line.
[0079] In an exemplary embodiment, Figure 4 As shown, the image optimization of the natural image by using the dithering algorithm includes the following steps S842 to S848:
[0080] S842, adjusting the color of the natural image according to the saturation of the natural image to obtain an adjusted natural image.
[0081] It is understandable that before the image color conversion, considering the display effect of the ink screen, the target image is first color adjusted, and the color adjustment operation includes saturation adjustment; through saturation adjustment, the color of the target image with lower saturation is made brighter, so that its display effect on the ink screen is better.
[0082] Specifically, in the HSV color space, the saturation of an image is obtained by the following formula:
[0083]
[0084] Among them, S is the saturation; V is the maximum value of the three RGB channels of the target image; m is the minimum value of the three RGB channels of the target image; by adjusting the saturation S in the HSV color space and then mapping it back to the RGB color space, the adjusted natural image is obtained.
[0085] S844, obtaining a scaled pixel value by byte shifting the pixel value of each pixel in the adjusted natural image.
[0086] Specifically, a regular dithering algorithm is used to optimize the target image. The order of the dithering matrix used by the image optimization dithering algorithm can be determined according to the resolution of the ink screen. The higher the order of the dithering matrix, the richer colors the dithering algorithm can simulate, but it will occupy more computing resources, resulting in longer processing time. According to the order of the dithering matrix, the RGB pixel values of the target image are proportionally scaled to facilitate subsequent comparison with the dithering matrix.
[0087] For example, if the resolution of the ink screen is 800×480, an 8th-order Bayer dither matrix can be selected; the 8th-order matrix element values are between 0 and 63, and the RGB values of the target image are between 0 and 255. For the convenience of comparison, the data bytes of the RGB channels of the target image are shifted right by 2 bits to reduce their pixel values by 4 times to obtain scaled pixel values that match the numerical range of the dither matrix.
[0088] S846, compare the scaled pixel value of each pixel point with the jittered pixel value of the corresponding position in the jitter matrix to obtain jittered image data; if the scaled pixel value is greater than the jittered pixel value, the corresponding pixel point takes the value of 1 in the corresponding color channel, otherwise the value is 0.
[0089] Specifically, the horizontal and vertical coordinates of the pixel point are divided by the order of the dither matrix to obtain the remainder as the corresponding position of the pixel point in the dither matrix, and the scaled pixel values of each color channel of the pixel point are compared with the dithered pixel values of the corresponding positions of the dither matrix; if the scaled pixel value is greater than the dithered pixel value, the value of the pixel point in the color channel is 1, otherwise it is 0; finally, the dithered image data is obtained.
[0090] S848, determining the color representation of the jittered image data according to a preset display color table to obtain an optimized target image; the display color table is configured according to the ink screen.
[0091] Specifically, by matching the pixel values of the jittered image data with a preset display color table, the supported colors of each pixel point of the target image displayed on the ink screen can be obtained.
[0092] For example, for a six-color screen of black, white, yellow, red, blue, and green, the display color table is shown in Table 1:
[0093] R G B Display Color 0 0 0 black 0 0 1 blue 0 1 0 green 0 1 1 white 1 0 0 red 1 0 1 white 1 1 0 yellow 1 1 1 white
[0094] Table 1 Six-color screen display color table
[0095] It can be seen from Table 1 that if the (R, G, B) value of a pixel in the jittered image data after optimization is (0, 0, 0), the pixel will be displayed in black on the ink screen; and similarly, the corresponding supported colors of other pixel points after optimization can be obtained as shown in Table 1.
[0096] In an exemplary embodiment, adjusting the color of the natural image according to the saturation of the natural image to obtain the adjusted natural image includes the following steps:
[0097] If the saturation of the natural image is less than a preset value, a saturation gain operation is performed on the natural image according to the resolution and saturation of the ink screen to obtain an adjusted natural image; the saturation gain includes increasing the saturation of the image according to a saturation gain coefficient.
[0098] Specifically, when the saturation of the target natural image is lower than a preset value, a saturation gain coefficient is obtained according to the resolution of the ink screen; performing a saturation gain operation on the natural image according to the saturation gain coefficient can make the colors of the natural image more vivid and bright.
[0099] On the other hand, when the saturation of a natural image is not less than a preset value, performing saturation gain on the natural image may cause oversaturation and portrait distortion problems.
[0100] In an exemplary embodiment, Figure 5 As shown, performing a saturation gain operation on a natural image according to the resolution and saturation of the ink screen includes the following steps S8422 to S8428:
[0101] S8422, determining a dither matrix and a number of simulated colors of a dither algorithm according to a resolution.
[0102] It can be understood that the principle of the dithering algorithm is to use the visual inertia of the human eye to simulate the color display effect of a high color depth device in a low color depth device through a dithering pixel block of the size of a dithering matrix; the larger the order of the dithering matrix, the greater the color depth that can be simulated, and correspondingly, the more colors that can be simulated.
[0103] Specifically, after determining the order of the dither matrix based on the ink screen resolution, the simulated color depth is calculated according to the order of the dither matrix; and then the number of simulated colors is calculated by the simulated color depth. The formula is as follows:
[0104] H s =D s 3
[0105] Among them, H s Indicates the number of simulated colors; D s Indicates simulated color depth, D s Obtained by the following formula:
[0106] D s =n 2
[0107] Where n represents the order of the dither matrix.
[0108] For example, if an 8-order dither matrix is used, the simulated color depth is 64, and the number of simulated colors obtained by combining the three RGB channels is about 260,000.
[0109] S8424, calculating the number of similar colors corresponding to the same simulated color in the natural image.
[0110] It is understandable that when using an 8th-order dithering matrix, the simulated color depth is only 64, which is one-fourth of the channel maximum value of 256. Therefore, colors with RGB values not exceeding 4 will become the same simulated color after being processed by the dithering algorithm. In low-saturation images, the RGB values of the images are less different, and more similar colors will appear. After being processed by the dithering algorithm, the images will become gray and the gradient will be lost.
[0111] Specifically, according to the dither matrix order, the number of similar colors that will become the same simulated color after being processed by the dither algorithm is calculated.
[0112] S8426, obtaining a saturation gain coefficient according to the ratio of the number of similar colors to the total number of colors of the natural image.
[0113] Specifically, the inverse of the ratio of the number of similar colors to the total number of colors in the target image is used as the saturation gain coefficient, and the saturation of the target image is gained in the HSV color space. This not only improves the color vividness of the low-saturation image, but also separates some similar colors, making the gradient color displayed on the ink screen richer.
[0114] Preferably, in order to avoid oversaturation, the saturation gain coefficient cannot be too large, and the allowable value range is limited to 1.0 to 1.8.
[0115] S8428, adjusting the natural image based on the saturation gain coefficient to obtain an adjusted natural image.
[0116] Specifically, in the HSV color space, the saturation is gained by multiplying the original saturation value by the saturation gain coefficient, and after the gain, it is converted back to the RGB color space to obtain the adjusted natural image data, which is convenient for the subsequent dithering algorithm operation.
[0117] It should be understood that although Figure 1-Figure 5 The steps in the step flow chart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0118] In one embodiment, Figure 6 As shown, the present application provides an image optimization device 60 for a color ink screen, the device comprising:
[0119] The data processing module 61 is used to obtain the target image to be displayed on the ink screen and calculate the color distribution of the target image; based on the color distribution, the color concentration of the target image is calculated; the color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors.
[0120] The image classification module 62 is used to classify the target image as a structural image if the color concentration is greater than the adaptive threshold; and to classify the target image as a natural image if the color concentration is not greater than the adaptive threshold.
[0121] The image optimization module 63 is used to optimize the structural image by a color scale algorithm in response to the target image being a structural image; and to optimize the natural image by a dithering algorithm in response to the target image being a natural image; thereby obtaining an optimized target image.
[0122] For the specific definition of an image optimization device for a color ink screen, please refer to the definition of an image optimization method for a color ink screen mentioned above, which will not be repeated here. Each module in the above-mentioned image optimization device for a color ink screen can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0123] In one embodiment, a computer device provided by the present application includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the image optimization methods for a color ink screen provided by the present application are implemented.
[0124] In one embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the image optimization methods for a color ink screen provided in the present application are implemented.
[0125] In one embodiment, a computer program product provided by the present application includes a computer program, which, when executed by a processor, implements the steps of any one of the image optimization methods for a color ink screen provided by the present application.
[0126] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An image optimization method for a color ink screen, characterized in that: include: Obtaining a target image to be displayed on the ink screen, and calculating the color distribution of the target image; Based on the color distribution, calculating the color concentration of the target image; The color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors; If the color concentration is greater than the adaptive threshold, the target image is classified as a structural image; If the color concentration is not greater than the adaptive threshold, the target image is classified as a natural image; The adaptive threshold is obtained according to the supported colors of the ink screen; In response to the target image being a structural image, the structural image is optimized by a color scale algorithm; in response to the target image being a natural image, the natural image is optimized by a dithering algorithm; and an optimized target image is obtained.
2. The method according to claim 1, characterized in that The step of optimizing the structural image by using a color scale algorithm comprises: Calculating the degree of proximity between each pixel in the structural image and the supporting color; The pixel value of the closest supported color is used as the pixel value of the corresponding pixel point to obtain the optimized target image; when adjacent pixels of different colors approach the same supported color, the adjacent pixels of different colors are replaced with other supported colors.
3. The method according to claim 2, characterized in that: When adjacent pixels of different colors approach the same supported color, the step of replacing adjacent pixels of different colors with other supported colors includes: Determine the adjacent color regions to which the adjacent pixels of different colors belong; Identifying a boundary line between adjacent color regions; If the dividing line is a closed curve, the pixel values of the adjacent pixels are replaced with a reference support color; the reference support color is a support color that is closest to the main color; the main color is the color with the highest proportion in the target image; If the dividing line is a non-closed curve, the pixel values of the adjacent pixel points are replaced with a neighborhood support color; the neighborhood support color is a support color corresponding to a color area adjacent to the gap of the dividing line.
4. The method according to claim 1, characterized in that: The step of optimizing the natural image by using a dithering algorithm comprises: Adjusting the color of the natural image according to the saturation of the natural image to obtain an adjusted natural image; The pixel value of each pixel in the adjusted natural image is obtained by byte shifting to obtain a scaled pixel value; Compare the scaled pixel value of each pixel with the jittered pixel value of the corresponding position in the jitter matrix to obtain jittered image data; if the scaled pixel value is greater than the jittered pixel value, the corresponding pixel takes the value of 1 in the corresponding color channel, otherwise the value is 0; According to a preset display color table, the color representation of the jittered image data is determined to obtain the optimized target image; the display color table is configured according to the ink screen.
5. The method according to claim 4, characterized in that: The step of adjusting the color of the natural image according to the saturation of the natural image comprises: If the saturation of the natural image is less than a preset value, a saturation gain operation is performed on the natural image according to the resolution of the ink screen and the saturation to obtain the adjusted natural image; the saturation gain includes increasing the saturation of the image according to a saturation gain coefficient.
6. The method according to claim 5, characterized in that: The step of performing a saturation gain operation on the natural image according to the resolution and saturation of the ink screen comprises: Determining the dither matrix and the number of simulated colors of the dither algorithm according to the resolution; Calculating the number of similar colors corresponding to the same simulated color in the natural image; Obtaining a saturation gain coefficient according to a ratio of the number of similar colors to the total number of colors of the natural image; Based on the saturation gain coefficient, the natural image is adjusted to obtain the adjusted natural image.
7. An image optimization device for a color ink screen, characterized in that: The device comprises: A data processing module, used for acquiring a target image to be displayed on the ink screen, and calculating the color distribution of the target image; based on the color distribution, calculating the color concentration of the target image; the color concentration is obtained by adding the peak-to-valley difference of the color distribution in the color distribution diagram to the inverse of the total number of colors; An image classification module, configured to classify the target image as a structural image if the color concentration is greater than an adaptive threshold; and classify the target image as a natural image if the color concentration is not greater than the adaptive threshold; The image optimization module is used for, in response to the target image being a structural image, optimizing the structural image by a color scale algorithm; in response to the target image being a natural image, optimizing the natural image by a dithering algorithm; and obtaining an optimized target image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Clothing customization image intelligent color correction method and system
CN121437348A