Color processing method and device, storage medium and electronic equipment

Through the processing of color enhancement matrix and conversion matrix, the problem of inconsistent display effects of electronic devices under different color display modes is solved, and the consistency of color display and user experience are improved.

CN119229828APending Publication Date: 2024-12-31GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310801441.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Under different color display modes, the display effect of electronic devices on the same content to be displayed is inconsistent, resulting in the user experience being affected.

Method used

By obtaining the current color display mode of the electronic device and the color gamut space of the content to be displayed, the color enhancement matrix and the conversion matrix are used to process the colors to make them consistent or close in different color display modes, thereby improving the display effect and user experience .

Benefits of technology

It realizes consistency in the color display effect of the displayed content under different color display modes, and improves the display effect and user experience of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229828A_ABST
    Figure CN119229828A_ABST
Patent Text Reader

Abstract

The invention discloses a color processing method which comprises the steps that a color display mode of an electronic device and a color gamut space where to-be-displayed content colors are located are obtained, a first color display mode supports display of colors of a first color gamut space, and a second color display mode supports display of colors of a second color gamut space; if the color display mode is a first color display mode and a color gamut space where the color of the to-be-displayed content is located is a first color gamut space, performing enhancement processing on the color of the to-be-displayed content according to a first color enhancement matrix; if the color display mode is a second color display mode and the color of the to-be-displayed content comprises a first color located in a first color gamut space, converting the first color corresponding to the second color display mode into a second color corresponding to the first color display mode according to a first color conversion matrix, the second color is enhanced according to the first color enhancement matrix, the electronic device displays the to-be-displayed content in different color display modes, and the display effect is consistent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic equipment, and in particular to a color processing method, device, storage medium and electronic equipment. Background Art

[0002] With the continuous development of technology, current electronic devices can support different color display modes, such as sRGB color display mode, DCI-P3 color display mode, etc. Different color display modes can support the display of colors in different color gamut spaces. Electronic devices can switch between different color display modes in different usage scenarios. However, in different color display modes, for the same content to be displayed, such as the same image, the display effect is inconsistent. Summary of the invention

[0003] The embodiments of the present application provide a color adjustment method, device, storage medium and electronic device. In the embodiments of the present application, when the electronic device displays the same content to be displayed in different color display modes, the display effect is consistent.

[0004] In a first aspect, an embodiment of the present application provides a color processing method, the method comprising:

[0005] Acquire a color display mode of the electronic device, the color display mode including at least a first color display mode and a second color display mode, the first color display mode supports displaying colors in a first color gamut space, the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space;

[0006] Get the color gamut space of the color of the content to be displayed;

[0007] If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, enhancing the color of the content to be displayed according to the first color enhancement matrix;

[0008] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into a second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

[0009] In a second aspect, an embodiment of the present application provides a color processing device, the device comprising:

[0010] A first acquisition module is used to acquire a color display mode of the electronic device, wherein the color display mode includes at least a first color display mode and a second color display mode, wherein the first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space, wherein the first color gamut space is smaller than the second color gamut space;

[0011] The second acquisition module is used to acquire the color gamut space where the color of the content to be displayed is located;

[0012] a first processing module, configured to enhance the color of the content to be displayed according to a first color enhancement matrix if the color display mode of the electronic device is the first color display mode and the color gamut space where the color of the content to be displayed is located is the first color gamut space;

[0013] A second processing module is used to convert the first color corresponding to the second color display mode into the second color corresponding to the first color display mode according to the first color conversion matrix if the color display mode of the electronic device is the second color display mode and the color of the content to be displayed includes the first color located in the first color gamut space, and enhance the second color according to the first color enhancement matrix.

[0014] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method provided by the embodiment of the present application.

[0015] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the processor is used to execute the method provided in the embodiment of the present application by calling a computer program stored in the memory.

[0016] The embodiment of the present application can obtain the current color display mode of the electronic device, and the color display mode includes at least a first color display mode and a second color display mode. The first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space. The embodiment of the present application can obtain the color gamut space where the color of the content to be displayed is located. If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, the color of the content to be displayed is enhanced according to the first color enhancement matrix, so that the color of the content to be displayed can be mapped from the first color gamut space to a larger color gamut space, so that the display screen of the electronic device can display colors beyond the first color gamut space when displaying the content to be displayed, and the color of the content to be displayed displayed on the display screen of the electronic device is more vivid, thereby improving the display effect of the electronic device. If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes the first color located in the first color gamut space, the embodiment of the present application takes into account that when the color display mode of the electronic device is different, the display effect of the color in the first color gamut space is different. If the first color is directly enhanced, the color display effect of the first color after the enhancement is also inconsistent under different color display modes. Therefore, the first color corresponding to the second color display mode is first converted into the second color corresponding to the first color display mode according to the first color conversion matrix, so that when the color display mode of the electronic device is the second color display mode, the second color is displayed. The display effect is consistent or close to the display effect of displaying the first color when the color display mode of the electronic device is the first color display mode, and then the second color is mapped from the first color gamut space to the larger color gamut space through the first color enhancement matrix, so that the display screen of the electronic device displays the content to be displayed with brighter colors, thereby improving the display effect of the electronic device, and whether the color display mode of the electronic device is the first color display mode or the second color display mode, when displaying the content to be displayed whose color is located in the first color gamut space or the first color in the content to be displayed that is located in the first color gamut space, the display screen of the electronic device can maintain a consistent or close color display effect, thereby improving the user experience. Therefore, when the user uses the electronic device, the color in the content to be displayed that is located in the first color gamut space will not have different display effects due to the switching of different color display modes, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The technical solution and beneficial effects of the present application will be made apparent by describing in detail the specific implementation modes of the present application in conjunction with the accompanying drawings.

[0018] Figure 1It is a flowchart of the color processing method provided in an embodiment of the present application.

[0019] Figure 2 It is another flowchart diagram of the color processing method provided in an embodiment of the present application.

[0020] Figure 3 It is a schematic diagram of the distribution of different color gamut spaces provided in the embodiments of the present application.

[0021] Figure 4 It is a schematic diagram of the structure of the color processing device provided in the embodiment of the present application.

[0022] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0023] Figure 6 It is another structural schematic diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] Please refer to the drawings, where the same component symbols represent the same components. The principle of the present application is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application, which should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.

[0025] It is understandable that the execution subject of the embodiments of the present application may be an electronic device such as a smart phone, a tablet computer, a television, etc.

[0026] See also Figure 1 , Figure 1 : is a flow chart of a color processing method provided in an embodiment of the present application. The color processing method can be applied to electronic devices. The process of the color processing method may include:

[0027] In 101, a color display mode of an electronic device is obtained, where the color display mode includes at least a first color display mode and a second color display mode, where the first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space, where the first color gamut space is smaller than the second color gamut space;

[0028] In 102, the color gamut space of the color of the content to be displayed is obtained;

[0029] In 103, if the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, the color of the content to be displayed is enhanced according to the first color enhancement matrix;

[0030] In 104, if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into a second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

[0031] With the continuous development of technology, electronic devices can support different color display modes, wherein electronic devices can automatically switch between different color display modes according to different usage scenarios, and electronic devices can also respond to user mode switching instructions to switch between different color display modes, wherein different color display modes can support the display of colors in different color gamut spaces. When electronic devices display the same content to be displayed in different color display modes, the displayed colors are inconsistent, resulting in different display effects.

[0032] The embodiment of the present application can obtain the current color display mode of the electronic device. The color display modes supported by the electronic device include at least a first color display mode and a second color display mode. The first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space. The first color gamut space is smaller than the second color gamut space. Exemplarily, the first color display mode is, for example, an sRGB color display mode, and the second color display mode is, for example, a DCI-P3 color display mode. When the current color display mode of the electronic device is an sRGB color display mode, it can be considered that the display screen of the electronic device is displayed according to the sRGB color gamut standard. When the current color display mode of the electronic device is a DCI-P3 color display mode, it can be considered that the display screen of the electronic device is displayed according to the DCI-P3 color gamut standard. Since the second color gamut space supported by the DCI-P3 color gamut standard is larger than the first color gamut space supported by the sRGB color gamut standard, the second color gamut space supported by the DCI-P3 color display mode has a wider color gamut space than the first color gamut space supported by the sRGB color display mode. It can also be considered that the second color gamut space covers the first color gamut space. Therefore, when the current color display mode of the electronic device is the DCI-P3 color display mode, the electronic device can present more colors. It should be noted that the embodiments of the present application do not limit specific color display modes, such as the Adobe RGB color display mode, the BT2020 standard, etc. The following content is described by taking the first color display mode, such as the sRGB color display mode, and the second color display mode, such as the DCI-P3 color display mode, as an example.

[0033] The embodiment of the present application can obtain the color gamut space where the color of the content to be displayed is located. It can be understood that the color of the content to be displayed, such as an image, is encoded by a specific color gamut standard. For example, if the color of the content to be displayed is encoded by the sRGB color gamut standard, then the color gamut space where the color of the content to be displayed is the first color gamut space corresponding to the sRGB color gamut standard. If the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, then the color gamut space where the color of the content to be displayed is the second color gamut space corresponding to the sRGB color gamut standard.

