Color conversion method and apparatus, device, storage medium, and computer program product
By calculating the saturation and brightness weights and fusing the color conversion matrix, the problem of image quality degradation caused by color gamut overflow is solved, and better image fidelity is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- QINGDAO GOERPIXELS TECHNOLOGY CO LTD
- Filing Date
- 2025-10-22
- Publication Date
- 2026-04-30
AI Technical Summary
During color conversion, if the image data range is less than 0 or greater than 1 due to color gamut overflow, it will result in loss of image details and highlight overflow, affecting image quality.
By acquiring the RGB data of the original image, calculating saturation and brightness, determining the protection weights, and fusing the original color conversion matrix and the identity matrix, a new color conversion matrix is generated, avoiding data ranges exceeding 0 or 1 and reducing data truncation.
It effectively avoids the problem of data range exceeding the limit after color conversion, retains more image information, improves the loss of image details and highlight clipping, and enhances image quality.
Smart Images

Figure CN2025129174_30042026_PF_FP_ABST
Abstract
Description
Color conversion methods, apparatus, equipment, storage media, and computer program products
[0001] This application claims priority to Chinese Patent Application No. 202411479797.8, filed on October 22, 2024, entitled "Color Conversion Method, Apparatus, Device, Storage Medium and Computer Program Product", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This invention relates to the field of image display technology, and more particularly to color conversion methods, color conversion devices, display equipment, storage media, and computer program products. Background Technology
[0003] In camera imaging and display systems, color correction and color gamut conversion are often achieved through color conversion matrices. In some applications, the color gamut before conversion is larger than the color gamut after conversion (i.e., color gamut overflow), which can lead to the converted data range (after normalization) being less than 0 or greater than 1. Conventional processing methods directly truncate the data exceeding the normalized range, resulting in loss of image detail and highlight clipping, significantly impacting image quality.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a color conversion method, color conversion device, display device, storage medium and computer program product, which aims to solve the technical problem that the image quality deteriorates after color conversion due to color gamut overflow.
[0006] To achieve the above objectives, this application proposes a color conversion method, which includes:
[0007] Acquire the original image and determine the RGB data of each pixel in the original image;
[0008] Based on the RGB data of each pixel in the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0009] The original image is color-converted using a new color conversion matrix to obtain the target image.
[0010] In one embodiment, the step of fusing the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix includes:
[0011] Based on the RGB data of each pixel in the original image, the saturation and brightness of each pixel in the original image are calculated.
[0012] Based on the saturation and brightness of each pixel in the original image, a protection weight is determined for color overflow protection in terms of saturation and brightness.
[0013] By using the protection weights, the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0014] In one embodiment, the step of calculating the saturation and brightness of each pixel in the original image based on the RGB data of each pixel includes:
[0015] Based on the maximum and minimum RGB grayscale values of each pixel in the original image, the saturation of each pixel in the original image is calculated.
[0016] Based on the RGB data of each pixel in the original image, the RGB grayscale value and the maximum value of the RGB color components of each pixel in the original image are calculated; according to a preset combination coefficient, the RGB grayscale value and the maximum value of the RGB color components of each pixel in the original image are combined to obtain the brightness of each pixel in the original image.
[0017] In one embodiment, the step of determining the protection weights for color overflow protection based on the saturation and brightness of each pixel in the original image includes:
[0018] Based on the saturation of each pixel in the original image, a first protection weight for saturation overflow protection is determined;
[0019] Based on the brightness of each pixel in the original image, a second protection weight is determined for brightness overflow protection.
[0020] In one embodiment, the protection weights include a first protection weight for saturation overflow protection and a second protection weight for luminance overflow protection; the step of fusing the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix using the protection weights to obtain a new color conversion matrix includes:
[0021] By using the respective weight values of the first protection weight and the second protection weight, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0022] In one embodiment, the original color transformation matrix and an identity matrix of the same size as the original color transformation matrix are fused according to the following formula: M n =(1-W) s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0023] Among them, W s As the first protection weight, W Y As the second protection weight, M o M is the original color transformation matrix. e It is an identity matrix of the same size as the original color conversion matrix.
[0024] Furthermore, to achieve the above objectives, this application also proposes a color conversion device, which includes:
[0025] The acquisition module is used to acquire the original image and determine the RGB data of each pixel in the original image;
[0026] The adjustment module is used to fuse the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix.
[0027] The conversion module is used to perform color conversion on the original image using a new color conversion matrix to obtain the target image.
[0028] In addition, to achieve the above objectives, this application also proposes a display device, the display device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the color conversion method as described above.
[0029] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the color conversion method described above.
[0030] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the color conversion method described above.
[0031] One or more technical solutions proposed in this application have at least the following technical effects:
[0032] This application proposes a color conversion method that can achieve color overflow protection. The method adjusts the original color conversion matrix using the RGB data of each pixel in the original image, and merges the original color conversion matrix with an identity matrix of the same size to obtain a new color conversion matrix that avoids color gamut overflow. This new color conversion matrix is then used to perform color conversion on the original image to obtain the target image. By adjusting the original color conversion matrix, the method avoids situations where the converted data range (after normalization) is less than 0 or greater than 1, reducing the occurrence of truncation of data exceeding the normalized range. This preserves as much image information as possible, improving image quality issues such as loss of image detail and highlight clipping that occur during color conversion with color gamut overflow, and enhancing the image quality after color conversion in cases of color gamut overflow. Attached Figure Description
[0033] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 is a flowchart of the color conversion method provided in Embodiment 1 of this application;
[0036] Figure 2 is a schematic diagram of the application scenario of the color conversion method of this application;
[0037] Figure 3 is a schematic diagram of the module structure of the color conversion device according to an embodiment of this application;
[0038] Figure 4 is a schematic diagram of the hardware operating environment involved in the color conversion method in this application embodiment.
[0039] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0040] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0041] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0042] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or display device capable of performing the above functions. The following description uses a display device as an example to illustrate this embodiment and the subsequent embodiments.
[0043] Based on this, the present application provides a color conversion method. Referring to FIG1, FIG1 is a flowchart of the first embodiment of the color conversion method of the present application.
[0044] In this embodiment, the color conversion method includes steps S10 to S30:
[0045] Step S10: Obtain the original image and determine the RGB data of each pixel in the original image;
[0046] It should be noted that the RGB data of each pixel in the original image is grayscale data in the R, G or B channels. This grayscale data may be close to 0 or 255, that is, the data after RGB data normalization is close to 0 or 1, which may result in high saturation or high brightness, and may lead to the data range after color gamut conversion (after normalization) being less than 0 or greater than 1.
[0047] In this embodiment, by adjusting the color conversion matrix, excessive data truncation is prevented in color areas prone to data truncation, mainly including high-saturation and high-brightness areas of the image. In this way, the truncated information in the color conversion can be effectively protected, thereby improving the problems of detail loss and highlight clipping in the image, i.e., improving the problems of image detail loss and highlight clipping.
[0048] Step S20: Based on the RGB data of each pixel in the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix;
[0049] In one embodiment, both the original color conversion matrix and the new color conversion matrix are 3*3 matrices.
[0050] In one feasible implementation, step S20 includes:
[0051] Step S201: Based on the RGB data of each pixel in the original image, calculate the saturation and brightness of each pixel in the original image;
[0052] It should be noted that the basic attributes of the original image include pixels, resolution, size, color, bit depth, hue, saturation, brightness, and color channels. In this embodiment, saturation and brightness, which are most relevant to color gamut conversion, are selected as the target basic attributes. Furthermore, in this embodiment, the method for calculating the values of each pixel in the original image for the target basic attributes prone to color overflow is not limited.
[0053] Step S202: Determine the protection weights for color overflow protection based on the saturation and brightness of each pixel in the original image;
[0054] In this embodiment, the saturation and brightness of each pixel in the original image are used to look up values in saturation and brightness lookup tables to determine the protection weights for color overflow protection in saturation and brightness. It should be noted that the lookup table is a mapping table, which can be manually set to determine the areas affected by overflow and the color areas prone to data truncation.
[0055] It should be noted that improving the image quality deterioration after color conversion refers to mitigating the degree of overflow. The ideal situation is no overflow at all. However, even without overflow, the actual effect of color conversion will be affected. Therefore, in practice, this embodiment determines the lookup table and the corresponding protection weight in the lookup table based on the balance between color gamut overflow and color conversion.
[0056] Step S203: Using the protection weights, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0057] In this embodiment, the original color conversion matrix is adjusted by protecting the weights, and the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are merged to obtain a new color conversion matrix that avoids color gamut overflow. This avoids the situation where the converted data range (after normalization) is less than 0 or greater than 1, and reduces the occurrence of directly truncating data that exceeds the data range (after normalization).
[0058] In one feasible implementation, step S201 includes:
[0059] Based on the maximum and minimum RGB grayscale values of each pixel in the original image, the saturation of each pixel in the original image is calculated.
[0060] Based on the RGB data of each pixel in the original image, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are calculated; according to a preset combination coefficient, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are combined to obtain the brightness of each pixel in the original image.
[0061] In one embodiment, the saturation of each pixel in the original image can be calculated using the following formula:
[0062] Where S is the saturation value of a pixel in the original image, max(R,G,B) is the maximum value of the RGB grayscale value of a pixel in the original image, and min(R,G,B) is the minimum value of the RGB grayscale value of a pixel in the original image.
[0063] In one embodiment, the brightness of each pixel in the original image can be calculated using the following formula: Y = (1 - blend) * (0.299 × R + 0.587 × G + 0.114 × B) + blend * max(R, G, B)
[0064] Where Y represents the brightness value of a pixel in the original image, and (0.299×R+0.587×G+0.114×B) is a brightness calculation method, where R, G, and B represent the red, green, and blue color component values of a pixel in the image, respectively, and their coefficients are determined based on the human eye's sensitivity to different colors. max(R,G,B) represents taking the maximum value among the three color components. blend is a parameter between 0 and 1, used to control the mixing ratio of combining the grayscale values of each pixel in the original image with the maximum values of the RGB color components.
[0065] In one feasible implementation, step S202 includes:
[0066] Based on the saturation of each pixel in the original image, a first protection weight for saturation overflow protection is determined;
[0067] Based on the brightness of each pixel in the original image, a second protection weight is determined for brightness overflow protection.
[0068] In one embodiment, based on the saturation S calculated in step S201 above, a protection weight value WS for the saturation dimension is obtained through a configurable one-dimensional lookup table. The horizontal axis of this one-dimensional lookup table represents saturation, and the vertical axis represents weight. Higher saturation results in higher weight, with a maximum weight of 1. The lookup table parameters can be adjusted as needed.
[0069] In one embodiment, based on the brightness value Y calculated in step S201, a protection weight value WY for the brightness dimension is obtained through a configurable one-dimensional lookup table. The horizontal axis of this one-dimensional lookup table represents brightness, and the vertical axis represents weight; the higher the brightness, the higher the weight, with a maximum weight of 1. The lookup table parameters can be adjusted as needed.
[0070] In one feasible implementation, the protection weights include a first protection weight for saturation overflow protection and a second protection weight for luminance overflow protection; step S203 includes:
[0071] By using the respective weight values of the first protection weight and the second protection weight, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0072] In one embodiment, the original color conversion matrix Mo is adjusted according to the first protection weight WS and the second protection weight WY calculated in step S202 above. The adjustment method is to fuse the identity matrix Me, which has the same size as the original color conversion matrix, and the original color matrix Mo through the two protection weights. It should be noted that since the preset identity matrix Me does not produce any truncation, fusing the preset identity matrix Me can reduce the occurrence of truncation and obtain a new color conversion matrix Mn. That is, by adding the influence of the preset identity matrix Me, which does not produce any truncation, the probability of truncation is reduced.
[0073] In one feasible implementation, the original color transformation matrix and an identity matrix of the same size as the original color transformation matrix are merged according to the following formula: M n =(1-W) s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0074] Among them, W s As the first protection weight, W Y As the second protection weight, M o M is the original color transformation matrix. e It is an identity matrix of the same size as the original color conversion matrix.
[0075] Step S30: The original image is color-converted using a new color conversion matrix to obtain the target image.
[0076] In one embodiment, the new color conversion matrix Mn calculated in step S20 is applied to the current RGB data of the original image to complete the color conversion operation. For example, the latest 3*3 color conversion matrix Mn is left-multiplied by the RGB data to complete the color conversion operation of the original image.
[0077] It should be noted that the color conversion method proposed in this application can significantly improve the color truncation problem with very little overhead. It can be completed with only a small increase in computation and data storage compared to existing general solutions. The solution is low-cost, simple and efficient.
[0078] In addition, it should be noted that the above examples are only for understanding this application and do not constitute a limitation on the color conversion method of this application. Any simple transformations based on this technical concept are all within the protection scope of this application.
[0079] In one application scenario of the color conversion method of this application, see Figure 2:
[0080] S11 Input RGB: Input image RGB data, which will then be converted to color using a matrix.
[0081] S12a Saturation Calculation: The saturation value S at each pixel is calculated from the RGB data. One method for calculating saturation is as follows:
[0082] S12b brightness calculation: The brightness data Y of each pixel is calculated from the RGB data. One method for calculating the brightness is: Y=(1-blend)*(0.299×R+0.587×G+0.114×B)+blend*max(R,G,B)
[0083] S13a Saturation Overflow Protection Weight Calculation: Based on the saturation S calculated in S12a above, a configurable one-dimensional lookup table is used to obtain the protection weight value WS for the saturation dimension. The horizontal axis of this one-dimensional lookup table represents saturation, and the vertical axis represents weight. The higher the saturation, the higher the weight, with a maximum weight of 1. The lookup table parameters can be adjusted as needed.
[0084] S13b Brightness Overflow Protection Weight Calculation: Based on the brightness value Y calculated in S12b above, a protection weight value WY for the brightness dimension is obtained through a configurable one-dimensional lookup table. The horizontal axis of this one-dimensional lookup table represents brightness, and the vertical axis represents weight. The higher the brightness, the higher the weight, with a maximum weight of 1. The lookup table parameters can be adjusted as needed.
[0085] S14 3x3 Matrix Adjustment: Based on the protection weight coefficients WS and WY calculated in S13a and S13b above, the original 3x3 color conversion matrix Mo is adjusted. The adjustment method is to merge the identity matrix Me and the original color matrix Mo using the two protection weight coefficients. Since the identity matrix Me does not produce any truncation, merging the identity matrix can reduce the occurrence of truncation, resulting in a new color conversion matrix Mn. The formula is: M n =(1-W) s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0086] S15 Color Conversion: Apply the matrix Mn calculated in S14 above to the current RGB data to complete the color conversion operation.
[0087] This application also provides a color conversion device, as shown in FIG3, the color conversion device comprising:
[0088] The acquisition module 10 is used to acquire the original image and determine the RGB data of each pixel in the original image;
[0089] Adjustment module 20 is used to fuse the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix;
[0090] The conversion module 30 is used to perform color conversion on the original image using a new color conversion matrix to obtain the target image.
[0091] In one embodiment, the adjustment module is further configured to:
[0092] Based on the RGB data of each pixel in the original image, the saturation and brightness of each pixel in the original image are calculated.
[0093] Based on the saturation and brightness of each pixel in the original image, a protection weight is determined for color overflow protection in terms of saturation and brightness.
[0094] By using the protection weights, the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0095] In one embodiment, the adjustment module is further configured to:
[0096] Based on the maximum and minimum RGB grayscale values of each pixel in the original image, the saturation of each pixel in the original image is calculated.
[0097] Based on the RGB data of each pixel in the original image, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are calculated; according to a preset combination coefficient, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are combined to obtain the brightness of each pixel in the original image.
[0098] In one embodiment, the adjustment module is further configured to:
[0099] Based on the saturation of each pixel in the original image, a first protection weight for saturation overflow protection is determined;
[0100] Based on the brightness of each pixel in the original image, a second protection weight is determined for brightness overflow protection.
[0101] In one embodiment, the protection weights include a first protection weight for saturation overflow protection and a second protection weight for luminance overflow protection; the adjustment module is further configured to:
[0102] By using the respective weight values of the first protection weight and the second protection weight, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
[0103] In one embodiment, the adjustment module is further configured to:
[0104] The original color transformation matrix and an identity matrix of the same size as the original color transformation matrix are merged according to the following formula: M n =(1-W) s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e
[0105] Among them, W s As the first protection weight, W Y As the second protection weight, M o M is the original color transformation matrix. e It is an identity matrix of the same size as the original color conversion matrix.
[0106] The color conversion device provided in this application, employing the color conversion method described in the above embodiments, can solve the technical problem of degraded image quality after color conversion due to color gamut overflow. Compared with the prior art, the beneficial effects of the color conversion device provided in this application are the same as those of the color conversion method provided in the above embodiments, and other technical features in the color conversion device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0107] This application provides a display device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the color conversion method in Embodiment 1 above.
[0108] Referring now to Figure 4, a schematic diagram of a display device suitable for implementing embodiments of this application is shown. The display device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The display device shown in Figure 4 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0109] As shown in Figure 4, the display device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the display device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the display device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show display devices with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.
[0110] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0111] The display device provided in this application, employing the color conversion method described in the above embodiments, can solve the technical problem of degraded image quality after color conversion due to color gamut overflow. Compared with the prior art, the beneficial effects of the display device provided in this application are the same as those of the color conversion method provided in the above embodiments, and other technical features of this display device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0112] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0113] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0114] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to perform the color conversion method in the above embodiments.
[0115] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0116] The aforementioned computer-readable storage medium may be included in the display device or may exist independently without being assembled into the display device.
[0117] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a display device, cause the display device to: acquire an original image and determine the RGB data of each pixel in the original image; based on the RGB data of each pixel in the original image, fuse the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix to obtain a new color conversion matrix; and perform color conversion on the original image using the new color conversion matrix to obtain a target image.
[0118] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0120] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0121] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described color conversion method. This solves the technical problem of degraded image quality after color conversion due to color gamut overflow in current color conversion methods. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the color conversion method provided in the above embodiments, and will not be repeated here.
[0122] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the color conversion method described above.
[0123] The computer program product provided in this application can solve the technical problem of image quality degradation after color conversion due to color gamut overflow in current color conversion methods. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the color conversion method provided in the above embodiments, and will not be repeated here.
[0124] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A color conversion method, characterized in that, The color conversion method includes: Acquire the original image and determine the RGB data of each pixel in the original image; Based on the RGB data of each pixel in the original image, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix. The original image is color-converted using a new color conversion matrix to obtain the target image.
2. The color conversion method as described in claim 1, characterized in that, The step of fusing the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix based on the RGB data of each pixel in the original image to obtain a new color conversion matrix includes: Based on the RGB data of each pixel in the original image, the saturation and brightness of each pixel in the original image are calculated. Based on the saturation and brightness of each pixel in the original image, a protection weight is determined for color overflow protection in terms of saturation and brightness. By using the protection weights, the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
3. The color conversion method as described in claim 2, characterized in that, The step of calculating the saturation and brightness of each pixel in the original image based on the RGB data of each pixel includes: Based on the maximum and minimum RGB grayscale values of each pixel in the original image, the saturation of each pixel in the original image is calculated. Based on the RGB data of each pixel in the original image, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are calculated; according to a preset combination coefficient, the grayscale value and the maximum value of the RGB color components of each pixel in the original image are combined to obtain the brightness of each pixel in the original image.
4. The color conversion method as described in claim 2, characterized in that, The step of determining the protection weights for color overflow protection based on the saturation and brightness of each pixel in the original image includes: Based on the saturation of each pixel in the original image, a first protection weight for saturation overflow protection is determined; Based on the brightness of each pixel in the original image, a second protection weight is determined for brightness overflow protection.
5. The color conversion method as described in claim 2, characterized in that, The protection weights include a first protection weight for saturation overflow protection and a second protection weight for luminance overflow protection; the step of fusing the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix using the protection weights to obtain a new color conversion matrix includes: By using the respective weight values of the first protection weight and the second protection weight, the original color conversion matrix and the unit matrix of the same size as the original color conversion matrix are fused to obtain a new color conversion matrix.
6. The color conversion method as described in claim 5, characterized in that, The original color transformation matrix and an identity matrix of the same size as the original color transformation matrix are merged according to the following formula: M n =(1-W) s )*(1-W Y )*M o +(W s -W S *W Y +W Y )*M e Among them, W s As the first protection weight, W Y As the second protection weight, M o M is the original color transformation matrix. e It is an identity matrix of the same size as the original color conversion matrix.
7. A color conversion device, characterized in that, The color conversion device includes: The acquisition module is used to acquire the original image and determine the RGB data of each pixel in the original image; The adjustment module is used to fuse the original color conversion matrix and an identity matrix of the same size as the original color conversion matrix based on the RGB data of each pixel of the original image to obtain a new color conversion matrix. The conversion module is used to perform color conversion on the original image using a new color conversion matrix to obtain the target image.
8. A display device, characterized in that, The display device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the color conversion method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the color conversion method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the color conversion method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Image processing method and device, matrix acquisition method and device, terminal and readable storage medium
CN114445509A
Color conversion method and device, equipment, storage medium and computer program product
CN119383280A
Image processing method and unit
JP2000134498A
Adaptive color-temperature calibration system and method
TW201201592A
Color correction method and apparatus
WO2020037635A1