CN113658564B - Image color depth conversion method and electronic equipment - Google Patents

Image color depth conversion method and electronic equipment Download PDF

Info

Publication number
CN113658564B
CN113658564B CN202111002687.9A CN202111002687A CN113658564B CN 113658564 B CN113658564 B CN 113658564B CN 202111002687 A CN202111002687 A CN 202111002687A CN 113658564 B CN113658564 B CN 113658564B
Authority
CN
China
Prior art keywords
gray
scale
gray scale
original
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111002687.9A
Other languages
Chinese (zh)
Other versions
CN113658564A (en
Inventor
梁达鹏
龙凤
石萌
赵晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Beijing BOE Display Technology Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Beijing BOE Display Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd, Beijing BOE Display Technology Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202111002687.9A priority Critical patent/CN113658564B/en
Publication of CN113658564A publication Critical patent/CN113658564A/en
Application granted granted Critical
Publication of CN113658564B publication Critical patent/CN113658564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/36Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source using liquid crystals
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method for converting image color depth and electronic equipment, wherein the method comprises the following steps: acquiring original gray scale data of each pixel in an original image; equally dividing an original gray scale range of an original image into a plurality of continuous gray scale intervals, wherein the gray scale intervals correspond to gray scale values in a target gray scale range of a target image one by one; mapping the gray scale value corresponding to the gray scale interval in which the original gray scale value corresponding to each sub-pixel in the original gray scale data is located to be the target gray scale value of the corresponding pixel in the target image; the color depth of the original image is greater than that of the target image; in the mapping process, when the original gray-scale value corresponding to each sub-pixel in the original gray-scale data is located in the same gray-scale interval, if the gray-scale difference between the original gray-scale values corresponding to any two sub-pixels in the original gray-scale data is greater than a set threshold, the target gray-scale values corresponding to any two sub-pixels in the target image are adjusted to be different gray-scale values.

Description

Image color depth conversion method and electronic equipment
Technical Field
The present invention relates to the field of display, and in particular, to a method for converting image color depth and an electronic device.
Background
In an LCD display screen of the existing Memory In Pixel (MIP) technology, three RGB channels (which may also be referred to as sub-pixels) of each Pixel (Pixel) can only achieve color depths of 1bit each, and the three RGB channels in the main control Android system are usually color depths of 8 bits each. Therefore, when displaying pictures using the MIP LCD display, an image with a high color depth bit number to be displayed needs to be converted into an image with a low color depth bit number, and then the image is transmitted to the MIP LCD display for decoding display.
In the prior art, when an 8-bit color depth image is converted into a 1-bit color depth image, the highest 1bit of 8-bit gray level value binary data of each color of R, G, and B of each sub-pixel in the 8-bit color depth image is extracted as the gray level value of each color of R, G, and B of the corresponding pixel in the 1-bit color depth image, and other binary data bits are discarded.
According to the scheme, the highest bit of the R, G and B sub-pixels of the 8-bit color depth image is extracted to be used as the gray scale value of the R, G and B sub-pixels corresponding to the 1-bit color depth image, when the 8-bit color depth image is converted into the 1-bit color depth image, when the gray scale value of each R, G and B sub-pixel in the 1-bit color depth image is 1, a white picture is displayed, or when the gray scale value of each R, G and B sub-pixel in the 1-bit color depth image is 0, a black picture is displayed, and when the original image (the 8-bit color depth image) is not white or black, the color of the corresponding pixel in the 1-bit color depth image is lost, the appearance of the displayed image is poor, and the popularization effect of the electronic equipment with the MIP LCD display screen is affected.
Therefore, how to reduce the color loss phenomenon when converting an image with high color depth into an image with low color depth is an urgent technical problem to be solved.
Disclosure of Invention
The invention provides a method for converting image color depth and electronic equipment, which are used for solving the technical problem that colors are easy to lose when an image with high color depth is converted into an image with low color depth in the prior art.
In a first aspect, to solve the above technical problem, a technical solution of a method for image color depth conversion provided by an embodiment of the present invention is as follows:
acquiring original gray scale data of each pixel in an original image;
equally dividing the original gray scale range of the original image into a plurality of continuous gray scale intervals, and enabling the gray scale intervals to be in one-to-one correspondence with the gray scale values in the target gray scale range of the target image; mapping gray scale values corresponding to gray scale intervals in which the original gray scale values corresponding to the sub-pixels in the original gray scale data are located to target gray scale values of corresponding pixels in the target image; the color depth of the original image is greater than that of the target image, and the color depth is used for determining the gray scale range of the image;
in the mapping process, when the original gray scale value corresponding to each sub-pixel in the original gray scale data is located in the same gray scale interval, if the gray scale difference of the original gray scale values corresponding to any two sub-pixels in the original gray scale data is larger than a set threshold value, the target gray scale values corresponding to any two sub-pixels in the target image are adjusted to be different gray scale values; the set threshold is used for defining a critical value with larger gray scale difference of two sub-pixels.
One possible embodiment is a method for equally dividing an original gray scale range of an original image into a plurality of continuous gray scale sections, so that the gray scale sections correspond to gray scale values in a target gray scale range of a target image in a one-to-one manner, the method including:
when the original gray scale ranges corresponding to different sub-pixels in the original image are different, dividing the original gray scale range corresponding to each sub-pixel into a plurality of continuous gray scale intervals according to the total number of gray scale values contained in the target gray scale range, and corresponding to the gray scale values in the target gray scale range one by one.
In a possible implementation manner, if the original gray scale intervals in which the original gray scale values of different sub-pixels are located correspond to the same gray scale value in the target gray scale range, it is determined that the original gray scale values of different sub-pixels are located in the same gray scale interval.
In one possible implementation manner, if a gray-scale difference between original gray-scale values corresponding to any two sub-pixels in the original gray-scale data is greater than a preset threshold, adjusting target gray-scale values corresponding to the any two sub-pixels in the target image to different gray-scale values includes:
calculating the difference value of the original gray scale values of any two sub-pixels in the original gray scale data;
if the absolute value of the difference value is larger than the set threshold, setting the target gray-scale value corresponding to the larger original gray-scale value in the two corresponding sub-pixels to be larger than the target gray-scale value corresponding to the smaller original gray-scale value; the target gray-scale values of the larger one and the smaller one are adjacent gray-scale values, and one of the target gray-scale values is the gray-scale value corresponding to the same gray-scale interval.
One possible implementation manner, setting a target gray-scale value corresponding to a larger original gray-scale value of the two corresponding sub-pixels to be larger than a target gray-scale value corresponding to a smaller original gray-scale value of the two corresponding sub-pixels, includes:
and when the larger target gray scale value is the gray scale value corresponding to the same gray scale interval in the target gray scale range, the smaller target gray scale value is the gray scale value corresponding to the gray scale interval of which the level is one lower than the same gray scale interval.
One possible implementation manner, setting a target gray-scale value corresponding to a larger original gray-scale value of the two corresponding sub-pixels to be larger than a target gray-scale value corresponding to a smaller original gray-scale value of the two corresponding sub-pixels, includes:
and when the target gray-scale value of the smaller one is the corresponding gray-scale value of the same gray-scale interval in the target gray-scale range, the target gray-scale value of the larger one is the corresponding gray-scale value of the one-level gray-scale interval higher than the same gray-scale interval.
In one possible embodiment, the set threshold is a product of a size of the gray scale section and a set coefficient.
In one possible embodiment, the setting factor is 1/4.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
a master control system, configured to obtain an original image with a high color depth, and convert the original image into a target image with a low color depth by using the method according to the first aspect.
In one possible implementation, the electronic device further includes:
and the low color depth display screen is used for displaying the target image acquired from the master control system.
In one possible embodiment, the low color depth display comprises a MIP LCD display.
Drawings
Fig. 1 is a flowchart of an image color depth conversion method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a relationship between a gray scale interval of an original gray scale range and a gray scale value of a target gray scale range according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a relationship between a gray scale interval of an original gray scale range and a gray scale value of a target gray scale range according to another embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a relationship between a gray scale interval of an original gray scale range and a gray scale value in a target gray scale range according to another embodiment of the present invention;
FIG. 5 is a comparison diagram of the color depth conversion method for different images according to an embodiment of the present invention;
FIG. 6 is a comparison diagram illustrating the color depth conversion of another different image according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image color depth conversion method and electronic equipment, which are used for solving the technical problem that color is easily lost when an image with high color depth is converted into an image with low color depth in the prior art. Color depth, that is, the depth of color, in an RGB three-channel image, each pixel is composed of three channels, R, G, and B, where each channel is represented by a plurality of binary bits, for example, RGB is 8-bit color depth, and color depth data corresponding to one pixel needs to occupy 24-bit binary bits in total in a computer, for example: 111111110000000000000000, the first 8 binary digits store 8 binary values (all 1) of R, the middle 8 binary digits store 8 binary values (all 0) of G, the last 8 binary digits store 8 binary values (all 0) of B, and corresponding pixels display pure red.
The gray scale is obtained by dividing the brightness variation between the brightest and darkest into several levels, and the more intermediate levels, the more brightness values the sub-pixel can display, and the more colors the corresponding image can display. For example: each sub-pixel in a pixel is 8bit color depth, and one sub-pixel has 2 8 =256 gradations, and the corresponding pixel can display 2 8 ×2 8 ×2 8 =16777216 colors; if each sub-pixel in a pixelAll 1bit color depth, one sub-pixel has only 2 1 =2 gradations, corresponding pixels can display 2 1 ×2 1 ×2 1 =8 colors.
In order to better understand the technical solutions of the present invention, the following detailed descriptions of the technical solutions of the present invention are provided with the accompanying drawings and the specific embodiments, and it should be understood that the specific features in the embodiments and the examples of the present invention are the detailed descriptions of the technical solutions of the present invention, and are not limitations of the technical solutions of the present invention, and the technical features in the embodiments and the examples of the present invention may be combined with each other without conflict.
Referring to fig. 1, an embodiment of the invention provides a method for image color depth conversion, and the processing procedure of the method is as follows.
Step 101: acquiring original gray scale data of each pixel in an original image;
step 102: equally dividing the original gray scale range of the original image into a plurality of continuous gray scale intervals, and enabling the gray scale intervals to correspond to gray scale values in the target gray scale range of the target image one by one; mapping the gray scale value corresponding to the gray scale interval in which the original gray scale value corresponding to each sub-pixel in the original gray scale data is located to be the target gray scale value of the corresponding pixel in the target image; the color depth of the original image is larger than that of the target image, and the color depth is used for determining the gray scale range of the image.
For example, taking the example that each pixel in the original image includes three sub-pixels of R, G and B, the color depth of the image is RGB8, 8-bit, that is, the gray scale range representing that the color depths of the three sub-pixels of R, G and B in the original image are all 8bit, and the 8bit color depth can be represented is 0 ~ (2) 8 -1) (namely the original gray scale range is 0-255), the color depth of the R, G and B sub-pixels in the target image is 2bit, the gray scale range represented by the 2bit color depth is 0-2 2 -1) (i.e. the target gray scale range is 0-3).
Dividing the original gray scale range (0-255) into 4 continuous gray scale intervals (0-63, 64-127, 128-191, 192-255) according to the total number (4) of gray scale values in the target gray scale range, and making the 4 gray scale intervals correspond to the 4 gray scale values in the target gray scale range one by one, as shown in fig. 2, fig. 2 is a schematic diagram of the corresponding relationship between the gray scale intervals in the original gray scale range and the gray scale values in the target gray scale range provided by the embodiment of the present invention.
Since each pixel in the original image is composed of three sub-pixels R, G, and B, the original gray scale data of each pixel includes the original gray scale values corresponding to the three sub-pixels. For example, the original gray scale values corresponding to the R, G, B sub-pixels in a pixel are 31, 121, 195 in sequence, and the gray scale intervals in which they are located in the original gray scale range are 0-63, 64-127, 192-255 in sequence, according to the corresponding relationship in fig. 2, the gray scale intervals in which the original gray scale values corresponding to the R, G, B sub-pixels in the pixel are located are mapped to the target gray scale values (0, 1,3 in sequence) in the target image, and in the same way, the original gray scale data of each pixel in the original image can be converted to the target gray scale data (composed of the target gray scale values of each sub-pixel) of the corresponding pixel in the target image, thereby realizing the conversion of the high color depth image into the low color depth image and satisfying the color depth requirement of the display screen.
In one possible embodiment, the original gray scale range of the original image is equally divided into a plurality of continuous gray scale intervals, so that the gray scale intervals correspond to gray scale values in the target gray scale range of the target image one by one, and the following method can be further implemented:
when the original gray scale ranges corresponding to different sub-pixels in the original image are different, dividing the original gray scale range corresponding to each sub-pixel into a plurality of continuous gray scale intervals according to the total number of gray scale values contained in the target gray scale range, and corresponding to the gray scale values in the target gray scale range one by one.
For example, still take the case that each pixel in the original image includes three sub-pixels of R, G, and B, the color depth of the image is RGB5,6,5-bit, which means that the color depths of the two sub-pixels of R and B in the original image are both 5 bits, the corresponding original gray scale range is 0 to 31, the color depth of the sub-pixel of G in the original image is both 6 bits, and the corresponding original gray scale range is 0 to 63. Suppose the color depth of three sub-pixels in the target image is 1bit, and the corresponding target gray scale range is 0-1 (including 2 gray scale values). At this time, the original gray scale range (0-31) is divided into 2 gray scale sections (0-15, 16-31) and the original gray scale range (0-63) is divided into 2 gray scale sections (0-31, 32-63) and is in one-to-one correspondence with the gray scale values in the target gray scale range, as shown in fig. 3, which is a schematic diagram of a correspondence relationship between the gray scale section of another original gray scale range and the gray scale values in the target gray scale range according to an embodiment of the present invention.
If the original gray scale values corresponding to the three sub-pixels R, G, and B in a pixel are 5, 31, and 28 in sequence, and the gray scale intervals in which they are located in the corresponding original gray scale ranges are 0 to 15, 0 to 31, and 16 to 31 in sequence, the gray scale values in the target gray scale range corresponding to the gray scale intervals in which the original gray scale values corresponding to the three sub-pixels R, G, and B in the pixel are mapped to the target gray scale values (0, and 1 in sequence) in the target image according to the corresponding relationship in fig. 3, the original gray scale data of each pixel in the original image can be converted into the target gray scale data of the corresponding pixel in the target image in the same manner.
Step 103: in the mapping process, when the original gray-scale value corresponding to each sub-pixel in the original gray-scale data is located in the same gray-scale interval, if the gray-scale difference of the original gray-scale values corresponding to any two sub-pixels in the original gray-scale data is larger than a set threshold value, the target gray-scale values corresponding to any two sub-pixels in the target image are adjusted to be different gray-scale values; the threshold is set for defining a critical value with larger gray scale difference of the two sub-pixels.
For example, a pixel in the original image includes three subpixels R, G, and B, the color depth is 8 bits, the original gray scale values thereof are 63, 32, and 28 in sequence, the set threshold is 16, and the color depth of each subpixel in the target image is 2 bits, so that according to the correspondence shown in fig. 2, it can be determined that the original gray scale values 63, 32, and 28 are all located in the same gray scale interval (0 to 63), so that the corresponding target gray scale values thereof are the same (all 0).
In order to reduce color loss, it is further determined whether the gray scale difference of the original gray scale values corresponding to any two sub-pixels of the three sub-pixels R, G, and B in the pixel is larger, and if so, the gray scale values are adjusted to be different, for example, it is determined whether the gray scale difference (31) of the original gray scale values (63, 32) corresponding to R and G is larger than a set threshold (16), and if so, it is determined that the difference of the original gray scale values of R and G is larger, and the target gray scale values of R and G are adjusted to be different (for example, the target gray scale value of G is 0, and the target gray scale value of R is adjusted to be 1); then, original gray scale values (63, 28) corresponding to R and B are judged, the gray scale difference corresponding to R and B is 35 (larger than a set threshold value 16), the gray scale values of R and B are adjusted to be different (if the target gray scale value of R is adjusted to be 1 in the last comparison, B is set to be 0); and continuously judging the original gray scale values (32 and 28) corresponding to the G and the B, wherein the gray scale difference corresponding to the G and the B is 4 (smaller than a set threshold value 16), and not adjusting, so far, performing pairwise gray scale difference judgment on the three sub-pixels. Therefore, it can be finally determined that the original gray-scale values (63, 32, 28) of R, G, B correspond to the target gray-scale values in the target image as 1, 0 in order. Similarly, the manner of converting the original gray scale data of other pixels in the original image into the target gray scale data in the target image is not repeated here.
In the embodiment provided by the invention, in the process of converting an original image with high color depth into a target image with low color depth, when the original gray-scale value corresponding to each sub-pixel in the original gray-scale data is located in the same gray-scale interval, the sub-pixels with the gray-scale difference of the original gray-scale values corresponding to any two sub-pixels in the original gray-scale data larger than the set threshold value are adjusted to be different, so that the two sub-pixels with the larger gray-scale difference in the original gray-scale data form the difference in the target gray-scale value of the target image, thereby reducing the color loss.
In one possible embodiment, if the original gray scale interval in which the original gray scale values of different sub-pixels are located corresponds to the same gray scale value in the target gray scale range, it is determined that the original gray scale values of different sub-pixels are located in the same gray scale interval.
For the condition that the color depths of the sub-pixels contained in the pixels in the original image are the same, whether the original gray scale values of the sub-pixels are in the same target gray scale range can be determined directly through whether the gray scale intervals corresponding to the sub-pixels are the same or not; for the situation that the color depth of the sub-pixels included in the pixels in the original image is different, it is necessary to determine whether the original gray scale values of the different sub-pixels are in the same target gray scale range according to whether the gray scale values in the target gray scale range corresponding to the original gray scale interval in which the original gray scale values of the different sub-pixels are located are the same.
For example, still take the case that each pixel in the original image includes three sub-pixels R, G, and B, the color depth of the image is RGB5,6,5-bit, the color depth of the target image is 1bit, and assuming that the set threshold is 4, and the original gray scale values of the three sub-pixels R, G, and B in one pixel in the original image are 13, 28, and 5 in sequence, according to the corresponding relationship in fig. 3, the gray scale intervals in which the original gray scale values of the three sub-pixels R, G, and B in the pixel are located are 0 to 15, 0 to 31, and 0 to 15 in sequence, and the corresponding target gray scale values are all 0, so that it can be determined that the original gray scale values of the three sub-pixels R, G, and B in the pixel are all located in the same gray scale interval.
Determining gray scale differences of R (13) and G (28), R and B (5) and G and B as 5, 8 and 23 in sequence, wherein the gray scale differences are all larger than a set threshold (4), and for R (13) and G (28), adjusting for the first time: adjusting the target gray-scale values of R and G to be different (G is adjusted to be 1, R is kept to be 0); for R (13) and B (5), second adjustment: adjusting the target gray scale values of R and B to be different (R is adjusted to be 1, B is kept to be 0); for G (28) and B (5), third adjustment: since the target gray-scale values of G and B are adjusted to be different (G is 1 and B is 0), the target gray-scale values corresponding to R (13), G (28) and B (5) are finally determined to be 1, 1 and 0 in this order.
It should be understood that, in the embodiments provided by the present invention, the comparison order of the original gray-scale values of the sub-pixels included in the pixels of the original image may be arbitrary, for example, when the pixels of the original image include R, G, and B sub-pixels, the comparison may be performed sequentially according to the order of R and G, R and B, and G and B, or may be performed sequentially according to the order of G and B, R and B, and R and G, and it is better to perform the comparison sequentially according to the order of R and G, R and B, and G and B in terms of the actual display effect.
In a possible embodiment, if the gray scale difference between the original gray scale values corresponding to any two sub-pixels in the original gray scale data is greater than the set threshold, the target gray scale values corresponding to any two sub-pixels in the target image are adjusted to different gray scale values, which can be implemented by:
calculating the difference value of the original gray scale values of any two sub-pixels in the original gray scale data; if the absolute value of the difference value is larger than the set threshold value, setting the target gray-scale value corresponding to the larger original gray-scale value in the two corresponding sub-pixels to be larger than the target gray-scale value corresponding to the smaller original gray-scale value; the target gray-scale values of the larger one and the smaller one are adjacent gray-scale values, and one of the target gray-scale values is a gray-scale value corresponding to the same gray-scale interval.
For example, taking an example that each pixel in the original image includes three sub-pixels R, G, and B, the color depth of each pixel in the image includes 8 bits of sub-pixel, the color depth of each pixel in the target image includes 1bit, and the threshold is set to 32, the correspondence between the gray scale interval of the original gray scale range of the original image and the gray scale value of the target gray scale range of the target image is shown in fig. 4, and fig. 4 is a schematic diagram of the correspondence between the gray scale interval of another original gray scale range and the gray scale value in the target gray scale range according to the embodiment of the present invention.
The original gray scale values of R, G and B contained in one pixel in the original image are 20, 15 and 100 in sequence, and for the first time: calculating the difference between R and G to be 20-15= -5, wherein the absolute value of the difference (-5) is 5 (smaller than the set threshold value 32), so that the target gray-scale values corresponding to R and G do not need to be adjusted; and (3) for the second time: calculating the difference between R and B to be 20-100= -80, the absolute value of the difference (-80) is 80 (is larger than a set threshold 32), adjusting the target gray-scale values of R and B to be different, because the original gray-scale value (20) of R is smaller than the original gray-scale value (100) of B, the original gray-scale value of R in R and B is smaller, the original gray-scale value of B is larger, keeping the target gray-scale value of R at 0, and adjusting the target gray-scale value of B to be 1; and thirdly: calculating the difference between G and B as 15-100= -85, the absolute value of the difference (-85) is 85 (greater than the set threshold 32), setting the target gray-scale values of G and B as different, because the original gray-scale value (15) of G is smaller than the original gray-scale value (100) of B, the original gray-scale value of G is smaller than the original gray-scale value of B, the original gray-scale value of B is larger, keeping the target gray-scale value of G as 0, and adjusting the target gray-scale value of B as 1. And finally obtaining target gray-scale values of R, G and B which are 0, 0 and 1 in sequence.
The target gray-scale value corresponding to the larger original gray-scale value in the two corresponding sub-pixels is set to be larger than the target gray-scale value corresponding to the smaller original gray-scale value, and the method can also be realized by the following steps:
when the larger target gray scale value is the corresponding gray scale value of the same gray scale interval in the target gray scale range, the smaller target gray scale value is the corresponding gray scale value of the gray scale interval which is lower than the one-level gray scale interval of the same gray scale interval.
For example, taking an example that each pixel in the original image includes three sub-pixels of R, G, and B, the color depth of each sub-pixel included in the image is 8 bits, the color depth of each sub-pixel included in the target image is 2 bits, and the threshold is set to be 16.
In an original image, the original gray-scale values of three sub-pixels of R, G and B of a pixel are 120, 85 and 95 in sequence, the three sub-pixels are all located in a 64-127 gray-scale interval (corresponding to the gray-scale value 1 in a target gray-scale range) in the original gray-scale range, the gray-scale differences of R, G, R, B and G are 35 (larger than a set threshold value 16), 25 (larger than a set threshold value 16) and 10 (smaller than a set threshold value 16) in sequence, the target gray-scale values of R, G, R and B need to be adjusted once, the target gray-scale values of R and G are firstly adjusted to be different, and specifically, during adjustment, if the larger target gray-scale value is adjusted to be the corresponding gray-scale value of the gray-scale interval in the target gray-scale range (namely, the target gray-scale value of R is adjusted to be 1), the target gray-scale value of a smaller target gray-scale should be set to be the corresponding gray-scale interval (0-scale value of G-scale interval) in the target gray-scale range which is one level lower than the gray-scale interval in which the smaller gray-scale interval (namely, the target gray-scale interval), the target gray-scale interval is adjusted to be 0-scale value of G; secondly, the target gray scale values of R and B are adjusted to be different, specifically, during adjustment, if the larger target gray scale value is adjusted to be the gray scale value corresponding to the target gray scale range in the gray scale interval (i.e. the target gray scale value of R is adjusted to be 1), the smaller target gray scale value is set to be the gray scale value corresponding to the target gray scale range (i.e. the target gray scale value of B is adjusted to be 0) in the gray scale interval (0-63) which is one level lower than the gray scale interval in which the smaller target gray scale value is one level, and finally the target gray scale values corresponding to R, G and B can be determined to be 1, 0 and 0 in sequence.
One possible implementation manner is to set the target gray-scale value corresponding to the larger original gray-scale value of the two corresponding sub-pixels to be larger than the target gray-scale value corresponding to the smaller original gray-scale value, and can also be implemented by the following manners:
when the smaller target gray scale value is the corresponding gray scale value of the same gray scale interval in the target gray scale range, the larger target gray scale value is the corresponding gray scale value of the gray scale interval which is one level higher than the same gray scale interval.
For example, taking the example that each pixel in the original image includes three subpixels, i.e., R, G, and B, each pixel in the image includes a subpixel having a color depth of 8 bits, each pixel in the target image includes a subpixel having a color depth of 2 bits, and the threshold is set to be 16.
In an original image, original gray scale values of three sub-pixels of R, G and B of a pixel are 120, 85 and 95 in sequence, the three sub-pixels are located in a gray scale interval of 64-127 (corresponding to a gray scale value 1 in a target gray scale range), gray scale differences between R and G, between R and B, between G and B are 35, 25 and 10 in sequence, the R and G, between R and B need to be adjusted once, the target gray scale values of R and G are firstly adjusted to be different, and specifically, when the target gray scale value of a smaller one is adjusted to be a gray scale value corresponding to a gray scale interval in the target gray scale range (namely, the target gray scale value of G is adjusted to be 1), the target gray scale value of a larger one is set to be a gray scale value corresponding to a gray scale interval (128-191) which is one level higher than the target gray scale interval in the target gray scale interval (namely, the target gray scale value of R is adjusted to be 2); secondly, the target gray-scale values of R and B are adjusted to be different, specifically, during adjustment, if the smaller target gray-scale value is adjusted to be the corresponding gray-scale value of the gray-scale interval in the target gray-scale range (i.e. the target gray-scale value of B is adjusted to be 1), the larger target gray-scale value should be set to be the corresponding gray-scale value of the gray-scale interval (128-191) one level higher than the gray-scale interval in the target gray-scale range (i.e. the target gray-scale value of R is adjusted to be 2). Therefore, the target gray-scale values corresponding to R, G and B are finally determined to be 2, 1 and 1 in sequence.
When the gray scale interval in which the original gray scale value of the sub-pixel is located is the highest gray scale interval in the original gray scale range, the larger target gray scale value can only be adjusted to be the corresponding gray scale value of the same gray scale interval in the target gray scale range, and the smaller target gray scale value is the corresponding gray scale value of the gray scale interval one level lower than the same gray scale interval.
When the gray scale interval in which the original gray scale value of the sub-pixel is located is the lowest gray scale interval in the original gray scale range, the smaller target gray scale value can only be adjusted to be the corresponding gray scale value of the same gray scale interval in the target gray scale range, and the larger target gray scale value is the corresponding gray scale value of the gray scale interval which is one level higher than the same gray scale interval.
In the embodiment provided by the present invention, the set threshold is the product of the size of the gray scale interval and the set coefficient.
For example, in the example shown in fig. 2, the gray scale sections 0 to 63 are 64 (the remaining three gray scale sections are equal in size and may be any one of them), and the threshold is set to 64 × k when the coefficient is set to k. k is a decimal number.
Preferably, the set coefficient is 1/4.
Such as: if the threshold is set to 64 × k and k is a set coefficient, the threshold is set to 64 × 0.25=16.
As shown in fig. 3, the set threshold corresponding to the original gray scale range 0 to 31 is 16 × 0.25=4, the set threshold corresponding to the other original gray scale range 0 to 64 is 32 × 0.25=8, and the set threshold to be finally used is the minimum of the plurality of set thresholds (4). That is, the setting threshold value to be finally used is the minimum one of the plurality of determined setting threshold values for different original gray scale ranges corresponding to different sub-pixels in the pixel.
Referring to fig. 5 and fig. 6, fig. 5 is a comparison graph of an effect of a color depth conversion method for different images according to an embodiment of the present invention, and fig. 6 is a comparison graph of an effect of a color depth conversion method for different images according to another embodiment of the present invention.
As can be seen from fig. 5, the face of the piglet in the original image is not white, and after the original image with high color depth is converted into the target image with low color depth by using the prior art, the face of the piglet is white, and after the original image is converted into the target image with low color depth by using the method of the present application, the face of the piglet is not white, that is, the method of the present invention can reduce color loss, especially corresponding to the target image with 1bit color depth, and can prevent the colored region in the original image from being displayed as black or white after being converted into the image with low color depth.
With continued reference to fig. 6, in the original image, the fundus of the puppy (the area within the dotted line in the figure) is not white, and after the original image with high color depth is converted into the target image with low color depth by the method of the prior art, the fundus of the puppy is white, while after the original image is converted into the target image with low color depth by the method of the present application, the fundus of the puppy is not white, that is, the method of the present invention can reduce color loss.
It should be understood that the original image and the target image in the embodiment of the present invention are actually color images, and are only limited to the color images that cannot be used in the drawings, but grayscale images are used, and when actually displayed, the color images have a display effect. The difference will be more pronounced. In addition, the effect of the target image displayed on the low color depth display screen in fig. 5 and 6.
In the embodiment provided by the invention, the setting of the threshold has a great influence on the image conversion effect. If the set threshold value is large, the original gray scale value with large gray scale difference is difficult to distinguish, and the function of keeping picture information cannot be achieved; if the threshold is set to be small, the difference of the colors of the parts with small gray scale difference (close) is increased, and the picture display is distorted. The set threshold is set to 1/4 of the original gray scale range with a larger single gray scale interval, so that more picture information can be reserved, and parts with similar gray scales can be normally displayed without distortion.
In the embodiment provided by the invention, when the color depth of the target image is 1bit, if the original gray-scale values of the sub-pixels in the pixel of the original image are all located in the same gray-scale interval, the target gray-scale values of two pixels of which the gray-scale difference between the original gray-scale values of any two sub-pixels in the pixel is greater than the set threshold value are set to be different, one corresponding target gray-scale value with a relatively low original gray-scale value is adjusted to be 0, and one target gray-scale value with a relatively high original gray-scale value is adjusted to be 1, so that the problem that the target gray-scale values of the sub-pixels in one gray-scale interval in the original gray-scale range are set to be the same value to display white or black and lose colors is solved.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, please refer to fig. 7, which includes:
the main control system 701 is configured to obtain an original image with a high color depth, and convert the original image into a target image with a low color depth by using the image color depth conversion method described above. For a specific implementation of the image color depth conversion method, reference may be made to the description of the method embodiment, and repeated descriptions are omitted here.
In one possible implementation, the electronic device further includes:
and a low color depth display screen 702, configured to display the target image acquired from the master control system.
In one possible embodiment, the low color depth display comprises a MIP LCD display.
The electronic device may be a television, a display, a handheld device, and the like, and is not limited specifically.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (11)