[0034] If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, the color of the content to be displayed is enhanced according to the first color enhancement matrix.

[0035] Exemplarily, if the color display mode of the electronic device is the sRGB color display mode, and the color of the content to be displayed is encoded by the sRGB color gamut standard, then the color gamut space where the color of the content to be displayed is located is the first color gamut space, and the display screen of the electronic device can normally display the color of the content to be displayed.

[0036] It is understandable that the color gamut space that the display screen of the current electronic device can display has exceeded the color gamut space that the color display mode can support, such as exceeding the color gamut space that the sRGB color display mode or the DCI-P3 color display mode can support, that is, the display screen can be used to display colors that exceed the first color gamut space and the second color gamut space. The embodiment of the present application takes into account the increasing requirements of users for the display effect of the display screen. If the display screen of the electronic device is only used to display colors in the first color gamut space, the color display of the display screen is relatively pale, the colors are not rich enough, and the colors are not bright enough, which affects the display effect.

[0037] Therefore, the embodiment of the present application obtains a first color enhancement matrix, and enhances the color of the content to be displayed according to the first color enhancement matrix, so that the color of the content to be displayed can be mapped from the first color gamut space to a larger color gamut space, so that the display screen of the electronic device can display colors beyond the first color gamut space when displaying the content to be displayed, so that the color of the content to be displayed displayed through the display screen of the electronic device is richer and more vivid, thereby improving the display effect of the electronic device.

[0038] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into the second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

[0039] The embodiments of the present application take into account that when the color display mode of the electronic device is different, the display effect of the first color in the first color gamut space is different. For example, when the color display mode is DCI-P3 color display mode and the first color of the content to be displayed is displayed when the color display mode is sRGB color display mode, the color display effects of the two are different. If the first color is directly enhanced, then when the electronic device switches to different color display modes, the color display effect of the first color after the enhancement processing is also inconsistent.

[0040] For example, the color display mode of the electronic device is the DCI-P3 color display mode, the color of the content to be displayed is encoded by the sRGB color gamut standard, and the color of the content to be displayed is the first color located in the first color gamut space. For another example, the color display mode of the electronic device is the DCI-P3 color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, so the color gamut space where the color of the content to be displayed is located is the second color gamut space, wherein the second color gamut space is larger than the first color gamut space, and it can also be understood that the second color gamut space covers the second color gamut space, therefore, the color of the content to be displayed may include the first color located in the first color gamut space and the third color located in the first color gamut space and the second color gamut space.

[0041] It can be understood that for the content to be displayed, such as image 1, the colors in image 1 are all distributed in the first color gamut space, and image 1 is displayed when the color display mode is the DCI-P3 color display mode, and the color display effect displayed on the display screen is different when the color display mode is the sRGB color display mode. For another example, for the content to be displayed, such as image 2, the first color in image 2 is distributed in the first color gamut space, and the first color of the content to be displayed is displayed when the color display mode is the DCI-P3 color display mode, and the color display effect displayed on the display screen is different when the color display mode is the sRGB color display mode. The embodiment of the present application takes into account that if the first color of image 1 or image 2 is directly enhanced, then when the electronic device switches to different color display modes, the first color display effects of image 1 and image 2 after the enhanced processing are also inconsistent.

[0042] Exemplarily, the electronic device can switch the current color display mode to the DCI-P3 color display mode or the SRGB color display mode according to different usage scenarios. For example, when the electronic device is running different applications, it may automatically switch to different color display modes. For example, when running the first application, the electronic device can switch to the DCI-P3 color display mode, and when running the second application, the electronic device can switch to the SRGB color display mode. If the user calls up image 1 or image 2 for display when running the first application or the second application, then for the same image 1, the color display effect of image 1 or image 2 seen by the user in the first application is different from the color display effect of image 1 or image 2 seen in the second application, resulting in inconsistent display effects of the electronic device in different usage scenarios for the same content to be displayed, which can easily cause user confusion about the display effect and affect the user's usage experience.

[0043] Therefore, the first color corresponding to the second color display mode is first converted into the second color corresponding to the first color display mode according to the first color conversion matrix, and then the second color is enhanced according to the first color enhancement matrix. Exemplarily, after obtaining the first color conversion matrix and the first color enhancement matrix, the first color can be converted according to the first color conversion matrix to obtain the converted second color, and then the second color can be enhanced according to the first color enhancement matrix to obtain the enhanced second color, and the display screen displays according to the enhanced second color. In another example, the first color enhancement matrix can also be multiplied by the first color conversion matrix to obtain a target color enhancement matrix, and then the first color can be enhanced according to the target color enhancement matrix.

[0044] Among them, the first color of the content to be displayed is converted into the second color through the first color conversion matrix, so that when the color display mode of the electronic device is the second color display mode, the display effect of the second color is displayed, which is consistent or close to the display effect of the first color when the color display mode of the electronic device is the first color display mode. The second color is mapped from the first color gamut space to the larger color gamut space through the first color enhancement matrix, so that when the display screen of the electronic device displays the content to be displayed, the color displayed is more vivid, thereby improving the display effect of the electronic device. Moreover, regardless of whether the color display mode of the electronic device is the first color display mode or the second color display mode, when displaying the content to be displayed whose color is located in the first color gamut space or the first color in the content to be displayed that is located in the first color gamut space, the display screen of the electronic device can maintain a consistent or close color display effect, thereby improving the user experience. Therefore, when the user uses the electronic device, the color of the first color gamut space in the content to be displayed will not have different display effects due to the switching of different color display modes, thereby improving the user experience.

[0045] See also Figure 2 , Figure 2 Another schematic diagram of a color processing method provided in an embodiment of the present application, the process may include:

[0046] In 201, a color display mode of the electronic device is obtained, the color display mode includes at least a first color display mode and a second color display mode, the first color display mode supports displaying colors in a first color gamut space, the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space.

[0047] The embodiment of the present application can obtain the current color display mode of the electronic device, and the color display mode supported by the electronic device includes at least a first color display mode and a second color display mode. The first color display mode supports the display of the color of the first color gamut space, and the second color display mode supports the display of the color of the second color gamut space, and the first color gamut space is smaller than the second color gamut space. Exemplarily, the first color display mode is such as the sRGB color display mode, and the second color display mode is such as the DCI-P3 color display mode. When the current color display mode of the electronic device is the sRGB color display mode, it can be considered that the display screen of the electronic device is displayed according to the sRGB color gamut standard, and when the current color display mode of the electronic device is the DCI-P3 color display mode, it can be considered that the display screen of the electronic device is displayed according to the DCI-P3 color gamut standard. Since the second color gamut space supported by the DCI-P3 color gamut standard is larger than the first color gamut space supported by the sRGB color gamut standard, the second color gamut space supported by the DCI-P3 color display mode has a wider color gamut space than the first color gamut space supported by the sRGB color display mode.

[0048] In 202, the color gamut space of the color of the content to be displayed is obtained.

[0049] The embodiment of the present application can obtain the color gamut space where the color of the content to be displayed is located. It can be understood that the color of the content to be displayed, such as an image, is encoded by a specific color gamut standard. For example, if the color of the content to be displayed is encoded by the sRGB color gamut standard, then the color gamut space where the color of the content to be displayed is the first color gamut space corresponding to the sRGB color gamut standard. If the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, then the color gamut space where the color of the content to be displayed is the second color gamut space corresponding to the sRGB color gamut standard.

[0050] In 203, if the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, a third color gamut space is set, the third color gamut space is smaller than the second color gamut space and larger than the first color gamut space, and a first color enhancement matrix that maps the first color gamut space to the third color gamut space is obtained;

[0051] In 204, the color of the content to be displayed is enhanced according to the first color enhancement matrix.

[0052] In one embodiment, the color display mode of the electronic device is the sRGB color display mode, and the color of the content to be displayed is encoded by the sRGB color gamut standard, then the color gamut space where the color of the content to be displayed is located is the first color gamut space, and the display screen of the electronic device can normally display the color to be displayed in the first color gamut space.

[0053] It is understandable that the color gamut space that can be displayed by the display screen of the current electronic device has exceeded the color gamut space that can be supported by the color display mode, such as exceeding the color gamut space that can be supported by the sRGB color display mode or the DCI-P3 color display mode, that is, the display screen can be used to display colors that exceed the first color gamut space and the second color gamut space. The embodiment of the present application takes into account the increasing requirements of users for the display effect of the display screen. If the display screen of the electronic device is only used to display colors in the first color gamut space, the color display of the display screen is relatively pale, the colors are not rich enough, and the colors are not bright enough, which affects the display effect.

