Image processing method, electronic device, storage medium and computer program product

By simultaneously editing the SDR image and gain map during the image editing process, the problem of HDR effect loss after image editing is solved, and HDR effect can still be presented after image editing.

WO2026148874A1PCT designated stage Publication Date: 2026-07-16HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-08-22
Publication Date
2026-07-16

AI Technical Summary

Technical Problem

After image editing, electronic devices are unable to display the HDR effect, resulting in a loss of HDR quality.

Method used

During image editing, not only is the SDR image edited, but also the edited gain map is obtained through dynamic range transformation information and the edited SDR image. The edited SDR image and gain map are then stored or displayed to maintain the HDR effect.

Benefits of technology

By synchronously editing the gain map, we ensure that the image still presents an HDR effect after editing, thus avoiding the loss or abnormality of the HDR effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025116483_16072026_PF_FP_ABST
    Figure CN2025116483_16072026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are an image processing method, an electronic device, a computer-readable storage medium and a computer program product. The method comprises: an electronic device displaying a high dynamic range (HDR) image on the basis of a first standard dynamic range (SDR) image and a first gain map, or displaying the first SDR image; in response to an image editing operation, performing editing processing on the first SDR image, so as to obtain a second SDR image, and obtaining a second gain map on the basis of dynamic range transformation information and the second SDR image; storing the second gain map and the second SDR image; and on the basis of the second gain map and the second SDR image, displaying an edited HDR image. The dynamic range transformation information is obtained on the basis of the first SDR image and the first gain map, and is used for describing the transformation relationship from an SDR image to an HDR image; and the second gain map is a gain map comprising editing content corresponding to the image editing operation. By means of the embodiments of the present application, an HDR effect can still be presented after image editing.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing methods, electronic devices, storage media, and computer program products

[0001] This application claims priority to Chinese Patent Application No. 202510057119.0, filed on January 10, 2025, entitled "Image Processing Method, Electronic Device, Storage Medium and Computer Program Product", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of imaging technology, and more particularly to an image processing method, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0003] With the continuous development and advancement of imaging technology, more and more electronic devices support High Dynamic Range (HDR) imaging and display.

[0004] During the HDR imaging stage, after acquiring the Standard Dynamic Range (SDR) image and gain map, the electronic device stores the SDR image and gain map in an HDR image file. During the HDR display stage, the electronic device can display the HDR image on the screen based on the SDR image and gain map in the HDR image file to achieve the HDR effect.

[0005] In related technologies, when an electronic device displays an HDR image or an SDR image based on an HDR image file, if an image editing operation is detected, the device responds by editing the SDR image in the HDR image file to obtain and store the edited SDR image. When a user needs to view the edited image, the electronic device displays the edited image on the screen based on the edited SDR image. However, the edited SDR image cannot reproduce the HDR effect; that is, the HDR effect is lost after image editing. Summary of the Invention

[0006] This application provides an image processing method, an electronic device, a computer-readable storage medium, and a computer program product, which can solve the problem of HDR effect loss after image editing.

[0007] In a first aspect, embodiments of this application provide an image processing method in which an electronic device displays a first HDR image based on a first SDR image and a first gain map, or when displaying the first SDR image, if an image editing operation is received, the electronic device, in response to the image editing operation, edits the first SDR image to obtain a second SDR image; after acquiring dynamic range transformation information, the electronic device obtains a second gain map based on the dynamic range transformation information and the second SDR image; and displays the second HDR image based on the second gain map and the second SDR image, or stores the second gain map and the second SDR image so that the second HDR image can be displayed subsequently based on the second gain map and the second SDR image.

[0008] The dynamic range transformation information is obtained based on the first SDR image and the first gain map, and is used to describe the transformation relationship from a standard dynamic range image to a high dynamic range image, or to describe the transformation relationship from a standard dynamic range image to a gain map. The second gain map is a gain map that includes the edited content corresponding to the image editing operation; that is, the second gain map is the edited gain map. The second HDR image is an HDR image that includes the edited content corresponding to the image editing operation; that is, the second HDR image is the edited HDR image.

[0009] Upon receiving an image editing operation, this embodiment not only edits the first SDR image to obtain a second SDR image (i.e., the edited SDR image) in response to the image editing operation, but also obtains a second gain map (i.e., the edited gain map) based on the dynamic range transformation information and the second SDR image, and stores the second gain map and the second SDR image, or displays a second HDR image based on the second gain map and the second SDR image. Thus, based on the edited SDR image (i.e., the second SDR image) corresponding to the image editing operation, and the edited gain map (i.e., the second gain map) corresponding to the image editing operation, the edited HDR image can be displayed, ensuring that the image still exhibits an HDR effect after editing.

[0010] In contrast, related technologies only edit the SDR image during image editing, without processing the gain map in the same way. Furthermore, the gain map is discarded, and only the edited SDR image is saved. Thus, the edited image file only contains the edited SDR image, and since it only relies on the edited SDR image, it cannot reproduce HDR effects, resulting in a loss of HDR functionality after image editing.

[0011] In this embodiment, during image editing, not only is the SDR image edited, but an edited gain map is also obtained using dynamic range transformation information and the edited SDR image. Based on the second gain map and the second SDR image, the edited HDR image is displayed, or both the edited SDR image and the edited gain map are saved simultaneously. Thus, the edited HDR image can be displayed based on the edited SDR image and the edited gain map, without any loss of HDR effect.

[0012] In some possible implementations of the first aspect, when dynamic range transform information is used to describe the transformation relationship from a standard dynamic range image to a high dynamic range image, during the process of obtaining a second gain map based on the dynamic range transform information and the second SDR image, the electronic device can first perform dynamic range transform processing on the second SDR image based on the dynamic range transform information to obtain a third HDR image, and then obtain the second gain map based on the second SDR image and the third HDR image. The third HDR image is an HDR image that includes the edited content corresponding to the image editing operation. That is, the third HDR image is also the edited HDR image. The second HDR image and the third HDR image have the same image content and can be regarded as the same image.

[0013] Compared to directly editing an HDR image to obtain an edited HDR image, this application embodiment transforms a second SDR image using dynamic range transformation information to obtain an edited HDR image. This supports a wider range of image editing operations and can improve image editing efficiency.

[0014] In some possible implementations of the first aspect, during the process of performing dynamic range transformation processing on the second SDR image based on dynamic range transformation information to obtain the third HDR image, the electronic device determines a guide map of the second SDR image; interpolates the dynamic range transformation information using the guide map to obtain pixel-by-pixel affine transformation parameters; and performs an affine transformation on the second SDR image using the pixel-by-pixel affine transformation parameters to obtain the third HDR image.

[0015] In some possible implementations of the first aspect, the electronic device can fuse the first SDR image and the first gain image to obtain the first HDR image, and then input the downsampled image of the first HDR image and the downsampled image of the first SDR image into a deep learning neural network to obtain the dynamic range transformation information output by the deep learning neural network.

[0016] In some possible implementations of the first aspect, when dynamic range transform information is used for the transformation relationship from a standard dynamic range image to a gain map, the electronic device can process the second SDR image based on the dynamic range transform information to obtain a second gain map. That is, the edited gain map can be obtained directly from the dynamic range transform information, without needing to first calculate the edited HDR image and then inversely calculate the edited gain map from the edited HDR image.

[0017] In some possible implementations of the first aspect, the dynamic range transformation information is stored in a first JPG file, which is an image file including a first SDR image and a first gain map. In this case, the electronic device can obtain the dynamic range transformation information from the first JPG file.

[0018] In some possible implementations of the first aspect, the dynamic range transformation information is stored in the metadata of the first JPG file.

[0019] In some possible implementations of the first aspect, the second SDR image and the second gain map are stored in a second JPG file, which is the image file corresponding to the edited HDR image, i.e., the edited image file; the second JPG file also stores dynamic range transformation information. Thus, based on the edited JPG file, the HDR effect can still be achieved after image editing; it also facilitates subsequent secondary editing.

[0020] In some possible implementations of the first aspect, the image editing operations include at least one of the following: image lighting operation, background blurring operation, image interior filling operation, image exterior filling operation, and image removal operation. The embodiments of this application support a wider range of editing operations, which can meet different user editing needs.

[0021] In some possible implementations of the first aspect, when the first SDR image and the first gain map are images in a live image file or a video file, the electronic device can also perform dynamic range transformation on each third SDR image according to the dynamic range transformation information to obtain a target HDR image corresponding to each third SDR image; for each third SDR image, a third gain map is obtained according to the target HDR image and the third SDR image, and the third gain map and the third SDR image are stored; the third SDR image is an SDR image obtained after editing other SDR images in the live image file or video file.

