IP Library Granted Patent US 12706070
Granted Patent B2
US 12706070 · App. 19/297,095 · Granted Aug 11, 2026

Image processing method and electronic device

Inventors: Tao Shao (Shenzhen, CN); Liyou Wu (Shenzhen, CN); Guoqiao Chen (Shenzhen, CN); Yue Ding (Shenzhen, CN)
Assignee: HONOR DEVICE CO., LTD.
G09G5/10G09G2320/0242G09G2320/029G09G2320/0626G09G2320/0666G09G2320/0673G09G2340/06
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12706070
App. No.
19/297,095
Filed
Aug 12, 2025
Granted
Aug 11, 2026
Kind
B2
Art Unit
2626
USPC
345/690
Abstract

This application relates to image processing and provides a method and electronic device. The method includes: capturing a to-be-displayed image; detecting a display operation on the image; obtaining brightness channel data in response; acquiring a pixel brightness value based on the channel data; determining a target brightness value based on a current screen brightness and a first brightness value; selecting a first or second gain coefficient according to the pixel brightness value to process the pixel and generate a processed image; and adjusting the display screen to the target brightness value to display the processed image. This solution avoids image brightness distortion and expands the dynamic range, making the displayed image more vivid and closer to actual scenarios.

Claims (77)

1 . An image processing method, applied to an electronic device, wherein the electronic device comprises a display screen, and the image processing method comprises:

capturing a to-be-displayed image;

detecting a display operation performed on the to-be-displayed image; obtaining brightness channel data of the to-be-displayed image in response to the display operation;

obtaining a brightness value of a pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image;

determining a target brightness value based on a current brightness value of the display screen and a first brightness value, wherein the first brightness value indicates brightness that is supported by the display screen;

selecting a first gain coefficient or a second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and generating a processed image, wherein the first gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is less than a first threshold, the second gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is greater than or equal to the first threshold, the first threshold is related to brightness of a photographing scenario in which the electronic device is located, the first gain coefficient is 1, the second gain coefficient is linearly directly proportional to the brightness value of the pixel in the to-be-displayed image, and the second gain coefficient is greater than 1; and

adjusting brightness of the display screen to the target brightness value, and displaying the processed image.

2 . The image processing method according to claim 1 , wherein when the to-be-displayed image is an image captured by the electronic device, the obtaining the brightness value of the pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image comprises:

obtaining an inverse gamma curve of the to-be-displayed image;

processing the brightness channel data of the to-be-displayed image based on the inverse gamma curve, to obtain processed brightness data; and

processing the processed brightness data based on a second coefficient, to obtain the brightness value of the pixel in the to-be-displayed image, wherein the second coefficient is directly proportional to a dynamic range value of the to-be-displayed image.

3 . The image processing method according to claim 1 , wherein when the to-be-displayed image is an image downloaded or received by the electronic device, the obtaining the brightness value of the pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image comprises:

obtaining a first parameter based on color space in which the to-be-displayed image is located, wherein the first parameter is an index of a gamma curve;

obtaining an inverse gamma curve of the to-be-displayed image based on the first parameter;

processing the brightness channel data of the to-be-displayed image based on the inverse gamma curve, to obtain processed brightness data; and

processing the processed brightness data based on a second coefficient, to obtain the brightness value of the pixel in the to-be-displayed image, wherein the second coefficient is directly proportional to a dynamic range value of the to-be-displayed image.

4 . The image processing method according to claim 1 , wherein the selecting the first gain coefficient or the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and the generating the processed image comprises:

performing compression processing on a pixel value of the pixel in the to-be-displayed image based on a first coefficient, to obtain a second image, wherein the first coefficient is a ratio of the current brightness value to the target brightness value;

when the brightness value of the pixel in the to-be-displayed image is less than the first threshold, adjusting the pixel value of the pixel in the second image based on the first gain coefficient; or

when the brightness value of the pixel in the to-be-displayed image is greater than or equal to the first threshold, adjusting the pixel value of the pixel in the second image based on the second gain coefficient; and

generating the processed image.

5 . The image processing method according to claim 1 , further comprising:

determining a gain function based on the first threshold and a dynamic range value of the to-be-displayed image, wherein the gain function is a directly proportional function; and

determining the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image and the gain function.

6 . The image processing method according to claim 5 , wherein the gain function is G(x)=(K1−1)/(K2−V1)*(V−V1)+1, wherein K1 represents a third gain value, and the third gain value is directly proportional to the dynamic range of the to-be-displayed image; K2 represents a maximum value of a pixel value corresponding to a number of bits of the to-be-displayed image; V represents the brightness value of the pixel in the to-be-displayed image; and V1 represents the first threshold.

7 . The image processing method according to claim 1 , wherein the selecting the first gain coefficient or the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and the generating the processed image comprises:

when the brightness value of the pixel in the to-be-displayed image is less than the first threshold, adjusting the pixel value of the pixel in the to-be-displayed image based on the first gain coefficient; or

when the brightness value of the pixel in the to-be-displayed image is greater than or equal to the first threshold, adjusting the pixel value of the pixel in the to-be-displayed image based on the second gain coefficient; and

generating the processed image.

8 . The image processing method according to claim 1 , wherein after the displaying the processed image, the method further comprises:

when a first operation performed on the electronic device is detected, adjusting the brightness of the display screen to the current brightness value, wherein the first operation is an operation to exit displaying of the to-be-displayed image.

9 . The image processing method according to claim 1 , wherein after the displaying the processed image, the method further comprises:

when detecting that the electronic device is in a screen-off state, or when detecting that the current brightness value is less than a second threshold, deleting the processed image.

10 . The image processing method according to claim 9 , further comprising:

when detecting a second operation or a third operation performed on the display screen, generating the processed image, wherein the second operation is an unlocking operation performed on the electronic device, and the third operation is a screen-on operation performed on the display screen; and adjusting the brightness of the display screen to the target brightness value, and displaying the processed image.

11 . An electronic device, comprising:

a display screen,

one or more processors and a memory,

wherein the memory is coupled to the one or more processors, the memory is configured to store computer program code, the computer program code comprises computer instructions, and the one or more processors invoke the computer instructions, to enable the one or more processors to perform the following operations:

capturing a to-be-displayed image;

detecting a display operation performed on the to-be-displayed image;

obtaining brightness channel data of the to-be-displayed image in response to the display operation;

obtaining a brightness value of a pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image;

determining a target brightness value based on a current brightness value of the display screen and a first brightness value, wherein the first brightness value indicates brightness that is supported by the display screen;

selecting a first gain coefficient or a second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and generating a processed image, wherein the first gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is less than a first threshold, the second gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is greater than or equal to the first threshold, the first threshold is related to brightness of a photographing scenario in which the electronic device is located, the first gain coefficient is 1, the second gain coefficient is linearly directly proportional to the brightness value of the pixel in the to-be-displayed image, and the second gain coefficient is greater than 1; and

adjusting brightness of the display screen to the target brightness value, and displaying the processed image.

12 . The electronic device according to claim 11 , wherein when the to-be-displayed image is an image captured by the electronic device, the obtaining the brightness value of the pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image comprises:

obtaining an inverse gamma curve of the to-be-displayed image; processing the brightness channel data of the to-be-displayed image based on the inverse gamma curve, to obtain processed brightness data; and

processing the processed brightness data based on a second coefficient, to obtain the brightness value of the pixel in the to-be-displayed image, wherein the second coefficient is directly proportional to a dynamic range value of the to-be-displayed image.

13 . The electronic device according to claim 11 , wherein when the to-be-displayed image is an image downloaded or received by the electronic device, the obtaining the brightness value of the pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image comprises:

obtaining a first parameter based on color space in which the to-be-displayed image is located, wherein the first parameter is an index of a gamma curve;

obtaining an inverse gamma curve of the to-be-displayed image based on the first parameter;

processing the brightness channel data of the to-be-displayed image based on the inverse gamma curve, to obtain processed brightness data; and

processing the processed brightness data based on a second coefficient, to obtain the brightness value of the pixel in the to-be-displayed image, wherein the second coefficient is directly proportional to a dynamic range value of the to-be-displayed image.

14 . The electronic device according to claim 11 , wherein the selecting the first gain coefficient or the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and the generating the processed image comprises:

performing compression processing on a pixel value of the pixel in the to-be-displayed image based on a first coefficient, to obtain a second image, wherein the first coefficient is a ratio of the current brightness value to the target brightness value;

when the brightness value of the pixel in the to-be-displayed image is less than the first threshold, adjusting the pixel value of the pixel in the second image based on the first gain coefficient; or

when the brightness value of the pixel in the to-be-displayed image is greater than or equal to the first threshold, adjusting the pixel value of the pixel in the second image based on the second gain coefficient; and

generating the processed image.

15 . The electronic device according to claim 11 , further comprising:

determining a gain function based on the first threshold and a dynamic range value of the to-be-displayed image, wherein the gain function is a directly proportional function; and

determining the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image and the gain function.

16 . The electronic device according to claim 15 , wherein the gain function is G(x)=(K1−1)/(K2−V1)*(V−V1)+1, wherein K1 represents a third gain value, and the third gain value is directly proportional to the dynamic range of the to-be-displayed image; K2 represents a maximum value of a pixel value corresponding to a number of bits of the to-be-displayed image; V represents the brightness value of the pixel in the to-be-displayed image; and Vi represents the first threshold.

17 . The electronic device according to claim 11 , wherein the selecting the first gain coefficient or the second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and the generating the processed image comprises:

when the brightness value of the pixel in the to-be-displayed image is less than the first threshold, adjusting the pixel value of the pixel in the to-be-displayed image based on the first gain coefficient; or

when the brightness value of the pixel in the to-be-displayed image is greater than or equal to the first threshold, adjusting the pixel value of the pixel in the to-be-displayed image based on the second gain coefficient; and generating the processed image.

18 . The electronic device according to claim 11 , wherein after the displaying the processed image, the method further comprises:

when a first operation performed on the electronic device is detected, adjusting the brightness of the display screen to the current brightness value, wherein the first operation is an operation to exit displaying of the to-be-displayed image.

19 . The electronic device according to claim 11 , wherein after the displaying the processed image, the method further comprises:

when detecting that the electronic device is in a screen-off state, or when detecting that the current brightness value is less than a second threshold, deleting the processed image.

20 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores a computer program; and when the computer program is executed by a processor, the processor is enabled to perform the following operations:

capturing a to-be-displayed image;

detecting a display operation performed on the to-be-displayed image;

obtaining brightness channel data of the to-be-displayed image in response to the display operation; obtaining a brightness value of a pixel in the to-be-displayed image based on the brightness channel data of the to-be-displayed image;

determining a target brightness value based on a current brightness value of a display screen of an electronic device and a first brightness value, wherein the first brightness value indicates brightness that is supported by the display screen;

selecting a first gain coefficient or a second gain coefficient based on the brightness value of the pixel in the to-be-displayed image to process the pixel in the to-be-displayed image, and generating a processed image, wherein the first gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is less than a first threshold, the second gain coefficient is configured to adjust a pixel that is in the to-be-displayed image and whose brightness value is greater than or equal to the first threshold, the first threshold is related to brightness of a photographing scenario in which the electronic device is located, the first gain coefficient is 1, the second gain coefficient is linearly directly proportional to the brightness value of the pixel in the to-be-displayed image, and the second gain coefficient is greater than 1; and

adjusting brightness of the display screen to the target brightness value, and displaying the processed image.