[0054] Therefore, the embodiment of the present application can set a third color gamut space, which is smaller than the second color gamut space and larger than the first color gamut space. It can also be understood that the second color gamut space contains the third color gamut space, and the third color gamut space contains the first color gamut space. Please refer to Figure 3 , Figure 3 : is a schematic diagram of the distribution of different color gamut spaces provided in the embodiment of the present application. The color gamut space included in L1 is the first color gamut space corresponding to the sRGB color gamut standard, the color gamut space included in L2 is the second color gamut space corresponding to the DCI-P3 color gamut standard, and the color gamut space included in L3 can be the third color gamut space. It can be understood that the display screen has a native maximum color gamut space. For example, the color gamut space included in L5 in the figure is the largest color gamut space of the display screen, and the largest color gamut space of the display screen is larger than the first color gamut space and also larger than the second color gamut space.

[0055] A first color enhancement matrix that maps the first color gamut space to the third color gamut space is obtained, and the color of the content to be displayed is enhanced according to the first color enhancement matrix, so that the color of the content to be displayed can be mapped from the first color gamut space to the third color gamut space. When displaying the content to be displayed, the display screen of the electronic device can display the color of the third color gamut space, which exceeds the color of the first color gamut space, so that the colors displayed on the display screen of the electronic device are richer and more vivid, thereby improving the display effect of the electronic device.

[0056] Exemplarily, the first color enhancement matrix M (sRGBEnhance2Panel) is obtained as follows:

[0057] It can be understood that the display screen has a native maximum color gamut space and can support the display of colors in the maximum color gamut space. Different color gamut spaces have corresponding RGB three-primary color vertices, and different color gamut spaces can be represented by triangular areas composed of corresponding RGB three-primary color vertices. For example, the corresponding RGB vertex coordinates of the maximum color gamut space, the first color gamut space, the second color gamut space, and the third color gamut space of the display screen are shown in Table 1:

[0058] Table 1:

[0059]

[0060] 1.1, the three vertex coordinates of the third color gamut space are combined into a matrix M (TargetColor), and M (Target) is calculated. Through M (Target), the RGB data can be converted to the XYZ space.

[0061] Specifically, the calculation process of M(Target) is as follows:

[0062] For example, R1(0.655,0.328), G1(0.288,0.641), B1(0.1500,0.060).

[0063] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0064] xr=R1x;

[0065] yr=R1y;

[0066] xg=G1x;

[0067] yg=G1y;

[0068] xb=B1x;

[0069] yb=B1y;

[0070] xw=W1x;

[0071] yw=W1y;

[0072] Where W1 is the coordinate of the white point in the third color gamut space.

[0073] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0074] Xr=xr / yr; Xg=xg / yg;

[0075] Yr=1; Yg=1;

[0076] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0077] Xb=xb / yb; Xw=xw / yw;

[0078] Yb=1; Yw=1;

[0079] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0080] Then calculate the temporary matrix M (XYZ_Matrix):

[0081]

[0082] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0083]

[0084] The matrix M(Target) is calculated:

[0085]

[0086] 1.2, a matrix M(PanelColor) is formed by the three vertex coordinates of the maximum color gamut space that the display can display, and M(Panel) is calculated. Through M(Panel), RGB data can be converted to XYZ space.

[0087]

[0088] First calculate xr, yr; xg, yg; xb, yb; xw, yw:

[0089] xr=R2x;

[0090] yr=R2y;

[0091] xg=G2x;

[0092] yg=G2y;

[0093] xb=B2x;

[0094] yb=B2y;

[0095] xw=W2x;

[0096] yw=W2y;

[0097] Where W2 is the coordinate of the white point of the maximum color gamut space of the display screen. It can be understood that the white point coordinates of each display screen are also different.

[0098] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0099] Xr=xr / yr; Xg=xg / yg;

[0100] Yr=1; Yg=1;

[0101] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0102] Xb=xb / yb; Xw=xw / yw;

[0103] Yb=1; Yw=1;

[0104] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0105] Then calculate the temporary matrix M (XYZ_Matrix):

[0106]

[0107] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0108]

[0109] The matrix M(Panel) is calculated:

[0110]

[0111] Calculate the inverse matrix M(InversePanel) of M(Panel);

[0112] Thus, the first color enhancement matrix M(sRGBEnhance2Panel)=M(InversePanel)*M(Target) is calculated.

[0113] After obtaining the first color enhancement matrix, the embodiment of the present application performs enhancement processing on the color of the content to be displayed according to the first color enhancement matrix. Specifically, the three-primary color data of the color in the content to be displayed is normalized to obtain normalized three-primary color data; the normalized three-primary color data is linearized to obtain linearized data; the linearized data is enhanced according to the first color enhancement matrix to obtain enhanced data; the enhanced data is inversely linearized to obtain inversely linearized data; the inversely linearized data is inversely normalized to obtain the three-primary color data after the color in the content to be displayed is enhanced.

[0114] In 205, if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into the second color corresponding to the first color display mode according to the first color conversion matrix.

[0115] In 206, the second color is enhanced according to the first color enhancement matrix.

[0116] The embodiments of the present application take into account that when the color display mode of the electronic device is different, the display effect of the first color in the first color gamut space is different. For example, when the color display mode is DCI-P3 color display mode and the first color of the content to be displayed is displayed when the color display mode is sRGB color display mode, the color display effects of the two are different. If the first color is directly enhanced, then when the electronic device switches to different color display modes, the color display effect of the first color after the enhancement processing is also inconsistent.

[0117] For example, the color display mode of the electronic device is the DCI-P3 color display mode, the color of the content to be displayed is encoded by the sRGB color gamut standard, and the color of the content to be displayed is the first color located in the first color gamut space. For another example, the color display mode of the electronic device is the DCI-P3 color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, so the color gamut space where the color of the content to be displayed is located is the second color gamut space, wherein the second color gamut space is larger than the first color gamut space, and it can also be understood that the second color gamut space covers the second color gamut space, therefore, the color of the content to be displayed may include the first color located in the first color gamut space and the third color located in the first color gamut space and the second color gamut space.

[0118] It can be understood that for the content to be displayed, such as image 1, the colors in image 1 are all distributed in the first color gamut space, and image 1 is displayed when the color display mode is the DCI-P3 color display mode, and the color display effect displayed on the display screen is different when the color display mode is the sRGB color display mode. For another example, for the content to be displayed, such as image 2, the first color in image 2 is distributed in the first color gamut space, and the first color of the content to be displayed is displayed when the color display mode is the DCI-P3 color display mode, and the color display effect displayed on the display screen is different when the color display mode is the sRGB color display mode. The embodiment of the present application takes into account that if the first color of image 1 or image 2 is directly enhanced, then when the electronic device switches to different color display modes, the first color display effects of image 1 and image 2 after the enhanced processing are also inconsistent.

[0119] Exemplarily, the electronic device can switch the current color display mode to the DCI-P3 color display mode or the SRGB color display mode according to different usage scenarios. For example, when the electronic device is running different applications, it may automatically switch to different color display modes. For example, when running the first application, the electronic device can switch to the DCI-P3 color display mode, and when running the second application, the electronic device can switch to the SRGB color display mode. If the user calls up image 1 or image 2 for display when running the first application or the second application, then for the same image 1, the color display effect of image 1 or image 2 seen by the user in the first application is different from the color display effect of image 1 or image 2 seen in the second application, resulting in inconsistent display effects of the electronic device in different usage scenarios for the same content to be displayed, which can easily cause user confusion about the display effect and affect the user's usage experience.

[0120] Therefore, in the embodiment of the present application, when it is recognized that the color display mode of the electronic device is the DCI-P3 color display mode, and the first color of the content to be displayed is distributed in the first color gamut space, the first color corresponding to the second color display mode is first converted into the second color corresponding to the first color display mode according to the first color conversion matrix, and then the first color is enhanced according to the first color enhancement matrix. Exemplarily, after obtaining the first color conversion matrix and the first color enhancement matrix, the first color can be converted according to the first color conversion matrix to obtain the converted second color, and then the second color can be enhanced according to the first color enhancement matrix to obtain the enhanced second color, and the display screen is displayed according to the enhanced second color. In another example, the first color enhancement matrix can also be multiplied by the first color conversion matrix to obtain the target color enhancement matrix, and then the first color can be enhanced according to the target color enhancement matrix.

[0121] Among them, the first color of the content to be displayed is converted into the second color by the first color conversion matrix, so that when the color display mode of the electronic device is the second color display mode, the display effect of the second color is displayed, which is consistent or close to the display effect of the first color when the color display mode of the electronic device is the first color display mode. The second color is mapped from the first color gamut space to the third color gamut space by the first color enhancement matrix, so that when the display screen of the electronic device displays the content to be displayed, the displayed color is more vivid and has a higher saturation, thereby improving the display effect of the electronic device. Moreover, regardless of whether the color display mode of the electronic device is the first color display mode or the second color display mode, when displaying the content to be displayed whose color is located in the first color gamut space or the first color in the content to be displayed located in the first color gamut space, the display screen of the electronic device can maintain a consistent or close color display effect, thereby improving the user experience. Therefore, when the user uses the electronic device, the color of the first color gamut space in the content to be displayed will not have different display effects due to the switching of different color display modes, thereby improving the user experience.