[0022] The embodiments of this application can also support the editing of live images and HDR videos, and the HDR effect can still be achieved after editing.

[0023] In some possible implementations of the first aspect, the dynamic range transformation information includes layered guidance information for image height, layered guidance information for image width, layered guidance information for image brightness range, and dynamic range transformation matrix of affine transformation parameters for each grid.

[0024] In a second aspect, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the first aspects above.

[0025] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.

[0026] Fourthly, embodiments of this application provide a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in any of the first aspects above. The chip system may be a single chip or a chip module composed of multiple chips.

[0027] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the method described in any of the first aspects above.

[0028] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0029] Figure 1 is a schematic diagram of the process of displaying images based on JPG files according to an embodiment of this application;

[0030] Figure 2 is a schematic diagram of an HDR shooting scene provided in an embodiment of this application;

[0031] Figure 3 is a schematic diagram of an image editing scenario provided in an embodiment of this application;

[0032] Figure 4 is a schematic diagram of the image editing process provided in an embodiment of this application;

[0033] Figure 5 is a schematic block diagram of the electronic device 500 provided in an embodiment of this application;

[0034] Figure 6 is a flowchart illustrating an image processing method provided in an embodiment of this application.

[0035] Figure 7 is another schematic diagram of the image editing interface provided in the embodiment of this application;

[0036] Figure 8 is a schematic diagram of the image editing process provided in an embodiment of this application;

[0037] Figure 9 is a schematic diagram of the dynamic range transformation information calculation process provided in the embodiment of this application;

[0038] Figure 10 is a schematic diagram of the inverse calculation process provided in an embodiment of this application;

[0039] Figure 11 is a schematic diagram of the second gain diagram calculation process provided in an embodiment of this application;

[0040] Figure 12A is an SDR image before background blurring provided in an embodiment of this application;

[0041] Figure 12B is an SDR image with background blurring provided in an embodiment of this application;

[0042] Figure 12C is a schematic diagram comparing the background blur editing display effect provided in the embodiment of this application;

[0043] Figure 12D is a comparative diagram of the gain map of the blurred region provided in the embodiment of this application;

[0044] Figure 13A shows the SDR image before image removal operation provided in an embodiment of this application;

[0045] Figure 13B is an SDR image after image removal operation provided in an embodiment of this application;

[0046] Figure 13C is a schematic diagram comparing the display effects of image removal editing provided in the embodiments of this application;

[0047] Figure 13D is a comparative diagram of gain maps provided in the embodiments of this application;

[0048] Figure 14A is a schematic block diagram of the processing procedure in an image lighting scenario provided in an embodiment of this application;

[0049] Figure 14B is a schematic flowchart of the dynamic range transformation matrix calculation process provided in an embodiment of this application;

[0050] Figure 14C is a schematic block diagram of the high-resolution migration calculation process provided in an embodiment of this application;

[0051] Figure 15A is a schematic diagram of the original SDR image provided in an embodiment of this application;

[0052] Figure 15B is an SDR image of a person after portrait lighting operation provided in an embodiment of this application;

[0053] Figure 15C is a comparison of portrait lighting editing effects provided in the embodiments of this application;

[0054] Figure 16 is a schematic block diagram of the live image editing process provided in the embodiment of this application;

[0055] FIG. 17 is a schematic block diagram of the structure of the image processing device provided in the embodiment of the present application. Detailed implementation manners

[0056] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application.

[0057] In the HDR imaging stage, an electronic device usually captures multiple images with different exposure degrees quickly and continuously with different exposure parameters, and then synthesizes the multiple images with different exposure degrees to obtain an HDR image. For example, after a mobile phone captures three images of underexposure, normal exposure, and overexposure through an imaging system, the three images are then synthesized into one HDR image.

[0058] The HDR image records the brightness values of the actual scene with more than 256 levels, and is usually a digital image with more than 8 bits. For example, the HDR image is usually a digital image with a bit depth of 10 bits or 12 bits. For example, the bit depth of HDR10 is 10 bits, the bit depth of HDR10+ is 10 bits to 16 bits, and the bit depth of Dolby Vision is greater than 12 bits.

[0059] However, the digital images stored on an electronic device are usually 8-bit digital images, and 8-bit digital images can only record 256 levels of brightness values. Therefore, the electronic device usually performs dynamic range compression on the HDR image through a tone mapping algorithm to compress and store the HDR image as 8-bit Joint Photographic Experts Group (JPEG or JPG) image data. Specifically, the electronic device first fuses multiple images with different exposure degrees to obtain an HDR image; then maps the HDR image to an 8-bit SDR image through tone mapping, and stores the SDR image in a JPG file; in addition, the information of the medium-highlight part in the fused HDR image is taken to generate a gain map, and the gain map is stored in the JPG file.

[0060] Among them, the gain map (or HDR gain layer) is a grayscale image that records the true brightness, contrast, and other information of the highlight part of the HDR image.

[0061] The JPG file obtained through the HDR imaging stage includes an SDR image and a gain map. The electronic device can rely on the SDR image and the gain map to display the HDR image on an HDR display screen to present the HDR effect; or display the SDR image on an SDR display screen or an HDR display screen to present the SDR effect. In this way, the HDR effect can be presented on the HDR display screen, and the SDR display screen can also be compatible.

[0062] Exemplarily, referring to the schematic diagram of the process of image display based on JPG files provided by the embodiment of the present application shown in FIG. 1, after obtaining a JPG file in the HDR imaging stage, a gain map and an SDR image are obtained from the JPG file; in the display processing process, the gain map and the SDR image are fused to obtain an HDR image; the HDR image is displayed on the display screen to present an HDR effect.

[0063] If the display screen of the electronic device is an SDR display screen, or the user needs the electronic device to present an SDR effect, then an SDR image is obtained from the JPG file and the SDR image is displayed on the display screen.

[0064] In the HDR shooting scenario, the electronic device can obtain a JPG file through the HDR imaging algorithm, and display an HDR image or an SDR image according to the JPG file.

[0065] Exemplarily, referring to the schematic diagram of the HDR shooting scenario provided by the embodiment of the present application shown in FIG. 2, the mobile phone 11 supports HDR imaging and HDR display functions. Icons of application programs such as the camera 111 and the gallery 112 are displayed on the main interface of the mobile phone 11. The user clicks on the icon of the camera 111 to open the camera. After the mobile phone 11 detects a click operation on the camera 111, in response to the click operation, a photo-taking preview interface 113 is displayed. The picture captured by the camera is displayed in the viewfinder of the photo-taking preview interface 113, and it also includes an HDR control 114. The user can enter the HDR mode by clicking on the HDR control 114.

[0066] In the HDR mode, when the mobile phone 11 detects a click operation by the user on the shooting control 115, in response to the click operation, through the HDR imaging algorithm, an HDR image is captured and a JPG file is obtained, and a thumbnail 116 is displayed.

[0067] After the mobile phone 11 detects a click operation on the thumbnail 116, in response to the click operation, according to the JPG file, an HDR image or an SDR image is displayed on the image viewing interface 118.

[0068] It should be noted that the HDR shooting scenarios involved in the embodiments of the present application may include, in addition to the HDR photo shooting scenario shown in FIG. 2, shooting scenarios for live photos (i.e., live live photos) and HDR video shooting scenarios, etc.

[0069] In FIG. 2, the mobile phone 11 is provided with an HDR mode. However, in some other embodiments, the mobile phone 11 may not be provided with an HDR mode separately. Instead, the electronic device automatically determines whether the current shooting scene requires activation of the HDR mode. When it is determined that the HDR mode needs to be activated, the electronic device automatically captures an HDR image through the HDR imaging algorithm.

[0070] After the electronic device captures an HDR image, it can perform editing processing on the image in response to the user's image editing operation.

[0071] Exemplarily, referring to the schematic diagram of the image editing scene provided by the embodiment of the present application shown in FIG. 3, based on the scene in FIG. 2, after the mobile phone 11 displays the image viewing interface 117, the user can click on the editing control 118 in the image viewing interface 117 to trigger the mobile phone 11 to enter the image editing mode. The image displayed on the image viewing interface 117 is an HDR image or an SDR image.

[0072] In response to the click operation on the editing control 118, the mobile phone 11 displays the first image editing interface 119. The first image editing interface 119 includes editing options such as brightness, contrast, saturation, color temperature, and filters. The user can edit the image according to needs through the corresponding editing options. For example, the global brightness of the image can be adjusted through the brightness editing option.

[0073] In the related art, when the user edits an image, the electronic device only edits the SDR image in the JPG file and does not synchronously edit the gain map. In this way, the edited JPG file only contains the edited SDR image, or includes the edited SDR image and the original gain map.