1. A method of image color depth conversion, comprising:
acquiring original gray scale data of each pixel in an original image;
equally dividing the original gray scale range of the original image into a plurality of continuous gray scale intervals, and enabling the gray scale intervals to be in one-to-one correspondence with the gray scale values in the target gray scale range of the target image; mapping gray scale values corresponding to gray scale intervals in which the original gray scale values corresponding to the sub-pixels in the original gray scale data are located to be target gray scale values of the corresponding pixels in the target image; the color depth of the original image is greater than that of the target image, and the color depth is used for determining the gray scale range of the image;
in the mapping process, when the original gray scale value corresponding to each sub-pixel in the original gray scale data is located in the same gray scale interval, if the gray scale difference of the original gray scale values corresponding to any two sub-pixels in the original gray scale data is larger than a set threshold value, the target gray scale values corresponding to any two sub-pixels in the target image are adjusted to be different gray scale values; the set threshold is used for defining a critical value with larger gray scale difference of two sub-pixels.
2. The method of claim 1, wherein equally dividing the original gray scale range of the original image into a plurality of consecutive gray scale intervals, such that the gray scale intervals correspond to gray scale values in a target gray scale range of a target image in a one-to-one manner, comprises:
when the original gray scale ranges corresponding to different sub-pixels in the original image are different, dividing the original gray scale range corresponding to each sub-pixel into a plurality of continuous gray scale intervals according to the total number of gray scale values contained in the target gray scale range, and corresponding to the gray scale values in the target gray scale range one by one.
3. The method of claim 2, wherein if the original gray scale intervals in which the original gray scale values of different sub-pixels are located correspond to the same gray scale value in the target gray scale range, it is determined that the original gray scale values of the different sub-pixels are located in the same gray scale interval.
4. The method of any one of claims 1 to 3, wherein if the gray scale difference between the original gray scale values of any two sub-pixels in the original gray scale data is greater than a predetermined threshold, adjusting the target gray scale values of the any two sub-pixels in the target image to different gray scale values comprises:
calculating the difference value of the original gray scale values of any two sub-pixels in the original gray scale data;
if the absolute value of the difference value is larger than the set threshold value, setting the target gray-scale value corresponding to the larger original gray-scale value in the two corresponding sub-pixels to be larger than the target gray-scale value corresponding to the smaller original gray-scale value; the target gray-scale values of the larger one and the smaller one are adjacent gray-scale values, and one of the target gray-scale values is the gray-scale value corresponding to the same gray-scale interval.
5. The method of claim 4, wherein setting a target gray-scale value corresponding to a larger one of the original gray-scale values of the corresponding two sub-pixels to be greater than a target gray-scale value corresponding to a smaller one of the original gray-scale values of the corresponding two sub-pixels comprises:
and when the larger target gray-scale value is the corresponding gray-scale value of the same gray-scale interval in the target gray-scale range, the smaller target gray-scale value is the corresponding gray-scale value of the gray-scale interval which is one level lower than the same gray-scale interval.
6. The method of claim 4, wherein setting a target gray-scale value corresponding to a larger one of the original gray-scale values of the corresponding two sub-pixels to be greater than a target gray-scale value corresponding to a smaller one of the original gray-scale values of the corresponding two sub-pixels comprises:
and when the target gray-scale value of the smaller one is the corresponding gray-scale value of the same gray-scale interval in the target gray-scale range, the target gray-scale value of the larger one is the corresponding gray-scale value of the one-level gray-scale interval higher than the same gray-scale interval.
7. The method of claim 4, wherein the set threshold is a product of a size of the gray scale section and a set coefficient.
8. The method of claim 7, wherein the set factor is 1/4.
9. An electronic device, comprising:
a master control system for acquiring an original image of high color depth and converting the original image into a target image of low color depth using the method of any one of claims 1-8.
10. The electronic device of claim 9, further comprising:
and the low color depth display screen is used for displaying the target image acquired from the master control system.
11. The electronic device of claim 10, wherein the low color depth display screen comprises a MIP LCD display screen.
CN202111002687.9A 2021-08-30 2021-08-30 Image color depth conversion method and electronic equipment Active CN113658564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111002687.9A CN113658564B (en) 2021-08-30 2021-08-30 Image color depth conversion method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111002687.9A CN113658564B (en) 2021-08-30 2021-08-30 Image color depth conversion method and electronic equipment