[0122] The first color enhancement matrix acquisition method is referred to the above example and will not be described in detail here. The first color conversion matrix M (DCI-P3_2_sRGB) can be obtained as follows:

[0123] 2.1, the three vertex coordinates of the second color gamut space are combined into a matrix M (TargetColor), and M (Target) is calculated. Through M (Target), the RGB data can be converted to the XYZ space.

[0124] Specifically, the calculation process of M(Target) is as follows:

[0125]

[0126] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0127] xr=R3x;

[0128] yr=R3y;

[0129] xg = G3x;

[0130] yg=G3y;

[0131] xb=B3x;

[0132] yb=B3y;

[0133] xw=W3x;

[0134] yw=W3y;

[0135] Wherein W3 is the coordinate of the white point of the second color gamut space.

[0136] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0137] Xr=xr / yr; Xg=xg / yg;

[0138] Yr=1; Yg=1;

[0139] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0140] Xb=xb / yb; Xw=xw / yw;

[0141] Yb=1; Yw=1;

[0142] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0143] Then calculate the temporary matrix M (XYZ_Matrix):

[0144]

[0145] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0146]

[0147] The matrix M(Target) is calculated:

[0148]

[0149] 2.2, the three vertex coordinates of the first color gamut space are combined into a matrix M (PanelColor), and M (Panel) is calculated. Through M (Panel), the RGB data can be converted to the XYZ space.

[0150]

[0151] First calculate xr, yr; xg, yg; xb, yb; xw, yw:

[0152] xr=R4x;

[0153] yr=R4y;

[0154] xg = G4x;

[0155] yg=G4y;

[0156] xb=B4x;

[0157] yb=B4y;

[0158] xw=W4x;

[0159] yw=W4y;

[0160] Where W4 is the coordinate of the white point in the maximum color gamut space of the display.

[0161] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0162] Xr=xr / yr; Xg=xg / yg;

[0163] Yr=1; Yg=1;

[0164] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0165] Xb=xb / yb; Xw=xw / yw;

[0166] Yb=1; Yw=1;

[0167] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0168] Then calculate the temporary matrix M (XYZ_Matrix):

[0169]

[0170] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0171]

[0172] The matrix M(Panel) is calculated:

[0173]

[0174] Calculate the inverse matrix M(InversePanel) of M(Panel);

[0175] The first color conversion matrix M(DCI-P3_2_sRGB)=M(InversePanel)*M(Target).

[0176] Exemplarily, the first color can be converted according to the first color conversion matrix to obtain a converted second color, and then the second color can be enhanced according to the first color enhancement matrix to obtain an enhanced second color, and the display screen displays according to the enhanced second color.

[0177] In another example, the first color enhancement matrix can be multiplied by the first color conversion matrix to obtain a target color enhancement matrix, and then the first color is enhanced according to the target color enhancement matrix; in another example, specifically, the three primary color data of the color in the content to be displayed are normalized to obtain normalized three primary color data; the normalized three primary color data are linearized to obtain linearized data; the linearized data is enhanced according to the target color enhancement matrix to obtain enhanced data; the enhanced data is inverse linearized to obtain inverse linearized data; the inverse linearized data is inverse normalized to obtain a new first color after enhancement; and the electronic device displays according to the new first color.

[0178] For example, the bit depth of the display screen is 12 bits, the three-primary color data 1 of the color 1 to be displayed is: (4095, 0, 0), and the three-primary color data 2 of the color 2 is: (2096, 788, 3840). The three-primary color data 1 of color 1 and the three-primary color data 2 of color 2 are normalized, wherein the three-primary color data 1 (4095, 0, 0) of color 1 is normalized to (4095 / 4095, 0 / 4095, 0 / 4095) to obtain the normalized three-primary color data 1 (1, 0, 0); the three-primary color data 2 (2096, 788, 3840) of color 2 is normalized to (2096 / 4095, 788 / 4095, 3840 / 4095) to obtain the normalized three-primary color data

[0179] 2(0.51844,0.192430,0.937729).

[0180] The normalized data 1(1,0,0) is linearized (1 2.2 , 0 2.2 ,0 2.2 ), and obtain the linearized data 1(1,0,0), and linearize the normalized data 1(0.51844,0.192430,0.937729) (0.51844 2.2 , 0.192430 2.2 ,0.937729 2.2 ), and obtain the linearized data

[0181] 2(0.229141, 0.226632, 0.868101), multiply the linearized data by the target color enhancement matrix, for example, the target color enhancement matrix is:

[0182]

[0183] Then the enhanced three-primary color data 1 is obtained as follows:

[0184]

[0185] Then the enhanced three-primary color data 2 is obtained as follows:

[0186]

[0187] The enhanced three-primary color data 1 (0.782103, 0.040155, 0.013673) is inversely linearized (0.782103 1 / 2.2 ,0.040188 1 / 2.2 ,0.013673 1 / 2.2 ), and the inverse linearized three-primary color data 1 (0.894301, 0.232005, 0.142123) is obtained. The enhanced three-primary color data 2 (0.211388, 0.050514, 0.766954) is inversely linearized (0.211388 1 / 2.2 ,0.050514 1 / 2.2 ,0.766954 1 / 2.2 ), and get the inverse linearized three-primary color data 2

[0188] (0.493421, 0.257419, 0.886385); then the inverse linearized three-primary color data 1 is inversely normalized (0.894301*4095, 0.232005*4095, 0.142123*4095), and the enhanced three-primary color data 1 (3602, 950, 582) is obtained, and the inverse linearized three-primary color data 2 is inversely normalized (0.493421*4095, 0.257419*4095, 0.886385*4095), and the enhanced three-primary color data 2 (2021, 1054, 3630) is obtained. Therefore, the three-primary color data of color 1 in the first color gamut space is (4095, 0, 0), and the three-primary color data mapped to the third color gamut space is (3602, 950, 582); the three-primary color data of color 2 in the first color gamut space is (2096, 788, 3840), and the three-primary color data mapped to the third color gamut space is (2096, 788, 3840).

[0189] In 207, if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a color in the fourth color gamut space, the fourth color gamut space is set to a plurality of continuous sub-color gamut spaces, and the color in the fourth color gamut space is divided into fifth colors in different sub-color gamut spaces;

[0190] In 208, a fifth color gamut space is set, the fifth color gamut space is larger than the second color gamut space, and a plurality of continuous sub-enhancement spaces are set correspondingly between the third color gamut space and the fifth color gamut space, and the sub-color gamut spaces correspond to the sub-enhancement spaces one by one;

[0191] In 209, a first color change value of converting the first color into the second color is obtained; according to the sub-color conversion matrix corresponding to each sub-color gamut space, the fifth color of the corresponding sub-color gamut space is converted into a sixth color, the third color change value of converting the fifth color into the sixth color is less than the first color change value, and the further the sub-color gamut space is from the first color gamut space, the greater the difference between the third color change value of the sub-color conversion matrix corresponding to the sub-color conversion matrix and the first color change value;

[0192] In 211, the sixth color in each sub-color gamut space is enhanced according to its corresponding sub-color enhancement matrix, and the sub-color enhancement matrix is ​​used to map each of the sub-color gamut spaces to a corresponding sub-enhancement space.

[0193] In one embodiment, the color display mode of the electronic device is a DCI-P3 color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, so the color gamut space where the color of the content to be displayed is located is the second color gamut space, wherein the second color gamut space covers the second color gamut space, therefore, the color of the content to be displayed includes a first color located in the first color gamut space and a third color located in the first color gamut space and the second color gamut space, that is, the content to be displayed includes the first color located in the first color gamut space and the third color located in the fourth color gamut space.

[0194] Among them, the first color in the first color gamut space is converted into the second color through the first color conversion matrix, and there is a first color change value between the second color and the first color, that is, the first color in the first color gamut space in the content to be displayed has been converted into the second color, and the second color is enhanced according to the first color enhancement matrix. In order to make the first color of the content to be displayed in the first color gamut space and the third color in the fourth color gamut space naturally coordinated as a whole, the corresponding third color in the fourth color gamut space in the content to be displayed also needs to be color converted and enhanced.

[0195] Exemplarily, if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a third color located in the fourth color gamut space, a fifth color gamut space is set, and the fifth color gamut space is larger than the second color gamut space; a first color change value of converting the first color to the second color is obtained; the third color is converted into a fourth color according to a second color conversion matrix corresponding to the fourth color gamut space, and a second color change value of converting the third color to the fourth color is less than the first color change value; the fourth color is enhanced according to the second color enhancement matrix, and the second color enhancement matrix is ​​used to map the fourth color gamut space to the fifth color gamut space.