[0074] Exemplarily, referring to the schematic diagram of the image editing process provided by the embodiment of the present application shown in FIG. 4, the electronic device displays an HDR image or an SDR image according to the JPG file. The JPG file includes the original SDR image and the original gain map. The user inputs an image editing operation to the electronic device, and the electronic device then responds to the image editing operation and edits the SDR image in the JPG file to obtain the edited SDR image.

[0075] In one case, the electronic device discards the original gain map and only stores the edited SDR image in the edited JPG file. At this time, the edited JPG file only contains the edited SDR image. When the electronic device displays the edited image according to the edited JPG file, it can only display the SDR effect and cannot display the HDR effect, thus resulting in the loss of the HDR effect after image editing.

[0076] In another case, the electronic device stores the edited SDR image and the original gain map in the edited JPG file. At this time, the edited JPG file includes the original gain map and the edited SDR image. When the electronic device displays the edited image according to the edited JPG file, it can display an image with an HDR effect based on the original gain map and the edited SDR image. However, since the original gain map is not synchronously edited, the original gain map does not match the edited SDR image, resulting in abnormal display of the HDR effect.

[0077] For example, the image editing operation is an elimination operation used to eliminate a target object in the image. In response to the elimination operation, the electronic device edits the SDR image, that is, eliminates the target object in the SDR image to obtain the edited SDR image. At this time, the edited SDR image does not include the target object. However, since the original gain map is not synchronously edited, that is, the target object in the original gain map is not eliminated, the original gain map still includes the target object. In this way, the original gain map does not match the edited SDR image. During the display process, the HDR effect of the obtained HDR image is abnormal by fusing the original gain map and the edited SDR image.

[0078] In view of the above-mentioned related technical problems, the embodiments of the present application provide an image processing solution. After receiving an image editing operation, not only does it edit the SDR image in response to the image editing operation to obtain the edited SDR image, but it also obtains the edited gain map according to the dynamic range transformation information and the edited SDR image, and stores the edited SDR image and the edited gain map. In this way, the edited image file includes the edited SDR image and the edited gain map. If the electronic device needs to display the HDR effect, it obtains the edited SDR image and the edited gain map from the edited image file, and displays the edited HDR image according to the edited SDR image and the edited gain map, so that the HDR effect will not be missing after image editing.

[0079] In addition, since the edited gain map matches the edited SDR image, when displaying the HDR image according to the edited gain map and the edited SDR image, a better HDR effect can be obtained, and there will be no problem of abnormal display of the HDR effect.

[0080] The image processing solution provided by the embodiments of the present application can be applied to electronic devices such as mobile phones and tablet computers, and the specific types and specific structures of the electronic devices are not limited herein.

[0081] For example, Figure 5 shows a schematic block diagram of the structure of an electronic device 500. The electronic device 500 may include, but is not limited to, a processor 510, a memory 520, and a display screen 530. Optionally, the electronic device 500 may also include a camera 540 and a touch sensor 550. The touch sensor 550 may be disposed on the display screen 530, and the touch sensor 550 and the display screen 530 together form a touchscreen, also known as a "touchscreen".

[0082] The structures illustrated in this application do not constitute a specific limitation on the electronic device 500. In other embodiments of this application, the electronic device 500 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, when the electronic device 500 is specifically a mobile phone, it may also include a universal serial bus (USB) interface, a charging management module, a power management module, a battery, an antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a receiver, a microphone, a headphone jack, sensors, buttons, a motor, an indicator, and a subscriber identification module (SIM) card interface, etc.

[0083] Processor 510 may include one or more processing units, such as an application processor (AP), graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0084] The processor 510 may include one or more interfaces. Interfaces may include inter-integrated circuit (I2C) interfaces, mobile industry processor interfaces (MIPI), and general-purpose input / output (GPIO) interfaces, etc.

[0085] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 510 may include multiple I2C buses. The processor 510 can couple to the touch sensor 550 and the camera 540, etc., through different I2C bus interfaces. For example, the processor 510 can couple to the touch sensor 550 through the I2C interface, enabling the processor 510 and the touch sensor 550 to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 500.

[0086] The MIPI interface can be used to connect the processor 510 to peripheral devices such as the display screen 530 and the camera 540. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 510 and the camera 540 communicate via the CSI interface to enable the electronic device 500 to perform its shooting function. The processor 510 and the display screen 530 communicate via the DSI interface to enable the electronic device 500 to perform its display function.

[0087] The GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 510 to the camera 540 and the display screen 530, etc.

[0088] The interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 500. In other embodiments of this application, the electronic device 500 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0089] Electronic device 500 implements display functions through a GPU, display screen 530, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 530 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 510 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0090] The display screen 530 is used to display images, videos, etc. The display screen 530 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 500 may include one or N displays 530, where N is a positive integer greater than 1.

[0091] In this embodiment, the display screen 530 can be an HDR display, which supports displaying high dynamic range images; or it can be an SDR display.

[0092] Electronic device 500 can achieve shooting function through ISP, camera 540, video codec, GPU, display 530 and application processor.

[0093] The ISP (Image Signal Processor) is used to process data fed back from the camera 540. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 540.

[0094] Camera 540 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, electronic device 500 may include one or N cameras 540, where N is a positive integer greater than 1.

[0095] The electronic device 500 in this embodiment may not include a camera. In this case, the electronic device 500 can receive an HDR image file input from an external device, the HDR image file including an SDR image and a gain map.

[0096] A digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals.

[0097] An NPU (Neural-Network Processing Unit) is a neural network (NN) computing processor that, by borrowing from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own. The NPU enables intelligent cognitive applications in the electronic device 500, such as image recognition, facial recognition, speech recognition, and text understanding. In this embodiment, during local AI editing operations, the electronic device 500 can perform AI calculations based on the neural network computing processor to achieve tasks such as AI elimination and AI distortion correction.

[0098] The memory 520 can be used to store computer executable program code, including instructions. The memory 520 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as image playback), etc. The data storage area may store data created during the use of the electronic device 500. Furthermore, the memory 520 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 510 executes various functional applications and data processing of the electronic device 500 by running instructions stored in the memory 520 and / or instructions stored in memory disposed within the processor.

[0099] Touch sensor 550, also known as a "touch device," can be located on display screen 530. The touch sensor 550 and display screen 530 together form a touchscreen, also known as a "touchscreen." Touch sensor 550 detects touch operations applied to or near it. Touch sensor 550 can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 530. For example, a user can input image editing operations through the touchscreen to edit an image.

[0100] The following uses electronic device 500 as an example to illustrate the technical solution provided in the embodiments of this application.

[0101] Referring to Figure 6, which is a schematic flowchart of an image processing method provided in an embodiment of this application, the method may include the following steps:

[0102] Step S601: Electronic device 500 displays target image, which is a first HDR image or a first SDR image synthesized from a first SDR image and a first gain map.

[0103] The first SDR image and the first gain image can be stored in the same image file, which is persistently stored in memory 520. The image file format can be JPG or other image file formats, which are not limited here.

[0104] The first SDR image and the first gain map can be the original image data obtained through the HDR imaging algorithm. That is, the first SDR image is the original SDR image and the first gain map is the original gain map, which are image data that have not been edited.

[0105] The first SDR image and the first gain map can be obtained by the electronic device 500 through the camera 540, or by receiving image data input from an external device.

[0106] The electronic device 500 can fuse the first SDR image and the first gain map to obtain a first HDR image, and display the first HDR image on the display screen 530 to present an HDR effect. Of course, the electronic device 500 can also display the first SDR image on the display screen 530 to present an SDR effect.

[0107] The electronic device 500 can display either HDR or SDR effects depending on the display settings. For example, in Figure 3, after the mobile phone 11 captures a first SDR image and a first gain image in HDR mode, if the user has enabled the "Photo HDR Display" setting option, the first HDR image will be displayed on the image viewing interface 118 based on the first SDR image and the first gain image; if the user has not enabled the "Photo HDR Display" setting option, the first SDR image will be displayed on the image viewing interface 118. "Photo HDR Display" is a display setting option that the user can enable or disable as needed. Of course, the mobile phone 11 can also enable "Photo HDR Display" by default.

[0108] Step S602: Electronic device 500 receives image editing operation.

[0109] In the embodiments of this application, image editing operations may include, but are not limited to: global editing operations, local painting and covering operations, image elimination operations, beautification and body shaping, distortion correction, image lighting operations, background blurring operations, image inpainting operations, and image outpainting operations.

[0110] Global editing operations can include global change adjustments and global deformation operations. Global change adjustments can include adjustments to the brightness, contrast, saturation, and hue of the image globally. Global deformation operations can include operations such as rotation, cropping, stretching, and scaling of the image.

