Method and apparatus for luminance conversion of rgb
By optimizing the RGB brightness conversion method and using the RGB-to-brightness formula and coefficient ratio calculation, the problem of insufficient color vibrancy in display panels or ambient lights has been solved, achieving efficient color performance and cost reduction.
Patent Information
- Application Number
- CN202310729755.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-06-16
AI Technical Summary
Existing display panels or ambient lights suffer from limited color vibrancy and poor color performance due to limitations in the driver SDK or hardware computing power.
By obtaining the brightness values and coefficients yr1, yg1, and yb1 of the color channels R, G, and B, the brightness Y0 is calculated using the RGB-to-brightness formula, and the coefficient ratios are calculated to obtain the proportion values Ar, Ag, and Ab. The preset brightness value P is then adjusted to optimize the brightness conversion process and reduce the computational difficulty and accuracy requirements.
It improves color performance, expands the scope of application, reduces production costs, and is suitable for both high and low precision hardware and software, meeting users' needs for vibrant colors.
Smart Images

Figure CN116778843B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display technology, specifically to a method and apparatus for RGB brightness conversion. Background Technology
[0002] With the progress of the times and the development of technology, people have increasingly strict requirements for the appearance of products. Therefore, the display panel or ambient light set on the outside of the product needs to have the function of adjusting the brightness at any time so as to adjust it according to the user's needs.
[0003] Most current display panels or ambient lights use red (R) sub-pixel units, green (G) sub-pixel units, and blue (B) sub-pixel units to form a single pixel unit. By controlling the R data of the red sub-pixel unit, the G data of the green sub-pixel unit, and the B data of the blue sub-pixel unit, the desired color is mixed to display a color image. However, due to the limited computing power of some SDKs (Software Development Kits) or hardware in existing drivers, the vibrancy of the colors presented is affected, resulting in poor color performance. Summary of the Invention
[0004] To overcome the shortcomings of the prior art, this application provides a method and apparatus for RGB brightness conversion.
[0005] The specific technical solution is as follows:
[0006] A method for converting brightness to RGB includes:
[0007] Step A: Obtain the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted; obtain the updated coefficients yr1 for color channel R, yg1 for color channel G, and yb1 for color channel B.
[0008] Step B: Substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0.
[0009] Step C: Determine whether R0, G0, and B0 are all non-zero; if R0 equals 0, update yr1 again and assign yr1 the value of 0; if G0 equals 0, update yg1 again and assign yg1 the value of 0; if B0 equals 0, update yb1 again and assign yb1 the value of 0.
[0010] Step D: Calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ;
[0011] Step E, based on R0, G0, B0, yr1, yg1, yb1, A r A g A b Given Y0 and the preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1 and color channel B value B1;
[0012] Step F: Determine whether R1, G1, and B1 are all non-zero. If R1, G1, and B1 are all non-zero, record R1, G1, and B1. If any one of R1, G1, and B1 is zero, update P, and based on the updated P, execute step E to update R1, G1, and B1.
[0013] Step G, based on the recorded R1, G1, and B1, is displayed.
[0014] In one embodiment, the formula for calculating the coefficient ratio is:
[0015]
[0016]
[0017]
[0018] In one embodiment, the formula for calculating R1 is R1=(((P×R0×yr×100) / Y0)×10 / A r );
[0019] The formula for calculating G1 is G1=(((P×G0×yg×100) / Y0)×10 / A g );
[0020] The formula for calculating B1 is B1=(((P×B0×yb×100) / Y0)×10 / A b ).
[0021] In one embodiment, if any of R1, G1, and B1 equals 0, update P, including:
[0022] If any of R1, G1, and B1 equals 0, add 1 to the original P value to obtain the updated P value.
[0023] In one embodiment, the method further includes the following steps prior to step A:
[0024] Update the coefficients yr0 of color channel R to yr1, yg0 of color channel G to yg1, and yb0 of color channel B to yb1, where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values.
[0025] In one embodiment, updating the coefficients yr0 and yr1 of color channel R, yg0 and yg1 of color channel G, and yb0 and yb1 of color channel B includes:
[0026] The coefficient yr0 of color channel R is multiplied by 1000 and then used as yr1;
[0027] The coefficient yg0 of color channel G is multiplied by 1000 and then used as yg1;
[0028] The coefficient yb0 of color channel B is multiplied by 1000 and then used as yb1.
[0029] In one embodiment, yr0 equals 0.299;
[0030] yg0 equals 0.587;
[0031] yb0 equals 0.144.
[0032] In one embodiment, the luminance Y0 is the Y component representing the image luminance in the YIQ color space.
[0033] A device for converting brightness to RGB, comprising:
[0034] The first acquisition module is used to acquire the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted, and is also used to acquire the updated coefficients yr1 of color channel R, yg1 of color channel G, and yb1 of color channel B.
[0035] The second acquisition module is used to substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0.
[0036] The first judgment module is used to determine whether R0, G0 and B0 are all not equal to 0; if R0 is equal to 0, then yr1 is updated again and yr1 is assigned the value 0; if G0 is equal to 0, then yg1 is updated again and yg1 is assigned the value 0; if B0 is equal to 0, then yb1 is updated again and yb1 is assigned the value 0.
[0037] The first calculation module is used to calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ;
[0038] The second calculation module is used to calculate based on R0, G0, B0, yr1, yg1, yb1, and A.r A g A b Given Y0 and the preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1 and color channel B value B1;
[0039] The second judgment module is used to determine whether R1, G1 and B1 are all not equal to 0. If R1, G1 and B1 are all not equal to 0, record R1, G1 and B1. If one of R1, G1 and B1 is equal to 0, update P, and based on the updated P, drive the second calculation module to update R1, G1 and B1.
[0040] The display module is used for displaying R1, G1, and B1 based on records.
[0041] In one embodiment, an initial module is also included;
[0042] The initial module is used to update the coefficients yr0 of color channel R to yr1, yg0 of color channel G to yg1, and yb0 of color channel B to yb1, where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values.
[0043] This application has at least the following beneficial effects:
[0044] This application provides a method and apparatus for converting brightness to RGB. The method includes: Step A, obtaining the color channel R value R0, color channel G value G0, and color channel B value B0 to be adjusted, and obtaining the updated coefficients yr1 of color channel R, yg1 of color channel G, and yb1 of color channel B; Step B, substituting R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted, whereby the RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0; Step C, determining whether R0, G0, and B0 are all non-zero; if R0 equals 0, updating yr1 again and assigning it a value of 0; if G0 equals 0, updating yg1 again and assigning it a value of 0; if B0 equals 0, updating yb1 again and assigning it a value of 0; Step D, calculating the coefficient ratio of yr1, yg1, and yb1 to obtain a ratio value A. r A g and A b Step E, based on R0, G0, B0, yr1, yg1, yb1, A r A g A bGiven a luminance value of Y0 and a preset luminance value P, calculate the corresponding color channel values R1, G1, and B1. Step F: Determine if R1, G1, and B1 are all non-zero. If all are, record R1, G1, and B1. If any one of R1, G1, and B1 is zero, update P, and based on the updated P, execute step E to update R1, G1, and B1. Step G: Display based on the recorded R1, G1, and B1. This application optimizes the method for converting luminance to RGB, reducing computational complexity, lowering the required computational precision for software and hardware, and expanding its applicability. It can be applied to both high-precision and low-precision software / hardware, improving the product's color performance, meeting users' demands for vibrant colors, and reducing production costs. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a first flowchart of a method for converting brightness to RGB provided in Example 1;
[0047] Figure 2 This is a second flowchart of a method for converting luminance to RGB provided in Example 1;
[0048] Figure 3 This is a schematic diagram of a luminance-to-RGB conversion device provided in Example 2.
[0049] Figure label:
[0050] 1-First acquisition module; 2-Second acquisition module; 3-First judgment module; 4-First calculation module; 5-Second calculation module; 6-Second judgment module; 7-Display module; 8-Initial module. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0052] like Figure 1 , Figure 2 and Figure 3 As shown, this application provides a method and apparatus for RGB brightness conversion, the method including:
[0053] Step A: Obtain the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted; obtain the updated coefficients yr1 for color channel R, yg1 for color channel G, and yb1 for color channel B.
[0054] Step B: Substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0.
[0055] Step C: Determine whether R0, G0, and B0 are all non-zero; if R0 equals 0, update yr1 again and assign yr1 the value of 0; if G0 equals 0, update yg1 again and assign yg1 the value of 0; if B0 equals 0, update yb1 again and assign yb1 the value of 0.
[0056] Step D: Calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ;
[0057] Step E, based on R0, G0, B0, yr1, yg1, yb1, A r A g A b Given Y0 and a preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1, and color channel B value B1; Step F: Determine whether R1, G1, and B1 are all non-zero. If R1, G1, and B1 are all non-zero, record R1, G1, and B1; If any one of R1, G1, and B1 is zero, update P, and based on the updated P, execute step E to update R1, G1, and B1.
[0058] Step G, based on the recorded R1, G1, and B1, is displayed.
[0059] This application optimizes the method for converting brightness to RGB, reducing computational complexity, lowering the computational precision required by software and hardware, and expanding its applicability. It can be applied to both high-precision and low-precision software / hardware, improving the color performance of the product, meeting users' needs for vibrant colors, and reducing production costs.
[0060] Example 1
[0061] like Figure 1 and Figure 2As shown, this embodiment provides a method for converting brightness to RGB, the method including:
[0062] Step A: Obtain the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted; obtain the updated coefficients yr1 for color channel R, yg1 for color channel G, and yb1 for color channel B.
[0063] Step B: Substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0.
[0064] Step C: Determine whether R0, G0, and B0 are all non-zero; if R0 equals 0, update yr1 again and assign yr1 the value of 0; if G0 equals 0, update yg1 again and assign yg1 the value of 0; if B0 equals 0, update yb1 again and assign yb1 the value of 0.
[0065] Step D: Calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ;
[0066] Step E, based on R0, G0, B0, yr1, yg1, yb1, A r A g A b Given Y0 and a preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1, and color channel B value B1; Step F: Determine whether R1, G1, and B1 are all non-zero. If R1, G1, and B1 are all non-zero, record R1, G1, and B1; If any one of R1, G1, and B1 is zero, update P, and based on the updated P, execute step E to update R1, G1, and B1.
[0067] Step G, based on the recorded R1, G1, and B1, is displayed.
[0068] This application optimizes the method for converting brightness to RGB, reducing computational complexity, lowering the computational precision required by software and hardware, and expanding its applicability. It can be applied to both high-precision and low-precision software / hardware, improving the color performance of the product, meeting users' needs for vibrant colors, and reducing production costs.
[0069] like Figure 1 and Figure 2 As shown, step A is preceded by:
[0070] Update the coefficients yr0 of color channel R to yr1, yg0 of color channel G to yg1, and yb0 of color channel B to yb1, where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values.
[0071] This step updates the coefficients of color channel R, color channel G, and color channel B from floating-point to integer, reducing the computational precision required for the RGB brightness conversion device, simplifying the calculation, expanding the applicability, and making it suitable for various software and hardware with different computational precision.
[0072] Specifically, the coefficient yr0 of color channel R is equal to 0.299; the coefficient yg0 of color channel G is equal to 0.587; and the coefficient yb0 of color channel B is equal to 0.144.
[0073] like Figure 1 and Figure 2 As shown, updating the coefficients yr0 and yr1 of color channel R, yg0 and yg1 of color channel G, and yb0 and yb1 of color channel B includes:
[0074] The coefficient yr0 of color channel R is multiplied by 1000 and then used as yr1;
[0075] The coefficient yg0 of color channel G is multiplied by 1000 and then used as yg1;
[0076] The coefficient yb0 of color channel B is multiplied by 1000 and then used as yb1.
[0077] This step proportionally expands the coefficients yr0 of color channel R, yg0 of color channel G, and yb0 of color channel B, ensuring the consistency of yr0, yg0, and yb0 updates and facilitating subsequent calculations. Furthermore, setting the expansion factor to 1000 makes the update process of yr0, yg0, and yb0 simple and computationally easy.
[0078] like Figure 1 and Figure 2 As shown, in this embodiment, the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted are obtained based on a preset RGB model. Specifically, the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted are obtained through program code or by calling graphics library functions based on the preset RGB model.
[0079] Specifically, R0, G0, and B0 can be represented using hexadecimal, decimal, or floating-point notation.
[0080] like Figure 1and Figure 2 As shown, in step B, substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0. This yields the brightness Y0 corresponding to the brightness R0G0B0 to be adjusted.
[0081] Specifically, the luminance Y0 in step B is the Y component representing image luminance in the YIQ color space. YIQ is a color space based on luminance and color difference, used to describe color information in color television and video signals. Y represents the luminance component, and I and Q represent the color difference components. YIQ and RGB are two different color spaces, and RGB can be converted to Y through specific linear operations. This embodiment uses YIQ as the conversion of RGB, simplifying the calculation process, reducing the amount of computation, lowering the computational difficulty, and also achieving better clustering results than other color spaces.
[0082] like Figure 1 and Figure 2 As shown, this embodiment determines in step C whether yr1 corresponding to R0, yg1 corresponding to G0, and yb1 corresponding to B0 need to be updated again, to avoid errors in the coefficient proportions, which could affect the calculation in step E and ultimately cause R1, G1, and B1 to deviate from the expected values. This embodiment further increases the accuracy of the conversion results through step C, ensuring that the output R1, G1, and B1 meet the user's requirements.
[0083] like Figure 1 and Figure 2 As shown, the formula for calculating the coefficient percentage is:
[0084]
[0085]
[0086]
[0087] In this embodiment, step D calculates the coefficient proportions of yr1, yg1, and yb1 obtained after step C, and multiplies them by 1000 to ensure that the obtained A... r A g and A b The values are integers, and the results are consistent with those of the regular floating-point algorithms calculated without updating yr1, yg1, and yb1. This avoids erroneous calculations and ensures that all values used in the method are integers.
[0088] like Figure 1 and Figure 2 As shown, the formula for calculating R1 is R1=(((P×R0×yr1×100) / Y0)×10 / Ar );
[0089] The formula for calculating G1 is G1=(((P×G0×yg1×100) / Y0)×10 / A g );
[0090] The formula for calculating B1 is B1=(((P×B0×yb1×100) / Y0)×10 / A b ).
[0091] like Figure 1 and Figure 2 As shown, in this embodiment, step F is used to judge R1, G1 and B1 to avoid outputting incorrect R1, G1 and B1, and at the same time, P is adjusted to output R1, G1 and B1 that meet the user's requirements.
[0092] In this embodiment, if any of R1, G1, and B1 equals 0, P is updated, including: if any of R1, G1, and B1 equals 0, the original P value is incremented by 1 to obtain the updated P value. This embodiment finds the minimum brightness value that matches the color to be adjusted by incrementing the original P value by 1 to obtain the updated P value, which facilitates the output of R1, G1, and B1 that meet user needs and improves the user experience.
[0093] Example 2
[0094] like Figure 2 As shown, this embodiment provides a device for converting brightness to RGB, including:
[0095] The first acquisition module 1 is used to acquire the color channel R value R0, color channel G value G0 and color channel B value B0 whose brightness is to be adjusted, and is also used to acquire the updated coefficients yr1 of color channel R, yg1 of color channel G and yb1 of color channel B.
[0096] The second acquisition module 2 is used to substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is Y0 = yr1 × R0 + yg1 × G0 + yb1 × B0.
[0097] The first judgment module 3 is used to determine whether R0, G0 and B0 are all not equal to 0; if R0 is equal to 0, then yr1 is updated again and yr1 is assigned the value 0; if G0 is equal to 0, then yg1 is updated again and yg1 is assigned the value 0; if B0 is equal to 0, then yb1 is updated again and yb1 is assigned the value 0.
[0098] The first calculation module 4 is used to calculate the coefficient ratio of yr1, yg1, and yb1 to obtain the ratio value A. r Ag and A b ;
[0099] The second calculation module 5 is used for calculations based on R0, G0, B0, yr1, yg1, yb1, and A. r A g A b Given Y0 and the preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1 and color channel B value B1;
[0100] The second judgment module 6 is used to determine whether R1, G1 and B1 are all not equal to 0. If R1, G1 and B1 are all not equal to 0, record R1, G1 and B1. If one of R1, G1 and B1 is equal to 0, update P, and based on the updated P, drive the second calculation module 5 to update R1, G1 and B1.
[0101] Display module 7 is used for displaying R1, G1 and B1 based on records.
[0102] This application improves the color performance of the display module 7 by cooperating with the first acquisition module 1, the second acquisition module 2, the first judgment module 3, the first calculation module 4, the second calculation module 5, the second judgment module 6 and the display module 7, thereby meeting the user's demand for vibrant colors, while reducing production costs and the computational precision required by the software and hardware.
[0103] like Figure 2 As shown, the RGB brightness conversion device provided in this embodiment further includes an initialization module 8. The initialization module 8 is used to update the coefficients yr0 of color channel R to yr1, yg0 of color channel G to yg1, and yb0 of color channel B to yb1, where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values. This application reduces the computational precision required for the RGB brightness conversion device by updating the coefficients yr0 of color channel R, yg0 of color channel G, and yb0 of color channel B through the initialization module 8.
[0104] Those skilled in the art will understand that the modules or steps described above in this application can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0105] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.
[0106] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for converting brightness to RGB, characterized in that, include: Step A: Obtain the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted; obtain the updated coefficients yr1 for color channel R, yg1 for color channel G, and yb1 for color channel B. Step B: Substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is as follows: ; Step C: Determine whether R0, G0, and B0 are all non-zero; if R0 equals 0, update yr1 again and assign yr1 the value of 0; if G0 equals 0, update yg1 again and assign yg1 the value of 0; if B0 equals 0, update yb1 again and assign yb1 the value of 0. Step D: Calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ; Step E, based on R0, G0, B0, yr1, yg1, yb1, A r A g A b Given Y0 and the preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1 and color channel B value B1; Step F: Determine whether R1, G1, and B1 are all non-zero. If R1, G1, and B1 are all non-zero, record R1, G1, and B1. If any one of R1, G1, and B1 is zero, update P, and based on the updated P, execute step E to update R1, G1, and B1. Step G, based on the recorded R1, G1, and B1, is displayed; Before step A, the process also includes: updating the coefficients yr0 of color channel R to yr1, updating the coefficients yg0 of color channel G to yg1, and updating the coefficients yb0 of color channel B to yb1. yr0, yg0, and yb0 are floating-point values, while yr1, yg1, and yb1 are integer values. Update the coefficients yr0 and yg0 of color channel R to yr1, and update the coefficients yg0 and yb0 of color channel B to yb1, including: multiplying the coefficient yr0 of color channel R by 1000 to obtain yr1; multiplying the coefficient yg0 of color channel G by 1000 to obtain yg1; and multiplying the coefficient yb0 of color channel B by 1000 to obtain yb1.
2. The method for converting brightness to RGB according to claim 1, characterized in that, The formula for calculating the coefficient ratio is as follows: ; ; 。 3. The method for converting brightness to RGB according to claim 1, characterized in that, The formula for calculating R1 is: ; The formula for calculating G1 is as follows: ; The formula for calculating B1 is: .
4. The method for converting brightness to RGB according to claim 1, characterized in that, If any of R1, G1, and B1 equals 0, update P, including: If any of R1, G1, and B1 equals 0, add 1 to the original P value to obtain the updated P value.
5. The method for converting brightness to RGB according to claim 1, characterized in that, yr0 equals 0.299; yg0 equals 0.587; yb0 equals 0.
144.
6. The method for converting brightness to RGB according to claim 1, characterized in that, Brightness Y0 is the Y component representing the brightness of an image in the YIQ color space.
7. A device for converting brightness to RGB, characterized in that, include: The first acquisition module is used to acquire the color channel R value R0, color channel G value G0, and color channel B value B0 whose brightness needs to be adjusted. It is also used to update the coefficients yr0 and yg0 of color channel R to yr1, yg0 and yg1 of color channel G to yg1, and yb0 and yb1 of color channel B to yb1, and to acquire the updated coefficients yr1, yg1, and yb1 of color channel R and color channel B; and to update the coefficients yr0 and yg0 of color channel R. The process involves updating the coefficients of color channel G (yg0) to yg1 and color channel B (yb0) to yb1, including: multiplying the coefficient of color channel R (yr0) by 1000 to obtain yr1; multiplying the coefficient of color channel G (yg0) by 1000 to obtain yg1; multiplying the coefficient of color channel B (yb0) by 1000 to obtain yb1; where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values. The second acquisition module is used to substitute R0, G0, B0, yr1, yg1, and yb1 into the RGB-to-brightness formula to obtain the brightness Y0 to be adjusted. The RGB-to-brightness formula is as follows: ; The first judgment module is used to determine whether R0, G0 and B0 are all not equal to 0; if R0 is equal to 0, then yr1 is updated again and yr1 is assigned the value 0; if G0 is equal to 0, then yg1 is updated again and yg1 is assigned the value 0; if B0 is equal to 0, then yb1 is updated again and yb1 is assigned the value 0. The first calculation module is used to calculate the coefficient proportions of yr1, yg1, and yb1 to obtain the proportion value A. r A g and A b ; The second calculation module is used to calculate based on R0, G0, B0, yr1, yg1, yb1, and A. r A g A b Given Y0 and the preset brightness value P, calculate the corresponding color channel R value R1, color channel G value G1 and color channel B value B1; The second judgment module is used to determine whether R1, G1 and B1 are all not equal to 0. If R1, G1 and B1 are all not equal to 0, record R1, G1 and B1. If one of R1, G1 and B1 is equal to 0, update P, and based on the updated P, drive the second calculation module to update R1, G1 and B1. The display module is used for displaying R1, G1, and B1 based on records.
8. The RGB brightness conversion apparatus according to claim 7, characterized in that, It also includes the initial module; The initial module is used to update the coefficients yr0 of color channel R to yr1, yg0 of color channel G to yg1, and yb0 of color channel B to yb1, where yr0, yg0, and yb0 are floating-point values, and yr1, yg1, and yb1 are integer values.
Citation Information
Patent Citations
Image data adjusting method
CN108765345A
Method for converting data, display device, computing device and program incorporating same, and method for optimising coefficients and device and program incorporating same
US20140002481A1