[0196] Please refer to Figure 3 , the color gamut space included in L4 can be the fifth color gamut space. Exemplarily, the fifth color gamut space can be less than or equal to the maximum color gamut space of the display screen. The third color located in the fourth color gamut space is converted into the fourth color by the second color conversion matrix, and the second color change value of the third color converted into the fourth color is less than the first color change value, so that in the content to be displayed, the fourth color converted from the third color located in the fourth color gamut space and the second color converted from the first color located in the first color gamut space can relatively reduce the color difference between the two, and then the fourth color is enhanced, so that the first color of the content to be displayed located in the first color gamut space and the third color located in the fourth color gamut space can be naturally coordinated as a whole after the enhancement processing, and the embodiment of the present application does not directly convert the third color of the fourth color gamut space according to the first color conversion matrix, but converts according to the second color conversion matrix to reduce the color change value of the third color of the fourth color gamut space, so as to keep the original color of the content to be displayed in the fourth color gamut space as much as possible.

[0197] Furthermore, the embodiment of the present application considers setting a plurality of continuous sub-color gamut spaces, such as 20 continuous sub-color gamut spaces, in order to enable a more uniform transition between the color enhancement processing of the content to be displayed in the fourth color gamut space and the enhanced first color, and dividing the colors in the fourth color gamut space into fifth colors in different sub-color gamut spaces. Specifically, the sub-color gamut space to which the color belongs can be determined based on the three primary color data of the color of the content to be displayed.

[0198] In the embodiment of the present application, a plurality of continuous sub-enhancement spaces are set correspondingly between the third color gamut space and the fifth color gamut space, and the sub-color gamut spaces correspond to the sub-enhancement spaces one by one; for example, the fourth color gamut space is divided into 20 continuous sub-color gamut spaces, and the corresponding third color gamut space and the fifth color gamut space can also be divided into 20 continuous sub-enhancement spaces, so that the sub-color gamut spaces correspond to the sub-enhancement spaces one by one. It should be noted that the embodiment of the present application does not limit the specific number, and other numbers of sub-color gamut spaces and sub-enhancement spaces can be set.

[0199] According to the sub-color conversion matrix corresponding to each sub-color gamut space, the fifth color of the corresponding sub-color gamut space is converted into the sixth color, the third color change value of the fifth color converted into the sixth color is less than the first color change value, and the farther the sub-color gamut space is from the first color gamut space, the greater the difference between the third color change value of the corresponding sub-color conversion matrix and the first color change value, that is, based on the first color change value, the closer to the boundary of the second color gamut space, the smaller the color change value of the fifth color of the content to be displayed is, so that from the boundary of the first color gamut space to the boundary of the second color gamut, based on the first color change value, the fifth color change value of the content to be displayed becomes smaller and smaller, so that the sixth color converted from the fifth color in different sub-color gamut spaces can gradually and evenly transition based on the second color converted from the first color, while taking into account keeping the initial color of the original content in different sub-color gamut spaces as much as possible.

[0200] For example, the fourth color gamut space is divided into 20 continuous sub-color gamut spaces custom_i, and the third color gamut space and the fifth color gamut space are correspondingly divided into 20 continuous sub-enhancement spaces Target_i, and the sub-color gamut space custom_i corresponds to the sub-enhancement space Target_i one by one.

[0201] The sub-color conversion matrix M(DCI-P3_2_custom_i) is obtained as follows:

[0202] 3.1, the three vertex coordinates of the second color gamut space are combined into a matrix M (TargetColor), and M (Target) is calculated. Through M (Target), the RGB data can be converted to the XYZ space.

[0203] Specifically, the calculation process of M(Target) is as follows:

[0204]

[0205] First calculate xr, yr; xg, yg; xb, yb; xw, yw:

[0206] xr=R3x;

[0207] yr=R3y;

[0208] xg = G3x;

[0209] yg=G3y;

[0210] xb=B3x;

[0211] yb=B3y;

[0212] xw=W3x;

[0213] yw=W3y;

[0214] Wherein W3 is the coordinate of the white point of the second color gamut space.

[0215] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0216] Xr=xr / yr; Xg=xg / yg;

[0217] Yr=1; Yg=1;

[0218] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0219] Xb=xb / yb; Xw=xw / yw;

[0220] Yb=1; Yw=1;

[0221] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0222] Then calculate the temporary matrix M (XYZ_Matrix):

[0223]

[0224] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0225]

[0226] The matrix M(Target) is calculated:

[0227]

[0228] 3.2, the three vertex coordinates of the sub-color space are combined into a matrix M(PanelColor), and M(Panel) is calculated. Through M(Panel), the RGB data in M(TargetColor) can be converted to XYZ space.

[0229]

[0230] First calculate xr, yr; xg, yg; xb, yb; xw, yw:

[0231] xr = R5x;

[0232] yr=R5y;

[0233] xg = G5x;

[0234] yg=G5y;

[0235] xb=B5x;

[0236] yb=B5y;

[0237] xw=W5x;

[0238] yw=W5y;

[0239] Where W5 is the coordinate of the white point in the sub-color gamut space.

[0240] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0241] Xr=xr / yr; Xg=xg / yg;

[0242] Yr=1; Yg=1;

[0243] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0244] Xb=xb / yb; Xw=xw / yw;

[0245] Yb=1; Yw=1;

[0246] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0247] Then calculate the temporary matrix M (XYZ_Matrix):

[0248]

[0249] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0250]

[0251] The matrix M(Panel) is calculated:

[0252]

[0253] Calculate the inverse matrix M(InversePanel) of M(Panel);

[0254] The sub-color conversion matrix M(DCI-P3_2_custom_i)=M(InversePanel)*M(Target).

[0255] Among them, the sub-color enhancement matrix M (Target_i2Panel) is obtained as follows:

[0256] 4.1, the three vertex coordinates of the sub-enhancement space Target_i are combined into a matrix M(TargetColor), and M(Target) is calculated. Through M(Target), the RGB data in M(TargetColor) can be converted to XYZ space.

[0257] Specifically, the calculation process of M(Target) is as follows:

[0258]

[0259] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0260] xr=R6x;

[0261] yr=R6y;

[0262] xg = G6x;

[0263] yg=G6y;

[0264] xb=B6x;

[0265] yb=B6y;

[0266] xw=W6x;

[0267] yw=W6y;

[0268] Where W6 is the coordinate of the white point in the sub-enhancement space Target_i.

[0269] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0270] Xr=xr / yr; Xg=xg / yg;

[0271] Yr=1; Yg=1;

[0272] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0273] Xb=xb / yb; Xw=xw / yw;

[0274] Yb=1; Yw=1;

[0275] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0276] Then calculate the temporary matrix M (XYZ_Matrix):

[0277]

[0278] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0279]

[0280] The matrix M(Target) is calculated:

[0281]

[0282] 4.2, a matrix M(PanelColor) is formed by the coordinates of the three vertices of the maximum color gamut space that the display can display, and M(Panel) is calculated. Through M(Panel), the RGB data in M(TargetColor) can be converted to XYZ space.

[0283]

[0284] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0285] xr=R2x;

[0286] yr=R2y;

[0287] xg=G2x;

[0288] yg=G2y;

[0289] xb=B2x;

[0290] yb=B2y;

[0291] xw=W2x;

[0292] yw=W2y;

[0293] Where W2 is the coordinate of the white point in the maximum color gamut space of the display.

[0294] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0295] Xr=xr / yr; Xg=xg / yg;

[0296] Yr=1; Yg=1;

[0297] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0298] Xb=xb / yb; Xw=xw / yw;

[0299] Yb=1; Yw=1;

[0300] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0301] Then calculate the temporary matrix M (XYZ_Matrix):

[0302]

[0303] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0304]

[0305] The matrix M(Panel) is calculated:

[0306]

[0307] Calculate the inverse matrix M(InversePanel) of M(Panel);

[0308] Sub-color enhancement matrix M(Target_i2Panel)=M(InversePanel)*M(Target).

[0309] After the sub-color conversion matrix and the sub-color enhancement matrix are obtained, the fifth color in each sub-color gamut space is converted into a sixth color according to its corresponding sub-color conversion matrix, and then the sixth color is enhanced according to the sub-color enhancement matrix. The display screen of the electronic device displays the sixth color after each sub-color gamut space enhancement process. For the specific processing method, please refer to the above embodiment, and this application will not repeat it here.

[0310] In one embodiment, the second color gamut space includes the boundary of the second color gamut space. If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a seventh color located at the boundary of the second color gamut space, the seventh color is enhanced according to a third color enhancement matrix, and the third color enhancement matrix is ​​used to map the boundary of the second color gamut space to the boundary of the fifth color gamut space.

[0311] In one embodiment, the color display mode of the electronic device is a DCI-P3 color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard. Therefore, the color gamut space where the color of the content to be displayed is located is a second color gamut space, wherein the second color gamut space covers the first color gamut space. Therefore, the color of the content to be displayed includes a first color located in the first color gamut space, a third color located in the fourth color gamut space, and a seventh color located at the boundary of the second color gamut space. The first color of the content to be displayed located in the first color gamut space is converted into a second color by a first color conversion matrix, and the color change value between the first color and the second color is a first color change value. Starting from the boundary of the first color gamut space to the boundary of the second color gamut, based on the first color change value, the color change value of the fifth color of the content to be displayed located in different sub-color gamut spaces in the fourth color gamut space becomes smaller and smaller until the seventh color at the boundary of the second color gamut space no longer needs to be changed. Therefore, a third color enhancement matrix mapping the boundary of the second color gamut space to the boundary of the fifth color gamut space can be obtained, and the seventh color is enhanced and displayed according to the third color enhancement matrix, so that the overall color transition of the content to be displayed is uniform.

[0312] Specifically, the third color enhancement matrix M (DCI-P3Enhance2Panel) is obtained as follows:

[0313] 5.1, the three vertex coordinates of the fifth color gamut space are formed into a matrix M (TargetColor), wherein the fifth color gamut space may be less than or equal to the maximum color gamut space of the display screen. Exemplarily, the three primary color vertex coordinates of the fifth color gamut space may refer to Table 1, and M (Target) may be calculated, and RGB data may be converted to XYZ space through M (Target).

[0314] Specifically, the calculation process of M(Target) is as follows:

[0315]

[0316] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0317] xr=R7x;

[0318] yr=R7y;

[0319] xg = G7x;

[0320] yg=G7y;

[0321] xb=B7x;

[0322] yb=B7y;

[0323] xw=W7x;

[0324] yw=W7y;

[0325] Where W7 is the coordinate of the white point in the fifth color gamut space.

[0326] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0327] Xr=xr / yr; Xg=xg / yg;

[0328] Yr=1; Yg=1;

[0329] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0330] Xb=xb / yb; Xw=xw / yw;

[0331] Yb=1; Yw=1;

[0332] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0333] Then calculate the temporary matrix M (XYZ_Matrix):

[0334]

[0335] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0336]

[0337] The matrix M(Target) is calculated:

[0338]

[0339] 5.2, a matrix M(PanelColor) is formed by the coordinates of the three vertices of the maximum color gamut space that the display can display, and M(Panel) is calculated. Through M(Panel), the RGB data in M(TargetColor) can be converted to XYZ space.

[0340]

[0341] First calculate xr , yr; xg , yg;xb,yb;xw , yw:

[0342] xr=R2x;

[0343] yr=R2y;

[0344] xg=G2x;

[0345] yg=G2y;

[0346] xb=B2x;

[0347] yb=B2y;

[0348] xw=W2x;

[0349] yw=W2y;

[0350] Where W2 is the coordinate of the white point in the maximum color gamut space of the display.

[0351] Then calculate Xr, Yr, Zr; Xg, Yg, Zg; Xb, Yb, Zb and Xw, Yw, Zw:

[0352] Xr=xr / yr; Xg=xg / yg;

[0353] Yr=1; Yg=1;

[0354] Zr=(1-xr-yr) / yr; Zg=(1-xg-yg) / yg;

[0355] Xb=xb / yb; Xw=xw / yw;

[0356] Yb=1; Yw=1;

[0357] Zb=(1-xb-yb) / yb; Zw=(1-xw-yw) / yw;

[0358] Then calculate the temporary matrix M (XYZ_Matrix):

[0359]

[0360] Then calculate the inverse matrix M(XYZ_Matrix_inverse) of M(XYZ_Matrix), and calculate the matrix M(S):

[0361]

[0362] The matrix M(Panel) is calculated:

[0363]

[0364] Calculate the inverse matrix M(InversePanel) of M(Panel);

[0365] The third color enhancement matrix M(DCI-P3Enhance2Panel)=M(InversePanel)*M(Target).

[0366] Therefore, in the embodiment of the present application, when the color display mode of the electronic device is the DCI-P3 color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, the color gamut space where the color of the content to be displayed is located is the second color gamut space, then the color of the content to be displayed is divided into a first color located in the first color gamut space, a third color located in the fourth color gamut space, and a seventh color located at the boundary of the second color gamut space, the first color in the first color gamut space is converted into the second color according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix, so as to map the second color in the first color gamut space to the third color gamut space. Color gamut space; the third color of the fourth color gamut space is divided into fifth colors located in different sub-color gamut spaces, the fifth color in each sub-color gamut space is converted into a sixth color according to its corresponding sub-color conversion matrix, and then the sixth color is enhanced according to the corresponding sub-color enhancement matrix, so that the third color of the fourth color gamut space is evenly mapped to the fifth color gamut space; and the seventh color at the boundary of the second color gamut space is mapped to the boundary of the fifth color gamut space according to the third color enhancement matrix, so as to gradually realize the enhanced display of the overall color of the content to be displayed, so that the overall color of the content to be displayed is coordinated, natural and more vivid, thereby improving the display effect of the electronic device.

[0367] In one embodiment, if the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the second color gamut space, then the color of the content to be displayed corresponding to the second color gamut space is converted into the color of the new content to be displayed corresponding to the first color gamut space according to the fourth color conversion matrix, and the color of the new content to be displayed is enhanced according to the first color enhancement matrix.

[0368] For example, if the color display mode of the electronic device is the sRGB color display mode, and the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, then the color gamut space where the color of the content to be displayed is located is the second color gamut space. Since the color display mode of the electronic device cannot support the display of colors beyond the first color gamut space, it is necessary to obtain a fourth color conversion matrix, and convert the color of the content to be displayed in the second color gamut space into the color of the new content to be displayed corresponding to the first color gamut space through the fourth color conversion matrix, and enhance the color of the new content to be displayed according to the first color enhancement matrix.

[0369] The method for obtaining the fourth color conversion matrix may refer to the method for obtaining the first color conversion matrix, which will not be described in detail herein.

[0370] In the embodiment of the present application, when the color display mode of the electronic device is different, the display effect of the same color is different. For example, the first color display mode is the sRGB color display mode, and the second color display mode is the DCI-P3 color display mode. When the first color of the first color gamut space is displayed, the color display effect is different, which is easy to affect the user experience. In addition, considering that the color gamut space that the display screen of the current electronic device can display has exceeded the color gamut space that the color display mode can support, such as exceeding the color gamut space that the sRGB color display mode or the DCI-P3 color display mode can support. If the display screen of the electronic device is only used to display, for example, colors in the first color gamut space, the color display of the display screen is relatively dull, the colors are not rich enough, and the colors are not bright enough, which affects the display effect.

[0371] Therefore, the embodiment of the present application combines the current color display mode of the electronic device and the color gamut space where the color of the current content to be displayed is located, and performs corresponding color conversion processing and color enhancement processing, so that the display screen of the electronic device, regardless of whether it is in the first color display mode or the second color display mode, when displaying the color of the first color gamut space, the color display effect is consistent and the colors are more vivid, thereby improving the display effect of the electronic device.

[0372] For example, the color display mode of the electronic device is the sRGB color display mode, and the color of the content to be displayed is encoded by the sRGB color gamut standard, that is, the color gamut space where the color of the content to be displayed is located is the first color gamut space. In the embodiment of the present application, a third color gamut space can be set, and the third color gamut space is smaller than the second color gamut space and larger than the first color gamut space. According to the first color enhancement matrix, the color of the content to be displayed can be mapped from the first color gamut space to the third color gamut space, so that the display screen of the electronic device can display the color of the third color gamut space when displaying the content to be displayed, which exceeds the color of the first color gamut space. For another example, the color display mode of the electronic device is the DCI-P3 color display mode, and the content to be displayed includes a first color located in the first color gamut space. In the embodiment of the present application, According to the first color conversion matrix, the first color of the content to be displayed is converted into the second color, so that when the color display mode of the electronic device is the second color display mode, the display effect of the second color is displayed, which is consistent or close to the visual display effect of the first color when the color display mode of the electronic device is the first color display mode, and according to the first color enhancement matrix, the second color is mapped from the first color gamut space to the third color gamut space, so that when the display screen of the electronic device displays the content to be displayed, the color of the third color gamut space can be displayed, which exceeds the color of the first color gamut space, so that for the first color of the content to be displayed in the first color gamut space, no matter whether the color display mode of the electronic device is the first color display mode or the second color display mode, the display effect is consistent or close, thereby improving the user experience;Furthermore, the present application takes into account that the color of the content to be displayed is encoded by the DCI-P3 color gamut standard, and the content to be displayed includes a first color located in a first color gamut space and a third color located in a fourth color gamut space. It can be understood that the first color located in the first color gamut space is converted into a second color by a first color conversion matrix, and there is a first color change value between the second color and the first color. In order to make the third color of the content to be displayed located in the fourth color gamut space more evenly transition with the enhanced second color after enhancement processing, a plurality of continuous sub-color gamut spaces are set in the fourth color gamut space, the third color located in the fourth color gamut space is divided into fifth colors located in different sub-color gamut spaces, and a plurality of continuous sub-enhancement spaces are set correspondingly between the third color gamut space and the fifth color gamut space, and the sub-color gamut space corresponds to the sub-enhancement space one by one, and according to the sub-color conversion matrix corresponding to each sub-color gamut space, the fifth color of the corresponding sub-color gamut space is converted into a sixth color, and from the boundary of the first color gamut space to the boundary of the second color gamut, based on the first color change value, the fifth color change value of the sub-color gamut space becomes smaller and smaller until the second The seventh color at the boundary of the color gamut does not need to be changed, so that the overall color of the content to be displayed is naturally coordinated, and the initial color of the content to be displayed in different sub-color gamut spaces can be maintained as much as possible, and the sixth color converted from the fifth color of each sub-color gamut space is enhanced according to the sub-color enhancement matrix, and the seventh color at the boundary of the second color gamut space is enhanced according to the third color enhancement matrix, so that the color of the entire content to be displayed can be evenly mapped to the fifth color gamut space, and the display effect of the electronic device is enhanced. That is, in the embodiment of the present application, whether the content to be displayed is encoded by the sRGB color gamut standard or the DCI-P3 color gamut standard, it can be displayed vividly and without abnormality after the enhancement processing, and whether the color display mode of the electronic device is the sRGB color display mode or the DCI-P3 color display mode, all colors of the content to be displayed encoded by the sRGB color gamut standard and the first color in the content to be displayed encoded by the DCI-P3 color gamut standard are consistent or close in visual display effect after enhancement processing, thereby improving the visual experience of the user. ;