[0111] Partial overwriting refers to the operation of using at least one of the following techniques—lines, text, and graphics—to write or cover a local area of ​​an image. Partial overwriting can include, but is not limited to, watermarking, graffiti, mosaic, and stickers.

[0112] Global editing operations are those unrelated to the image content. Local painting / overlay operations, image removal operations, beautification / body shaping, distortion correction, image lighting operations, background blurring operations, inpainting operations, and outpainting operations are editing operations related to the image content.

[0113] Image editing operations are user operations input by the user to the electronic device 500 to implement image editing functions. An image editing operation may include one or a series of user operations. For example, the image editing operation of adding a watermark may include a series of user operations such as clicking and dragging.

[0114] In practical applications, users can input image editing operations on an interface displaying the target image. For example, in the scenario shown in Figure 3, users can input image editing operations in the first image editing interface 119. Alternatively, referring to another schematic diagram of the image editing interface provided in this embodiment of the application shown in Figure 7, the mobile phone 11 displays a second image editing interface 120. The second image editing interface 120 displays the target image, as well as multiple editing options such as graffiti, mosaic, watermark, stickers, image removal, beautification, and distortion correction. Users can input image editing operations in the second image editing interface 120.

[0115] In step S603, the electronic device 500 responds to the image editing operation by editing the first SDR image to obtain the second SDR image.

[0116] Step S604: Electronic device 500 acquires dynamic range transformation information. The dynamic range transformation information is obtained based on the first SDR image and the first gain map, and is used to describe the transformation relationship from the standard dynamic range image to the high dynamic range image, or to describe the transformation relationship from the standard dynamic range image to the gain map.

[0117] The second SDR image is the edited SDR image. The electronic device 500 uses an editing algorithm corresponding to the image editing operation to edit the first SDR image, thereby obtaining the edited SDR image. For example, when the image editing operation is an image removal operation, an image removal algorithm is used to remove the corresponding objects in the first SDR image to obtain the second SDR image.

[0118] After receiving an image editing operation, the electronic device 500 not only edits the first SDR image, but also acquires dynamic range transformation information, so as to obtain a second gain map using the dynamic range transformation information and the second SDR image.

[0119] For example, referring to Figure 8, which illustrates the image editing process provided in this embodiment of the application, the image file stores a first gain map and a first SDR image. Upon receiving an image editing operation, the first SDR image is retrieved from the image file and input into an SDR image editing tool. The SDR image editing tool uses a corresponding editing algorithm to edit the first SDR image and outputs a second SDR image. Furthermore, dynamic range transformation information can also be obtained. This dynamic range transformation information can be output by the transformation relationship extraction module based on the input first gain map and first SDR image. The dynamic range transformation information and the second SDR image are input to the migration module to obtain the second gain map output by the migration module. The migration module is a migration algorithm module.

[0120] Dynamic range transformation (DR) information records the transformation relationship from SDR to HDR images. It is used to perform DR transformation on a second SDR image to obtain the edited HDR image. For example, the DR Transformation Information is specifically represented as a Dynamic Range Transformation Grid (DRTG). The DRTG includes hierarchical guidance information for image height, image width, and image brightness range, as well as the DRTG matrix of the affine transformation parameters for each grid. The hierarchical guidance information in these three dimensions (image height, image width, and image brightness range) can distinguish different spatial locations and brightness levels within the image, similar to a lookup table that simultaneously implements spatial and brightness properties. The DRTG can be viewed as a two-sided network, with each grid corresponding to affine transformation parameters. Based on the height, width, and brightness range, the corresponding affine transformation parameters can be found. By performing an affine transformation on the SDR image using the affine transformation parameters in the DRTG, an HDR image can be obtained.

[0121] In some embodiments, before receiving an image editing operation, dynamic range transformation information is calculated based on a first SDR image and a first gain map, and the dynamic range transformation information is persistently stored. After receiving an image editing operation, in response to the image editing operation, the previously stored dynamic range transformation information is read to obtain the dynamic range transformation information.

[0122] For example, referring to the schematic diagram of the dynamic range transformation information calculation process shown in Figure 9, the first gain map and the first SDR image are input into the transformation relationship extraction module to obtain the dynamic range transformation information output by the transformation relationship extraction module. Specifically, the first gain map and the first SDR image are fused (i.e., display scheme simulation) to obtain the first HDR image; the first HDR image is downsampled to obtain the downsampled map of the HDR image; the first SDR image is downsampled to obtain the downsampled map of the first SDR image; the downsampled map of the first HDR image and the downsampled map of the first SDR image are input into a deep learning neural network to obtain the dynamic range transformation information output by the deep learning neural network. The deep learning neural network can be, for example, CoefficientNet, or other networks, and is not limited here.

[0123] The calculation of dynamic range transformation information can be completed during image capture. During image capture, after obtaining the first SDR image and the first gain map using the HDR imaging algorithm, the dynamic range transformation information can be calculated immediately based on the first SDR image and the first gain map. Alternatively, the calculation of dynamic range transformation information can be completed outside of image capture, as long as it is completed before receiving the image editing operation. After calculating the dynamic range transformation information before the image editing operation, the dynamic range transformation information can be persistently stored. The storage location of the dynamic range transformation information can be an image file or other locations, without limitation. For example, the dynamic range transformation information is stored in a first JPG file, which is a JPG file including the first SDR image and the first gain map. Thus, after receiving the image editing operation, the electronic device 500 can read the dynamic range transformation information from the first JPG file.

[0124] Furthermore, the dynamic range transformation information can be stored in the metadata of the first JPG file. For example, as shown in Table 1 below, the dynamic range transformation matrix is ​​stored in the APPn field of the JPG file, that is, the APPn field carries the dynamic range transformation information.

[0125] Table 1

[0126] A JPG file includes a start of frame (SOI) field, an image frame header, a payload, and an end of frame (EOI) field.

[0127] The image frame header may include one or more of the following fields: application identifier (APP), start of frame (SOF), defined Huffman table (DHT), defined restart interval (DRI), and start of scan (SOS). The APP field may include APP0, APP1, ..., APPn. n can be any value from 0 to 15.

[0128] Of course, in some other embodiments, the dynamic range transformation information may not need to be calculated in advance. In this case, the electronic device 500 responds to the image editing operation only after receiving the image editing operation, and calculates the dynamic range transformation information based on the first SDR image and the first gain map to obtain the dynamic range transformation information.

[0129] In step S605, the electronic device 500 obtains a second gain map based on the dynamic range transformation information and the second SDR image. The second gain map is a gain map that includes the edited content corresponding to the image editing operation.

[0130] The first gain map is the gain map before editing; the second gain map is the gain map after editing, including the edited content (or editing effect) corresponding to the image editing operation.

[0131] The second gain map can be equivalent to the gain map obtained after performing image editing operations on the first gain map. However, in practice, the electronic device 500 does not directly edit the first gain map. Instead, it first obtains the edited HDR image and then calculates the second gain map from the edited HDR image. For example, referring to Figure 10, which shows a schematic diagram of the inverse calculation process provided in this application embodiment, the second SDR image is subjected to dynamic range transformation processing based on dynamic range transformation information to obtain a third HDR image; then, the second gain map is calculated from the third HDR image and the second SDR image.

[0132] The third HDR image is an HDR image that includes the edited content corresponding to the image editing operation; it is the edited HDR image. The second and third HDR images have the same image content and can be considered as the same image.

[0133] It is worth noting that, compared to directly editing the HDR image to obtain the edited HDR image, the embodiment of this application performs dynamic range transformation processing on the second SDR image through dynamic range transformation information to obtain the edited HDR image. This method supports a wider range of image editing operations and has higher image editing efficiency.

[0134] Specifically, in one implementation, the first gain map and the first SDR image are first fused to obtain an HDR image; then, image editing operations corresponding to image editing are performed on the HDR image to obtain an edited HDR image; finally, the second gain map is calculated from the edited HDR image. In this case, since the HDR image is directly edited, the requirements for the editing algorithm are relatively high, and it only supports editing operations that can be performed on HDR images, resulting in a limited number of applicable editing operations. In addition, this method is more time-consuming and less efficient.

[0135] In this embodiment, the edited HDR image can be obtained using dynamic range transformation information and a second SDR image, eliminating the need for direct editing of the HDR image. Only the SDR image needs editing, which reduces the requirements for the editing algorithm. SDR image editing algorithms can be directly applied to the HDR image, expanding the richness of HDR image editing. This means more and richer applicable image editing operations are possible. Furthermore, this method of inversely calculating the second gain map is faster and more efficient.

[0136] In some embodiments, the electronic device 500 may first determine a guide map of the second SDR image; then use the guide map to interpolate the dynamic range transformation information to obtain pixel-by-pixel affine transformation parameters; and finally use the pixel-by-pixel affine transformation parameters to perform an affine transformation on the second SDR image to obtain a third HDR image.

[0137] The electronic device 500 can obtain the guidance map output by the guidance network by inputting the second SDR image into the guidance network.

[0138] Electronic device 500 can use a migration algorithm to obtain a second gain map based on dynamic range transformation information and a second SDR image. For example, referring to Figure 11, which illustrates the second gain map calculation process according to an embodiment of this application, the image file stores a first SDR image, a first gain map, and image metadata. After obtaining the first SDR image from the image file, electronic device 500 performs image editing operations on the first SDR image to obtain a second SDR image; it then obtains dynamic range transformation information from the image metadata; and inputs the dynamic range transformation information and the second SDR image into the migration module to obtain the second gain map output by the migration module.

[0139] In the migration module, the second SDR image is input into the guiding network to obtain the guiding map output by the guiding network; the guiding map is used to perform linear interpolation on the dynamic range transformation information to obtain the pixel-by-pixel affine transformation parameters, that is, to obtain the affine transformation parameters of each pixel; the pixel-by-pixel affine transformation parameters are used to perform affine transformation on the second SDR image to obtain the third HDR image; the display scheme is reverse simulated based on the third HDR image and the second SDR image to obtain the second gain map.

[0140] Display scheme simulation refers to the process of fusing an SDR image and a gain map into an HDR image. Display scheme inverse simulation refers to the process of calculating the gain map from the HDR image and the SDR image.

[0141] In this embodiment of the application, the second SDR image is the image after the first SDR image has been edited by an image editing operation, and the second gain map is a gain map with the editing effect corresponding to the image editing operation. Therefore, the second gain map and the second SDR image are compatible, and both have the editing effect corresponding to the image editing operation.

[0142] For example, an image editing operation is a watermark addition operation, where the user adds a watermark pattern to an image. In response to this watermark addition operation, the electronic device 500 edits the first SDR image, adding the watermark pattern to the corresponding area of ​​the first SDR image to obtain a second SDR image. The second SDR image includes the watermark pattern. The edited content (or edited effect) corresponding to the watermark addition operation is the watermark pattern. The watermark pattern is also present in the corresponding area of ​​the second gain image (i.e., the edited gain image).

[0143] When dynamic range transformation information is used to describe the transformation relationship from a standard dynamic range image to a high dynamic range image, the electronic device 500 can obtain an edited HDR image (i.e., a third HDR image) based on the dynamic range transformation information and the second SDR image, and then calculate the second gain map based on the third HDR image.

[0144] In other embodiments, when dynamic range transformation information is used to describe the transformation relationship from a standard dynamic range image to a gain map, the electronic device 500 can process the second SDR image based on the dynamic range transformation information to obtain a second gain map. For example, the dynamic range transformation information and the second SDR image are input into the migration module to obtain the second gain map output by the migration module.

[0145] At this point, there's no need to first calculate the edited HDR image and then inversely calculate the second gain map based on it; instead, the second gain map can be obtained directly. In this case, the dynamic range transform information can be specifically represented as DRTG. DRTG can be, for example, an [8,8,8,4] matrix, where the first three dimensions are layered guides for image height, brightness, and width, used to distinguish different spatial locations and brightness levels within the image. Since the image height, width, and brightness range can all be 8, DRTG can be viewed as an 8×8×8 double-sided grid, with each grid containing 4 parameters (equivalent to a 1×4 affine transformation matrix).

[0146] In step S606, the electronic device 500 stores the second gain map and the second SDR image, or displays the second HDR image based on the second gain map and the second SDR image. The second HDR image is an HDR image that includes the edited content corresponding to the image editing operation. Typically, the second gain map and the second SDR image are stored in the same image file. For example, in Figure 8, the second gain map and the second SDR image can be stored in an edited image file. Based on the edited image file, the edited image can be displayed.

[0147] The edited image file can be in JPG format. In this case, the electronic device 500 can store the second gain map and the second SDR image in a second JPG file, which is the image file corresponding to the edited HDR image. Thus, when displaying the edited image, if an HDR effect is required, the electronic device 500 reads the second gain map and the second SDR image from the image file, merges them to obtain the second HDR image (i.e., the edited HDR image), and displays the second HDR image on the screen. If an SDR effect is required, or if the current electronic device only supports SDR effects, the second SDR image is read from the image file and displayed on the screen. In this way, the HDR effect can still be presented after image editing, without any loss of HDR effect; furthermore, SDR effects are also compatible after image editing.

[0148] In some embodiments, the dynamic range transformation information can also be stored together with the second gain map and the second SDR image. For example, the dynamic range transformation information can be stored in a second JPG file. This facilitates subsequent secondary image editing.

[0149] If the image editing interface displays an SDR effect, or if the current electronic device only supports SDR effects, the electronic device 500 can display the second SDR image in the image editing interface after obtaining the second SDR image; that is, it can display the edited SDR image in the image editing interface. After obtaining the second gain map, the second gain map and the second SDR image are stored in the same image file.

[0150] If an HDR effect is displayed on the image editing interface, the electronic device 500, in response to the image editing operation, obtains the second gain map and the second SDR image, and can then display the edited HDR image in real time on the image editing interface based on the second gain map and the second SDR image. Optionally, while displaying the edited HDR image in real time, the second gain map and the second SDR image are also stored in the same image file.

[0151] It should be noted that electronic device 500 typically only persistently stores image encoding data with a bit depth of 8 bits, and does not directly and persistently store HDR images (with a bit depth exceeding 8 bits) to storage media such as hard drives. Therefore, after calculating the third HDR image, electronic device 500 only caches (non-persistently stores) the third HDR image in memory, and does not persistently store the third HDR image to storage media such as hard drives. SDR images and gain maps, on the other hand, are image encoding data with a bit depth of less than or equal to 8 bits, and electronic device 500 can persistently store SDR images and gain maps to storage media such as hard drives.

[0152] Furthermore, in the existing HDR standard, the display processing only processes the 8-bit SDR image and gain map, and does not directly process the HDR image. Therefore, the electronic device 500 will not directly store the HDR image, but will instead store the corresponding SDR image and gain map.

[0153] When displaying an HDR image, the electronic device 500 can fuse an SDR image and a gain map to generate an HDR image and display the HDR image on the screen. The fused HDR image is cached in memory. After each display is completed, the cached HDR image is cleared. The next time an HDR image is displayed, it is generated again based on the SDR image and the gain map.

[0154] It should be noted that this technology only edits the SDR image during image editing and does not simultaneously modify the gain map. Therefore, the edited SDR image does not match the original gain map, resulting in an abnormal HDR effect when comparing the edited SDR image and the original gain map.

[0155] In this embodiment, not only is the SDR image edited, but a gain map with the corresponding editing effect is also obtained (which can be seen as simultaneously modifying the gain map). Thus, the edited SDR image and the edited gain map are matched, resulting in a better displayed HDR effect.

[0156] For example, the image editing operation is a background blurring operation. Figure 12A is the SDR image before background blurring, i.e., the original SDR image; Figure 12B is the SDR image after background blurring, i.e., the edited SDR image. Figure 12C is a schematic diagram comparing the display effects of background blurring editing. Figure 12D is a schematic diagram comparing the gain maps of the blurred areas.

[0157] The image in Figure 12A is the SDR image before background blurring. The image in Figure 12B is the SDR image after background blurring.

[0158] Regarding the images in Figure 12C: the leftmost image is a schematic diagram of the effect before blurring, which is the HDR image before the background blurring operation. That is, the leftmost image is the HDR image displayed based on the original SDR image (the SDR image before background blurring) and the original gain map; the middle image is a schematic diagram of the high-definition image not adapted after blurring, which is the HDR image after the background blurring operation, specifically the HDR image displayed based on the background blurring SDR image and the original gain map; the rightmost image is a schematic diagram of the high-definition image algorithm adapted after blurring, which is the HDR image after the background blurring operation, specifically the HDR image displayed based on the background blurring SDR image and the background blurring gain map.

[0159] The image in Figure 12D is a gain map of the background blur region. The image on the left is the background region in the original gain map, and the image on the right is the background region in the edited gain map. By comparison, it can be seen that the background light in the left image is not blurred, while the background light in the right image is blurred, and the blurring effect is consistent with that in Figure 12B. That is, the original gain map does not have a background blur effect, while the edited gain map does.

[0160] In the background blur editing scenario, after receiving a background blur operation, the electronic device 500 responds by blurring the background of the original SDR image in Figure 12A, obtaining the edited SDR image as shown in Figure 12B. By comparing Figure 12A and Figure 12B, it can be seen that the background of the image in Figure 12B exhibits a blurring effect.

[0161] In related technologies, the electronic device 500 only performs background blurring on the original SDR image in Figure 12A, without simultaneously blurring the background of the original gain image. This results in a mismatch between the gain image (i.e., the high-resolution layer) and the SDR image. Specifically, the background area in the original gain image is not blurred (as shown in the left image of Figure 12D), while the background area of ​​the edited SDR image has been blurred (as shown in Figure 12B). At this point, the electronic device 500 displays the intermediate image of Figure 12C based on the original gain image and the background-blurred SDR image (i.e., the image in Figure 12B). Due to the significant difference in detail between the original gain image and the background-blurred SDR image, artifacts are generated in the intermediate image of Figure 12C, leading to abnormal high-resolution (HDR) effects.

[0162] In this embodiment, the electronic device 500 not only performs background blurring on the original SDR image in Figure 12A, but also calculates the gain map (i.e., the edited gain map) after background blurring using dynamic range transformation information and the background-blurred SDR image in Figure 12B. The background area in the background-blurred gain map is blurred, as shown in the right image of Figure 12D, and the blurring effect of the background area in the gain map is consistent with the blurring effect of the image in Figure 12B. At this time, the electronic device 500 displays the rightmost image in Figure 12C based on the background-blurred gain map and the background-blurred SDR image (i.e., the image in Figure 12B). Since both the gain map and the SDR image have a consistent background blurring effect, the gain map (i.e., the high-resolution image) is adapted to the SDR image, resulting in more natural lighting and shadows in the background-blurred area of ​​the HDR image (i.e., the rightmost image in Figure 12C), and a better high-resolution effect.

[0163] By comparing the middle image and the rightmost image in Figure 12C, it can be seen that the brightness of the lights in the background of the middle image of Figure 12C is uneven, that is, the brightness in the middle of the lights is brighter than the brightness of the edge areas of the lights; while the brightness of the lights in the background of the rightmost image of Figure 12C is more uniform and natural.

[0164] For example, the image editing operation is an image removal operation. Figure 13A is the SDR image before the image removal operation, i.e., the original SDR image; Figure 13B is the SDR image after the image removal operation, i.e., the edited SDR image. Figure 13C is a schematic diagram comparing the display effects of image removal editing. Figure 13D is a schematic diagram comparing the gain maps.

[0165] The two images in Figure 13D are gain maps. The image on the left is the original gain map (i.e., the original gainmap), and the image on the right is the gain map generated by this scheme, which is the edited gain map calculated based on the dynamic range transformation information and the edited SDR image (i.e., the image in Figure 13B). In other words, the image on the right in Figure 13D is the gain map with the edited content corresponding to the image removal operation.

[0166] By comparing the two images in Figure 13D, it can be seen that the original gain map in the left image retains the tree and sun textures in the removal area; the removal area in the right image does not include trees, and the image removal effect is consistent with that in Figure 13B. That is, the original gain map does not have an image removal effect, while the edited gain map does. The removal area is the region where the image removal operation is applied, used to remove trees from that area.

[0167] Regarding the images in Figure 13C: the leftmost image is a schematic diagram of the effect before local elimination, which is the HDR image before the image elimination operation. That is, the leftmost image is the HDR image displayed based on the original SDR image (the SDR image before the image elimination operation, i.e., the image in Figure 13A) and the original gain map (i.e., the left image in Figure 13D); the middle image is a schematic diagram of the high-definition unadapted effect after local elimination, which is the HDR image after the image elimination operation, specifically the HDR image displayed based on the SDR image after the image elimination operation (i.e., the image in Figure 13B) and the original gain map (i.e., the left image in Figure 13D); the rightmost image is a schematic diagram of the high-definition algorithm adaptation effect after local elimination, which is the HDR image after the image elimination operation, specifically the HDR image displayed based on the SDR image after the image elimination operation (i.e., the image in Figure 13B) and the edited gain map (i.e., the right image in Figure 13D).

[0168] In the image removal editing scenario, after receiving an image removal operation, the electronic device 500, in response to the operation, performs image removal processing on the original SDR image in Figure 13A to obtain the edited SDR image shown in Figure 13B. By comparing Figure 13A and Figure 13B, it can be seen that the image in Figure 13B is missing relevant elements (such as trees).

[0169] In related technologies, the electronic device 500 only performs image removal processing on the original SDR image in Figure 13A, without simultaneously performing image removal on the original gain map. This results in a mismatch between the gain map (i.e., the high-resolution layer) and the SDR image. Specifically, relevant elements in the original gain map are not removed (as shown in the left image of Figure 13D), while relevant elements in the edited SDR image have been removed (as shown in Figure 13B). At this point, the electronic device 500 displays the intermediate image of Figure 13C based on the original gain map and the SDR image after image removal (i.e., the image in Figure 13B). Because the original gain map and the edited SDR image have significant differences in detail, artifacts are generated in the intermediate image of Figure 13C, leading to abnormal high-resolution (HDR) effects.

[0170] In this embodiment, the electronic device 500 not only performs image removal processing on the original SDR image in Figure 13A, but also calculates the gain map (i.e., the edited gain map) after image removal processing using dynamic range transformation information and the image removal-processed SDR image in Figure 13B. The relevant elements in the gain map after image removal processing have been eliminated, as shown in the right-hand image of Figure 13D, and the image removal effect of the gain map is consistent with that in Figure 13B. At this time, the electronic device 500 displays the rightmost image in Figure 13C based on the image removal-processed gain map (i.e., the right-hand image of Figure 13D) and the image removal-processed SDR image (i.e., the image in Figure 13B). Since both the gain map and the SDR image have consistent image removal effects, the gain map (i.e., the high-resolution image) is adapted to the SDR image, resulting in more natural lighting and shadows in the background blur area of ​​the HDR image (i.e., the rightmost image in Figure 13C), and a better high-resolution effect.

[0171] In this embodiment, upon receiving an image editing operation, not only is the first SDR image edited in response to the image editing operation to obtain a second SDR image (i.e., the edited SDR image), but a second gain map (i.e., the edited gain map) is also obtained based on the dynamic range transformation information and the second SDR image, and the second gain map and the second SDR image are stored. Thus, based on the SDR image (i.e., the second SDR image) after the image editing operation and the gain map (i.e., the second gain map) with the editing effect corresponding to the image editing operation, the edited HDR image can be displayed, ensuring that the image still presents an HDR effect after editing, and preventing the loss of HDR effect after image editing.

[0172] Furthermore, this embodiment calculates a gain map with the editing effect corresponding to the editing operation using dynamic range transformation information and the edited SDR image. This ensures that the HDR effect of the unedited area of ​​the image is consistent before and after editing, and also ensures that the HDR effect of the edited area of ​​the image is consistent before and after editing. This maintains the consistency of the HDR effect before and after editing.

[0173] To better illustrate the technical solutions provided in the embodiments of this application, the following description will be based on Figures 14A-14C and 15A-15C, taking the image lighting operation as an example.

[0174] Figure 14A is a schematic diagram of the processing procedure in an image lighting scene; Figure 14B is a schematic diagram of the dynamic range transformation matrix calculation process; and Figure 14C is a schematic diagram of the high-resolution transfer calculation process. Figure 15A is a schematic diagram of the original SDR image; Figure 15B is an SDR image after portrait lighting operations; and Figure 15C is a comparison of portrait lighting editing effects.

[0175] As shown in Figure 14A, the electronic device 500 can parse the original SDR image and the original gain map from the original JPG file. Using the original SDR image and the original gain map as input to the transform relation extraction module, the DRTG (i.e., the Grid in Figure 14A) is obtained as the output of the transform relation extraction module. The transform relation extraction module is used to extract the transform relation from SDR to HDR. At this point, the DRTG is an [8,8,8,12] matrix.

[0176] The DRTG calculation process can be completed during image capture or after the user triggers an image editing operation; there is no limitation on this.

[0177] The specific process of DRTG calculation can be shown in Figure 14B. The original SDR image parsed from the original JPG file is denoted as I. sdr The original gain diagram is denoted as I. gainmap Through the invertible function f(I) sdr I gainmap The original SDR image and the original gain map are simulated for a display scheme to fuse these two images into the HDR domain, resulting in an HDR image, denoted as I. hdr .

[0178] Original SDR image I sdr We perform downsampling to obtain a downsampled version of the original SDR image, denoted as I. sdr_low The downsampled version of the original SDR image is a low-resolution image, which can be, for example, 512x512.