Publications (2)

Publication Number Publication Date
CN113658564A CN113658564A (en) 2021-11-16
CN113658564B true CN113658564B (en) 2022-12-13

Family

ID=78482386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111002687.9A Active CN113658564B (en) 2021-08-30 2021-08-30 Image color depth conversion method and electronic equipment

Country Status (1)

Country Link
CN (1) CN113658564B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114244968B (en) * 2021-12-20 2024-01-09 北京镁伽科技有限公司 Image conversion method, image conversion device and image signal generator
CN114268704A (en) * 2021-12-20 2022-04-01 北京镁伽科技有限公司 Image data conversion method, conversion device, signal generator, and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5410617A (en) * 1991-04-25 1995-04-25 Unisys Corporation Method for adaptively thresholding grayscale image data
JP2002156951A (en) * 2000-08-14 2002-05-31 Canon Inc Display device
TW200601249A (en) * 2004-06-17 2006-01-01 Matsushita Electric Tw Co Ltd Luminance compensation and frame quality correction method to increase frame contrast and LCD used the method
CN101256751A (en) * 2008-04-03 2008-09-03 上海广电光电子有限公司 Method for improving color depth of LCD device
CN101668107A (en) * 2008-09-04 2010-03-10 中国移动通信集团公司 Method, system and device for transforming color depth and transmitting image after color depth transformation
JP2013141123A (en) * 2012-01-04 2013-07-18 Fujifilm Corp Correction method of pixel data, image processing apparatus, program and image formation apparatus
CN103530896A (en) * 2013-09-25 2014-01-22 电子科技大学 Image compression and detail enhancement method for infrared image
CN103843058A (en) * 2011-09-27 2014-06-04 皇家飞利浦有限公司 Apparatus and method for dynamic range transforming of images
CN104732952A (en) * 2013-12-23 2015-06-24 昆山国显光电有限公司 Color display processing method and system
CN106652955A (en) * 2017-01-04 2017-05-10 京东方科技集团股份有限公司 Drive circuit of display screen, display method and display device
CN109801240A (en) * 2019-01-15 2019-05-24 武汉鸿瑞达信息技术有限公司 A kind of image enchancing method and image intensifier device
CN111563851A (en) * 2020-03-27 2020-08-21 中国科学院西安光学精密机械研究所 Image mapping method based on dynamic Gaussian parameters

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9251732B2 (en) * 2013-02-20 2016-02-02 Spreadtrum Communications (Shanghai) Co., Ltd. Method and system for image dithering

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5410617A (en) * 1991-04-25 1995-04-25 Unisys Corporation Method for adaptively thresholding grayscale image data
JP2002156951A (en) * 2000-08-14 2002-05-31 Canon Inc Display device
TW200601249A (en) * 2004-06-17 2006-01-01 Matsushita Electric Tw Co Ltd Luminance compensation and frame quality correction method to increase frame contrast and LCD used the method
CN101256751A (en) * 2008-04-03 2008-09-03 上海广电光电子有限公司 Method for improving color depth of LCD device
CN101668107A (en) * 2008-09-04 2010-03-10 中国移动通信集团公司 Method, system and device for transforming color depth and transmitting image after color depth transformation
CN103843058A (en) * 2011-09-27 2014-06-04 皇家飞利浦有限公司 Apparatus and method for dynamic range transforming of images
JP2013141123A (en) * 2012-01-04 2013-07-18 Fujifilm Corp Correction method of pixel data, image processing apparatus, program and image formation apparatus
CN103530896A (en) * 2013-09-25 2014-01-22 电子科技大学 Image compression and detail enhancement method for infrared image
CN104732952A (en) * 2013-12-23 2015-06-24 昆山国显光电有限公司 Color display processing method and system
CN106652955A (en) * 2017-01-04 2017-05-10 京东方科技集团股份有限公司 Drive circuit of display screen, display method and display device
CN109801240A (en) * 2019-01-15 2019-05-24 武汉鸿瑞达信息技术有限公司 A kind of image enchancing method and image intensifier device
CN111563851A (en) * 2020-03-27 2020-08-21 中国科学院西安光学精密机械研究所 Image mapping method based on dynamic Gaussian parameters