[0373] It should be noted that the color processing method for display content in the embodiment of the present application can also be implemented through 3D-LUT technology.

[0374] See also Figure 4 , Figure 4 The color processing device 300 is a schematic diagram of the structure of the color processing device provided in the embodiment of the present application. The color processing device can be applied to electronic devices. The color processing device 300 may include: a first acquisition module 301, a second acquisition module 302, a first processing module 303, and a second processing module 304.

[0375] The first acquisition module 301 is used to: acquire a color display mode of the electronic device, where the color display mode includes at least a first color display mode and a second color display mode, where the first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space, where the first color gamut space is smaller than the second color gamut space;

[0376] The second acquisition module 302 is used to: acquire the color gamut space where the color of the content to be displayed is located;

[0377] The first processing module 303 is used to: if the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, then enhance the color of the content to be displayed according to the first color enhancement matrix;

[0378] The second processing module 304 is used for: if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, then according to the first color conversion matrix, the first color corresponding to the second color display mode is converted into the second color corresponding to the first color display mode, and the second color is enhanced according to the first color enhancement matrix.

[0379] In one implementation, the first processing module 303 may be used to:

[0380] Setting a third color gamut space, the third color gamut space is smaller than the second color gamut space and larger than the first color gamut space;

[0381] A first color enhancement matrix is ​​obtained for mapping the first color gamut space to a third color gamut space.

[0382] In one implementation, there is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the second processing module 304 may be used to:

[0383] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes the third color in the fourth color gamut space, a fifth color gamut space is set, and the fifth color gamut space is larger than the second color gamut space;

[0384] Obtain a first color change value for converting a first color into a second color;

[0385] Converting the third color to a fourth color according to a second color conversion matrix corresponding to a fourth color gamut space, wherein a second color change value of the conversion from the third color to the fourth color is less than the first color change value;

[0386] The fourth color is enhanced according to the second color enhancement matrix.

[0387] In one implementation, there is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the second processing module 304 may be used to:

[0388] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a color in the fourth color gamut space, the fourth color gamut space is set to have a plurality of continuous sub-color gamut spaces, and the color in the fourth color gamut space is divided into fifth colors in different sub-color gamut spaces;

[0389] Setting a fifth color gamut space, the fifth color gamut space being larger than the second color gamut space, and setting a plurality of continuous sub-enhancement spaces correspondingly between the third color gamut space and the fifth color gamut space, the sub-color gamut spaces corresponding one to one with the sub-enhancement spaces;

[0390] Obtain a first color change value for converting a first color into a second color;

[0391] According to the sub-color conversion matrix corresponding to each sub-color gamut space, the fifth color of the corresponding sub-color gamut space is converted into a sixth color, the third color change value of the conversion of the fifth color into the sixth color is less than the first color change value, and the further the sub-color gamut space is from the first color gamut space, the greater the difference between the corresponding third color change value and the first color change value;

[0392] according to.

[0393] In one implementation, the second color gamut space includes a boundary of the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the second processing module 304 may be used to:

[0394] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a seventh color located at the boundary of the second color gamut space, the seventh color is enhanced according to a third color enhancement matrix, and the third color enhancement matrix is ​​used to map the boundary of the second color gamut space to the boundary of the fifth color gamut space.

[0395] In one implementation, after obtaining the color gamut space where the color of the content to be displayed is located, the first processing module 303 may be used to:

[0396] If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the second color gamut space, the color of the content to be displayed corresponding to the second color gamut space is converted into the color of new content to be displayed corresponding to the first color gamut space according to the fourth color conversion matrix, and the color of the new content to be displayed is enhanced according to the first color enhancement matrix.

[0397] In one implementation, the first processing module 303 may be used to:

[0398] Normalizing the three-primary color data of the second color to obtain normalized three-primary color data;

[0399] Performing linearization processing on the normalized three-primary color data to obtain linearized data;

[0400] Performing enhancement processing on the linearized data according to a second color enhancement matrix to obtain enhanced data;

[0401] Perform inverse linearization processing on the enhanced data to obtain inverse linearized data;

[0402] Performing inverse normalization on the inverse linearized data to obtain a new second color after enhancement processing;

[0403] The electronic device performs a display according to the new second color.

[0404] The application embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the process in the color processing method provided in this embodiment.

[0405] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the process in the color processing method provided in the present embodiment by calling a computer program stored in the memory.

[0406] For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0407] The electronic device 400 may include components such as a display screen 401, a memory 402, and a processor 403. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0408] Display screen 401 may be used to display content to be displayed, such as information input by a user or information provided to a user, and various graphical user interfaces of the electronic device, which may be composed of images, texts, icons, videos, and any combination thereof.

[0409] The memory 402 may be used to store applications and data. The applications stored in the memory 402 include executable codes. The applications may be composed of various functional modules. The processor 403 executes various functional applications and data processing by running the applications stored in the memory 402. The processor 403 is electrically connected to the memory 402.

[0410] The processor 403 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the electronic device as a whole.

[0411] In this embodiment, the processor 403 in the electronic device loads the executable code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application program stored in the memory 402, thereby executing:

[0412] Acquire a color display mode of the electronic device, the color display mode including at least a first color display mode and a second color display mode, the first color display mode supports displaying colors in a first color gamut space, the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space;

[0413] Get the color gamut space of the color of the content to be displayed;

[0414] If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, enhancing the color of the content to be displayed according to the first color enhancement matrix;

[0415] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into a second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

[0416] See also Figure 6 , Figure 6A second structural diagram of an electronic device provided in an embodiment of the present application. The electronic device 400 further includes components such as a radio frequency circuit 404, a control circuit 405, an input unit 406, an audio circuit 407, a sensor 408, and a power supply 409. The processor 403 is electrically connected to the radio frequency circuit 403, the display screen 404, the control circuit 405, the input unit 406, the audio circuit 407, the sensor 408, and the power supply 409, respectively.

[0417] The radio frequency circuit 404 is used to send and receive radio frequency signals to communicate with network devices or other electronic devices through wireless communication.

[0418] The control circuit 405 is electrically connected to the display screen 404 and is used to control the display screen 404 to display information.

[0419] The input unit 406 can be used to receive input numbers, character information or user feature information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. The input unit 406 can include a fingerprint recognition module.

[0420] The audio circuit 407 can provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 407 includes a microphone. The microphone is electrically connected to the processor 403. The microphone is used to receive voice information input by the user.

[0421] The sensor 408 is used to collect external environment information. The sensor 408 may include one or more sensors such as an environment brightness sensor, an acceleration sensor, and a gyroscope.

[0422] The power supply 409 is used to supply power to various components of the electronic device 400. In some embodiments, the power supply 409 may be logically connected to the processor 403 through a power management system, so that the power management system can manage charging, discharging, power consumption, and other functions.

[0423] Although not shown in the figure, the electronic device 400 may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0424] In this embodiment, the processor 403 in the electronic device 400 will load the executable code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 403 will run the application program stored in the memory 402 to execute:

[0425] Acquire a color display mode of the electronic device, the color display mode including at least a first color display mode and a second color display mode, the first color display mode supports displaying colors in a first color gamut space, the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space;

[0426] Get the color gamut space of the color of the content to be displayed;

[0427] If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, enhancing the color of the content to be displayed according to the first color enhancement matrix;

[0428] If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into a second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

[0429] In one implementation, before the color enhancement processing is performed on the to-be-displayed content according to the first color enhancement matrix, the processor 403 performs setting of a third color gamut space, the third color gamut space being smaller than the second color gamut space and larger than the first color gamut space;

[0430] A first color enhancement matrix is ​​obtained for mapping the first color gamut space to a third color gamut space.

[0431] In one implementation, there is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the processor 403 executes if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a third color located in the fourth color gamut space, then setting a fifth color gamut space, wherein the fifth color gamut space is larger than the second color gamut space;

[0432] Obtaining a first color change value for converting the first color into the second color;

[0433] converting the third color into a fourth color according to a second color conversion matrix corresponding to the fourth color gamut space, wherein a second color change value of the third color converted into the fourth color is less than the first color change value;

[0434] The fourth color is enhanced according to a second color enhancement matrix, where the second color enhancement matrix is ​​used to map the fourth color gamut space to the fifth color gamut space.

[0435] In one implementation, there is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the processor 403 executes: if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes the color located in the fourth color gamut space, the fourth color gamut space is set to a plurality of continuous sub-color gamut spaces, and the color located in the fourth color gamut space is divided into fifth colors located in different sub-color gamut spaces;

[0436] Setting a fifth color gamut space, the fifth color gamut space being larger than the second color gamut space, and setting a plurality of continuous sub-enhancement spaces correspondingly between the third color gamut space and the fifth color gamut space, the sub-color gamut spaces corresponding one to one to the sub-enhancement spaces;

[0437] Obtaining a first color change value for converting the first color into the second color;

[0438] According to the sub-color conversion matrix corresponding to each of the sub-color gamut spaces, a fifth color of the corresponding sub-color gamut space is converted into a sixth color, a third color change value obtained by converting the fifth color into the sixth color is less than the first color change value, and the further the sub-color gamut space is from the first color gamut space, the greater the difference between the third color change value corresponding to the sub-color gamut space and the first color change value;

[0439] The sixth color in each sub-color gamut space is enhanced according to its corresponding sub-color enhancement matrix, and the sub-color enhancement matrix is ​​used to map each of the sub-color gamut spaces to a corresponding sub-enhancement space.

[0440] In one embodiment, the second color gamut space includes the boundary of the second color gamut space. After obtaining the color gamut space where the color of the content to be displayed is located, the processor 403 executes if the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a seventh color located at the boundary of the second color gamut space, enhancing the seventh color according to a third color enhancement matrix, and the third color enhancement matrix is ​​used to map the boundary of the second color gamut space to the boundary of the fifth color gamut space.

[0441] In one embodiment, after obtaining the color gamut space where the color of the content to be displayed is located, the processor 403 executes if the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the second color gamut space, then according to the fourth color conversion matrix, the color of the content to be displayed corresponding to the second color gamut space is converted into the color of the new content to be displayed corresponding to the first color gamut space, and the color of the new content to be displayed is enhanced according to the first color enhancement matrix.

[0442] In one implementation, in the process of enhancing the second color according to the first color enhancement matrix, the processor 403 performs normalization processing on the three primary color data of the second color to obtain normalized three primary color data;

[0443] Performing linearization processing on the normalized three-primary color data to obtain linearized data;

[0444] Performing enhancement processing on the linearized data according to the first color enhancement matrix to obtain enhanced data;

[0445] Performing inverse linearization processing on the enhanced data to obtain inverse linearized data;

[0446] Performing inverse normalization processing on the inverse linearized data to obtain a new second color after enhancement processing;

[0447] The electronic device performs display according to the new second color.

[0448] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the color processing method above, and will not be repeated here.

[0449] The color processing device provided in the embodiment of the present application belongs to the same concept as the color processing method in the above embodiment. Any method provided in the color processing method embodiment can be run on the color processing device. The specific implementation process is detailed in the color processing method embodiment, which will not be repeated here.

[0450] It should be noted that, for the color processing method of the embodiment of the present application, a person skilled in the art can understand that the implementation of all or part of the process of the color processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and the execution process may include the process of the embodiment of the color processing method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.

[0451] For the color processing device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.

[0452] The color processing method, device, storage medium and electronic device provided in the embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A color processing method, applied to electronic equipment, characterized in that: The method comprises: Acquire a color display mode of the electronic device, the color display mode including at least a first color display mode and a second color display mode, the first color display mode supports displaying colors in a first color gamut space, the second color display mode supports displaying colors in a second color gamut space, and the first color gamut space is smaller than the second color gamut space; Get the color gamut space of the color of the content to be displayed; If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the first color gamut space, enhancing the color of the content to be displayed according to the first color enhancement matrix; If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed includes a first color located in the first color gamut space, the first color corresponding to the second color display mode is converted into a second color corresponding to the first color display mode according to the first color conversion matrix, and the second color is enhanced according to the first color enhancement matrix.

2. The color processing method according to claim 1, characterized in that: Before performing color enhancement processing on the content to be displayed according to the first color enhancement matrix, the method further includes: Setting a third color gamut space, wherein the third color gamut space is smaller than the second color gamut space and larger than the first color gamut space; A first color enhancement matrix is ​​obtained for mapping the first color gamut space to a third color gamut space.

3. The color processing method according to claim 1, characterized in that: There is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the method further includes: If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a third color in the fourth color gamut space, a fifth color gamut space is set, and the fifth color gamut space is larger than the second color gamut space; Obtaining a first color change value for converting the first color into the second color; converting the third color into a fourth color according to a second color conversion matrix corresponding to the fourth color gamut space, wherein a second color change value of the third color converted into the fourth color is less than the first color change value; The fourth color is enhanced according to a second color enhancement matrix, where the second color enhancement matrix is ​​used to map the fourth color gamut space to the fifth color gamut space.

4. The color processing method according to claim 1, characterized in that: There is a fourth color gamut space between the first color gamut space and the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the method further includes: If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a color located in the fourth color gamut space, the fourth color gamut space is set to have a plurality of continuous sub-color gamut spaces, and the color located in the fourth color gamut space is divided into fifth colors located in different sub-color gamut spaces; Setting a fifth color gamut space, the fifth color gamut space being larger than the second color gamut space, and setting a plurality of continuous sub-enhancement spaces correspondingly between the third color gamut space and the fifth color gamut space, the sub-color gamut spaces corresponding one to one to the sub-enhancement spaces; Obtaining a first color change value for converting the first color into the second color; According to the sub-color conversion matrix corresponding to each of the sub-color gamut spaces, a fifth color of the corresponding sub-color gamut space is converted into a sixth color, a third color change value obtained by converting the fifth color into the sixth color is less than the first color change value, and the further the sub-color gamut space is from the first color gamut space, the greater the difference between the third color change value corresponding to the sub-color gamut space and the first color change value; The sixth color in each sub-color gamut space is enhanced according to its corresponding sub-color enhancement matrix, and the sub-color enhancement matrix is ​​used to map each of the sub-color gamut spaces to a corresponding sub-enhancement space.

5. The color processing method according to claim 3 or 4, characterized in that: The second color gamut space includes a boundary of the second color gamut space. After acquiring the color gamut space where the color of the content to be displayed is located, the method further includes: If the color display mode of the electronic device is the second color display mode, and the color of the content to be displayed also includes a seventh color located at the boundary of the second color gamut space, the seventh color is enhanced according to a third color enhancement matrix, and the third color enhancement matrix is ​​used to map the second color gamut space boundary to the fifth color gamut space boundary.

6. The color processing method according to claim 1, characterized in that: After obtaining the color gamut space where the color of the content to be displayed is located, the method further includes: If the color display mode of the electronic device is the first color display mode, and the color gamut space where the color of the content to be displayed is located is the second color gamut space, the color of the content to be displayed corresponding to the second color gamut space is converted into the color of new content to be displayed corresponding to the first color gamut space according to the fourth color conversion matrix, and the color of the new content to be displayed is enhanced according to the first color enhancement matrix.

7. The color processing method according to claim 1, characterized in that: The performing enhancement processing on the second color according to the first color enhancement matrix comprises: Normalizing the three-primary color data of the second color to obtain normalized three-primary color data; Performing linearization processing on the normalized three-primary color data to obtain linearized data; Performing enhancement processing on the linearized data according to the first color enhancement matrix to obtain enhanced data; Performing inverse linearization processing on the enhanced data to obtain inverse linearized data; Performing inverse normalization processing on the inverse linearized data to obtain a new second color after enhancement processing; The electronic device performs display according to the new second color.

8. A color processing device, applied to electronic equipment, characterized in that: The device comprises: A first acquisition module is used to acquire a color display mode of the electronic device, wherein the color display mode includes at least a first color display mode and a second color display mode, wherein the first color display mode supports displaying colors in a first color gamut space, and the second color display mode supports displaying colors in a second color gamut space, wherein the first color gamut space is smaller than the second color gamut space; The second acquisition module is used to acquire the color gamut space where the color of the content to be displayed is located; a first processing module, configured to enhance the color of the content to be displayed according to a first color enhancement matrix if the color display mode of the electronic device is the first color display mode and the color gamut space where the color of the content to be displayed is located is the first color gamut space; A second processing module is used to convert the first color corresponding to the second color display mode into the second color corresponding to the first color display mode according to the first color conversion matrix if the color display mode of the electronic device is the second color display mode and the color of the content to be displayed includes the first color located in the first color gamut space, and enhance the second color according to the first color enhancement matrix.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. An electronic device comprising a display screen, a memory and a processor, characterized in that: The processor is configured to execute the method according to any one of claims 1 to 7 by calling the computer program stored in the memory.