[0179] Similarly, HDR image I hdr Perform downsampling to obtain a downsampled image of the HDR image, denoted as I. hdr_low An HDR image is a downsampled image that is a low-resolution image, such as 512x512.

[0180] Will I hdr_low and I sdr_low As input to CoefficientNet, the DRTG output by CoefficientNet is obtained. At this time, the shape of DRTG is [8,8,8,12].

[0181] As shown in Figure 14A, the calculated DRTG can be written to the original JPG file or the edited JPG file. Specifically, the DRTG can be stored in the corresponding field of the JPG file (e.g., the APPn field).

[0182] Referring to Figure 14A, after receiving the user's input portrait lighting editing operation, the electronic device 500 performs portrait lighting editing on the original SDR image to obtain the edited SDR image, denoted as I.sdr_edit The edited SDR image I sdr_edit Using DRTG as input to the high-definition migration module, we obtain the high-definition layer (i.e., the edited gain map) output by the high-definition migration module, denoted as I. gainmap_edit .

[0183] The efficient transfer computing process can be illustrated in Figure 14C. Specifically, the DRTG (i.e., bilateral grid of coefficients) is obtained from the image metadata; the edited SDR image I... sdr_edit Input to GuidanceNet to obtain the GuidanceMap (i.e., the guiding map) output by GuidanceNet; use the GuidanceMap to perform trilinear interpolation (i.e., Slicing Layer) on DRTG to obtain the pixel-by-pixel affine transformation parameters (i.e., Affine coefficient map).

[0184] Among them, the following equation 1 is used for trilinear interpolation.

[0185] At this point, the DRTG is an [8,8,8,12] matrix. The first three dimensions are hierarchical guides for image height, brightness, and width, used to distinguish different spatial locations and brightness levels within the image. Since the image height, width, and brightness ranges are all 8, the DRTG can be viewed as an 8×8×8 double-sided grid, with each grid containing 12 parameters (equivalent to a 3×4 affine transformation matrix). It can be understood that when dynamic range transformation information is used to describe the transformation relationship from an SDR image to a gain map, the DRTG can specifically be an [8,8,8,4] matrix.

[0186] The DRTG is interpolated in both spatial and luminance aspects using a guide map to obtain the affine transformation parameters for each pixel.

[0187] τ is a linear interpolation function, τ(·)=max(1-|·|,0), s x s y It is the ratio of the width and height of DRTG to the full-size image GuidanceMap. At this time, the resolution of DRTG is fixed at 8×8, d=8, and the resolution of GuidanceMap is H×W. x∈[0,W-1], y∈[0,H-1], GuidanceMap[x,y]∈[0,1], It is a 12-channel full-resolution affine transformation parameter map, c∈[0,11]; k is the brightness value, and d is the brightness range.

[0188] After obtaining the pixel-by-pixel affine transformation parameters, Equations 2 and 3 are used to apply the pixel-by-pixel affine transformation parameters to the edited SDR image I. sdr_edit The image is processed to obtain the edited HDR image, denoted as I. hdr_edit This refers to the HDR result of the lighting pattern in Figure 14C.

[0189] I sdr_edit It is a three-channel image, so c = 0, 1, 2, c' = 0, 1, 2. The calculation process is analogous to formula 3, where R, G, B correspond to I. sdr_edit [x,y], R',G',B' correspond to I hdr_edit The 12 coefficients [x,y], a1, a2, a3, b1, a4, a5, a6, b2, a7, a8, a9, and b3 correspond to... It has 12 channels. 3+4c refers to 12 coefficients.

[0190] The calculated edited HDR image I hdr_edit Then, using the inverse function f of f -1 (I sdredit ,I hdr_edit Perform a reverse simulation of the display scheme to obtain the edited SDR image I. sdr_edit The corresponding gain diagram is denoted as I. gainmap_edit This refers to the high-resolution gain map (or edited gain map) shown in Figure 14C. I can be... gainmap_edit The DRTG is written to the corresponding field in the edited JPG file. This allows you to retrieve the I... sdr_edit and I gainmap_edit This further demonstrates I hdr_edit .

[0191] The image in Figure 15A is the original SDR image. sdr The image in Figure 15B is the SDR image after the image lighting operation (i.e., the edited SDR image I). sdr_edit ).

[0192] Regarding the image in Figure 15C: the leftmost image is a schematic diagram of the effect before portrait lighting, which is the HDR image before the lighting operation. That is, the leftmost image is the HDR image displayed based on the original SDR image (i.e., the image in Figure 15A) and the original gain map; the middle image is a schematic diagram of the effect of the gain map not being adapted after portrait lighting operation, which is the HDR image after portrait lighting operation, specifically the HDR image displayed based on the SDR image after portrait lighting operation (i.e., the image in Figure 15B) and the original gain map; the rightmost image is a schematic diagram of the adaptation effect using the gainmap algorithm of this application, which is the HDR image after portrait lighting operation, specifically based on the SDR image after portrait lighting operation (i.e., the image in Figure 15B) and the edited gain map (i.e., the image in Figure 15C). gainmap_edit HDR image displayed hdr_edit .

[0193] In a portrait lighting editing scenario, after receiving a portrait lighting operation, the electronic device 500 responds by performing portrait lighting processing on the original SDR image in Figure 15A, obtaining the edited SDR image shown in Figure 15B. A comparison of Figures 15A and 15B shows that the portrait image in Figure 15B has higher brightness.

[0194] In related technologies, the electronic device 500 only performs portrait lighting processing on the original SDR image in Figure 15A, without simultaneously performing portrait lighting processing on the original gain map, resulting in a mismatch between the gain map and the SDR image. At this time, the electronic device 500 displays the intermediate image in Figure 15C based on the original gain map and the SDR image after portrait lighting (i.e., the image in Figure 15B). As can be seen from the intermediate image in Figure 15C, the original gain map is used for sampling the hair area after lighting, resulting in insufficient brightness in the bright areas of the hair (i.e., the hair brightness is not enhanced), causing it to appear grayish.

[0195] In this embodiment, the electronic device 500 not only performs portrait lighting processing on the original SDR image in Figure 15A, but also calculates the gain map (i.e., the edited gain map I) after portrait lighting processing using the DRTG and the SDR image after portrait lighting processing in Figure 15B. gainmap_edit At this point, the electronic device 500 displays the rightmost image in Figure 15C based on the gain map and the SDR image (i.e., the image in Figure 15B) after portrait lighting processing. As can be seen from the rightmost image in Figure 15C, the hair brightness is normally enhanced, resulting in a natural brightness in the bright area above the subject's head, and a noticeable high-resolution effect.

[0196] This application's embodiments can support HDR photo editing scenarios, as well as HDR live view (i.e., HDR live image) editing scenarios and HDR video editing scenarios. An HDR live view is a video with HDR effects. Each frame of HDR image in HDR live view and HDR video editing consists of an SDR image and a gain map.

[0197] In HDR live view and HDR video editing scenarios, a target frame can be extracted from the HDR live view or HDR video. Based on the original gain map and original SDR image of the target frame, the dynamic range transformation information is calculated and stored in the live view image file or video file. The specific process for calculating the dynamic range transformation information can be found in the relevant content above and will not be repeated here.

[0198] Users can choose to edit one or more frames in an HDR live view or video file. For each image frame edited by the user, the electronic device 500 responds to the user's editing operation by editing the SDR image of the image frame to obtain an edited SDR image; based on the edited SDR image and dynamic range transformation information, it calculates the edited gain map; and based on the edited gain map and the edited SDR image, it obtains the edited image frame.

[0199] For example, referring to the schematic block diagram of the live image editing process shown in Figure 16, the original live image file includes multiple HDR image frames. A target frame is arbitrarily extracted from the original live image file. Based on the original gain map and original SDR image of the target frame, the dynamic range transformation information is calculated by the transformation relationship extraction module, and the dynamic range transformation information is written into the metadata of both the original and edited live image files.

[0200] Users can edit one or more frames in the original live image file. For each frame edited by the user, the SDR image of that frame is extracted to obtain an SDR image sequence. Each frame in the SDR image sequence is processed by the editing algorithm of the SDR image editing tool to obtain the edited SDR image. Multiple edited SDR images are combined to form the edited SDR image sequence.

[0201] For each frame of the edited SDR image sequence, the edited SDR image and dynamic range transform information are input into the high-resolution transfer module to obtain the edited gain map output by the high-resolution transfer module. The edited gain map and the edited SDR image are then fused to obtain the edited HDR image. The edited SDR image and the edited gain map are stored in the edited live image file.

[0202] In some embodiments, when the first SDR image and the first gain map are images in a live image file or a video file, dynamic range transformation information is calculated based on the first SDR image and the first gain map; a second gain map is calculated based on the dynamic range transformation information and the second SDR image; and the edited HDR image can be displayed based on the second gain map and the second SDR image.

[0203] Furthermore, the electronic device 500 can perform dynamic range transformation on each third SDR image based on dynamic range transformation information to obtain a target HDR image corresponding to each third SDR image; for each third SDR image, a third gain map is obtained based on the target HDR image and the third SDR image, and the third gain map and the third SDR image are stored; the third SDR image is an SDR image obtained after editing other SDR images in the image file or video file of the live view. Other SDR images are SDR images in the image file or video file of the live view, excluding the first SDR image. Other SDR images are images edited by the user. One or more frames of third SDR images may exist.

[0204] Thus, the embodiments of this application can also support the editing of live images and HDR videos, and the HDR effect can still be achieved after editing.

[0205] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0206] Corresponding to the image processing method described in the above embodiments, FIG17 shows a schematic block diagram of the image processing apparatus provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0207] Referring to Figure 17, the device includes:

[0208] Display module 1710 is used to display a target image, which is a first HDR image synthesized from a first SDR image and a first gain map, or a first SDR image.

[0209] Receiver module 1720 is used to receive image editing operations;

[0210] The editing module 1730 is used to respond to an image editing operation, edit the first SDR image to obtain a second SDR image, and obtain dynamic range transformation information. The dynamic range transformation information is obtained based on the first SDR image and the first gain map, and is used to describe the transformation relationship from a standard dynamic range image to a high dynamic range image, or to describe the transformation relationship from a standard dynamic range image to a gain image.

[0211] The gain map acquisition module 1740 is used to obtain a second gain map based on the dynamic range transformation information and the second SDR image. The second gain map is a gain map that includes the edited content corresponding to the image editing operation.

[0212] The storage and display module 1750 is used to store a second gain map and a second SDR image, or to display a second HDR image based on the second gain map and the second SDR image. The second HDR image is an HDR image that includes the edited content corresponding to the image editing operation.

[0213] In one possible implementation, the gain map acquisition module 1740 is specifically used to: perform dynamic range transformation processing on the second SDR image based on dynamic range transformation information to obtain a third HDR image; and obtain a second gain map based on the second SDR image and the third HDR image. The third HDR image is an HDR image that includes the edited content corresponding to the image editing operation.

[0214] In one possible implementation, the gain map acquisition module 1740 is specifically used to: determine a guide map of the second SDR image; interpolate the dynamic range transformation information using the guide map to obtain pixel-by-pixel affine transformation parameters; and perform an affine transformation on the second SDR image using the pixel-by-pixel affine transformation parameters to obtain a third HDR image.

[0215] In one possible implementation, the editing module 1730 is specifically used to: fuse the first SDR image and the first gain image to obtain the first HDR image; input the downsampled image of the first HDR image and the downsampled image of the first SDR image into a deep learning neural network to obtain the dynamic range transformation information output by the deep learning neural network.

[0216] In some possible implementations, when the dynamic range transformation information is used for the transformation relationship from a standard dynamic range image to a gain map, the gain map acquisition module 1740 is specifically used to: process the second SDR image according to the dynamic range transformation information to obtain a second gain map.

[0217] In one possible implementation, dynamic range transformation information is stored in a first JPG file, which is an image file including a first SDR image and a first gain map; the editing module 1730 is specifically used to: obtain dynamic range transformation information from the first JPG file.

[0218] In one possible implementation, the dynamic range transformation information is stored in the metadata of the first JPG file.

[0219] In one possible implementation, the second SDR image and the second gain map are stored in a second JPG file, which is the image file corresponding to the edited HDR image; the second JPG file also stores dynamic range transformation information.

[0220] In one possible implementation, the image editing operation includes at least one of the following: image lighting operation, background blurring operation, image interior filling operation, image exterior filling operation, and image removal operation.

[0221] In one possible implementation, when the first SDR image and the first gain map are images in a live image file or a video file, the device further includes an editing and storage module for: performing dynamic range transformation on each third SDR image according to dynamic range transformation information to obtain a target HDR image corresponding to each third SDR image; obtaining a third gain map for each third SDR image based on the target HDR image and the third SDR image, and storing the third gain map and the third SDR image; the third SDR image is an SDR image obtained by editing other SDR images in the live image file or video file.

[0222] In one possible implementation, the dynamic range transformation information includes layered guidance information for image height, layered guidance information for image width, layered guidance information for image brightness range, and a dynamic range transformation matrix of affine transformation parameters for each grid.

[0223] The image processing apparatus described above has the function of implementing the image processing method described above. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function. The modules can be software and / or hardware.

[0224] It should be noted that the information interaction and execution process between the above-mentioned image processing devices are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0225] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0226] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0227] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0228] In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0229] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0230] The electronic device provided in this application embodiment may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method as described in any of the above method embodiments.

[0231] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the above-described method embodiments.

[0232] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0233] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the methods described in the above embodiments. The chip system may be a single chip or a chip module composed of multiple chips.

[0234] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the description of this application specification and appended claims, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," "third," and "fourth" may explicitly or implicitly include one or more of that feature. Additionally, it should be understood that at least one in the embodiments of this application includes one or more; where "more" means greater than or equal to two. In the embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the objects before and after it are in an "or" relationship.

[0235] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0236] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that, Applied to electronic devices, the method includes: Display target image, wherein the target image is a first HDR image synthesized from a first SDR image and a first gain map, or the first SDR image; Receive image editing operations; In response to the image editing operation, the first SDR image is edited to obtain the second SDR image; The dynamic range transformation information is obtained based on the first SDR image and the first gain map, and is used to describe the transformation relationship from a standard dynamic range image to a high dynamic range image. Based on the dynamic range transformation information and the second SDR image, a second gain map is obtained, which is a gain map that includes the edited content corresponding to the image editing operation; Store the second gain map and the second SDR image, or display a second HDR image based on the second gain map and the second SDR image, wherein the second HDR image is an HDR image that includes the edited content corresponding to the image editing operation.

2. The method according to claim 1, characterized in that, Based on the dynamic range transformation information and the second SDR image, a second gain map is obtained, including: Based on the dynamic range transformation information, the second SDR image is subjected to dynamic range transformation processing to obtain a third HDR image, wherein the third HDR image is an HDR image that includes the edited content corresponding to the image editing operation; The second gain map is obtained based on the second SDR image and the third HDR image.

3. The method according to claim 2, characterized in that, Based on the dynamic range transformation information, the second SDR image is subjected to dynamic range transformation processing to obtain a third HDR image, including: Determine the guide map of the second SDR image; The dynamic range transformation information is interpolated using the guide map to obtain pixel-by-pixel affine transformation parameters; The second SDR image is subjected to an affine transformation using the pixel-by-pixel affine transformation parameters to obtain the third HDR image.

4. The method according to claim 1, characterized in that, Obtain dynamic range transformation information, including: The first SDR image and the first gain map are fused to obtain the first HDR image; The downsampled images of the first HDR image and the first SDR image are input into a deep learning neural network to obtain the dynamic range transformation information output by the deep learning neural network.

5. The method according to claim 1, characterized in that, The dynamic range transformation information is stored in a first JPG file, which is an image file including the first SDR image and the first gain map. Obtain dynamic range transformation information, including: The dynamic range transformation information is obtained from the first JPG file.

6. The method according to claim 4 or 5, characterized in that, The dynamic range transformation information is stored in the metadata of the first JPG file.

7. The method according to claim 1, characterized in that, The second SDR image and the second gain map are stored in a second JPG file, which is an edited image file; The second JPG file also stores the dynamic range transformation information.

8. The method according to claim 1, characterized in that, The image editing operations include at least one of the following: image lighting operation, background blurring operation, image interior filling operation, image exterior filling operation, and image removal operation.

9. The method according to claim 1, characterized in that, When the first SDR image and the first gain map are images from a live image file or a video file, the method further includes: Based on the dynamic range transformation information, dynamic range transformation is performed on each third SDR image to obtain the target HDR image corresponding to each third SDR image; For each of the third SDR images, a third gain map is obtained based on the target HDR image and the third SDR image, and the third gain map and the third SDR image are stored. The third SDR image is an SDR image obtained by editing the image file of the live image or other SDR images in the video file.

10. The method according to any one of claims 1 to 9, characterized in that, The dynamic range transformation information includes layered guidance information for image height, layered guidance information for image width, layered guidance information for image brightness range, and a dynamic range transformation matrix of affine transformation parameters for each grid.

11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1 to 10.

12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 10.

13. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 10.