Also Published As

Publication number Publication date
CN113658564A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
US11900852B2 (en) Method and device for obtaining display compensation information, and display compensation method and device
CN113658564B (en) Image color depth conversion method and electronic equipment
CN108962126B (en) Display panel driving method and system and display device comprising same
CN107408367B (en) Method, device and system for correcting unevenness of display screen
CN108766372B (en) Method for improving mura phenomenon of display panel
US7317462B2 (en) Method for luminance compensation of liquid crystal display and its device
CN111916031B (en) Display method and display device
KR100554580B1 (en) Image processing apparatus, image processing method, image display apparatus, and mobile electronic device
US7796144B2 (en) Gamma correction device of display apparatus and method thereof
US5734362A (en) Brightness control for liquid crystal displays
CN109313878B (en) Display device and display device control method
WO2020098624A1 (en) Display method and apparatus, vr display apparatus, device, and storage medium
CN114067724A (en) Gray scale data processing method, device and system and display device
US8159512B2 (en) Method of driving a display
WO2022032919A1 (en) Grayscale-adaptive correction data control method and apparatus, and led display screen
CN113380170B (en) Display compensation method and device of display panel, display device and medium
CN108898987B (en) Gray scale conversion method, gray scale conversion device and display device
CN111899690A (en) Method and device for improving low-brightness Mura
KR100492555B1 (en) Method and apparatus for converting image
CN115346475A (en) LED display control method, control device, electronic device and storage medium
CN106408535B (en) A kind of image enchancing method based on sub-line driving gray modulation display system
CN101097688B (en) Method and apparatus for driving a display device with variable reference driving signals
KR20190017282A (en) Tone mapping method and display device using the same
KR100508306B1 (en) An Error Diffusion Method based on Temporal and Spatial Dispersion of Minor Pixels on Plasma Display Panel
JP2003076341A (en) Sequential color display device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant