Image processing method and electronic device
By updating the brightness map in the electronic device and adjusting the display brightness according to the transparency value of the edited content, the problem of inaccurate HDR display effects after image editing is solved and a more accurate HDR display effect is achieved.
Patent Information
- Application Number
- PCT/CN2023/130810
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-11-09
- Publication Date
- 2024-09-06
AI Technical Summary
After image editing, it is difficult for the existing technology to accurately update the brightness map, resulting in inaccurate HDR display effects.
By implementing the brightness map update after image editing in electronic devices, the brightness on the display screen can be flexibly adjusted according to the transparency value of the edited content to ensure the accuracy of the HDR display effect.
It achieves accurate brightness adjustment of edited images, improving the accuracy and user experience of HDR display effects.
Smart Images

Figure CN2023130810_06092024_PF_FP
Abstract
Description
Image processing method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 27, 2023, with application number 202310231420.X and invention name “A Method and Electronic Device for Image Processing”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of image processing technology, and in particular to an image processing method and electronic device. Background Art
[0003] When an electronic device performs high dynamic range (HDR) shooting, it can obtain a standard dynamic range (SDR) image and a brightness map of the current scene for storage.
[0004] When the user wants to view the shooting results, the electronic device can display a large image of the shot image under the user's control. In some cases, the electronic device can adjust the display effect of the large image according to the brightness map, thereby providing the user with an HDR display effect with brighter highlights.
[0005] Electronic devices can also provide users with image editing capabilities. The editing process is generally performed on SDR images. After editing is complete, the electronic device can store a brightness map of the original image and the SDR image including the edited content. The electronic device can then adjust the display effect of the SDR image including the edited content based on the brightness map.
[0006] Summary of the Invention
[0007] The present application provides an image processing method and electronic device, which can update the brightness map based on the edited content after image editing, thereby obtaining a more accurate HDR display effect.
[0008] To achieve the above technical objectives, this application adopts the following technical solutions:
[0009] In a first aspect, an image processing method is provided, which is applied to an electronic device in which a first application is running. The electronic device stores a first image and a second image. The second image includes the first image and edited content added to the first image through editing. The method includes: the electronic device displays the first image through a display screen, and the brightness value of a first position on the display screen is a first brightness value. The brightness value of a second position on the display screen is a second brightness value. The electronic device displays the second image through the display screen, and the brightness value of the first position is the first brightness value. The brightness value of the second position is a third brightness value. The second position on the display screen is on the path of the edited content, and the first position on the display screen is not on the path of the edited content.
[0010] In this way, based on this solution, the electronic device can flexibly adjust the brightness of each position on the display screen according to the transparency value of each position indicated in the brightness map of the image to be displayed, thereby obtaining an HDR display effect. In this example, the transparency value on the edited content path is different from the transparency value of the original image at that position, so after the brightness adjustment process, the brightness value of the position (such as the second position) is also different. Therefore, after editing the image, the electronic device can also accurately adjust the brightness of the edited image to obtain a more accurate HDR display effect.
[0011] Optionally, the first image includes a first SDR image and a first brightness map, and the second image includes a second SDR image and a second brightness map.
[0012] Optionally, the first brightness map and the second brightness map are different.
[0013] In this way, the brightness map of the edited second image is different from the brightness map before editing, thereby avoiding inaccurate adjustment of the display brightness of the second brightness map based on the first brightness map.
[0014] Optionally, the first luminance map includes first luminance map data, and the second luminance map includes second luminance map data. The first luminance map and the second luminance map are different, including: the first luminance map data and the second luminance map data are different. In different implementations, the luminance map data may have different implementations. For example, in the following example, the luminance map data may correspond to a transparency value.
[0015] Optionally, the first brightness map data includes the transparency value of each position in the first image, and the second brightness map data includes the transparency value of each position in the second image. The first brightness map data and the second brightness map data are different, including: in the first brightness map data, the transparency value of the position corresponding to the second position is a first transparency value, and in the second brightness map data, the transparency value of the position corresponding to the second position is a second transparency value, and the first transparency value and the second transparency value are different.
[0016] Optionally, the electronic device configures the brightness value of each display unit on the display screen when displaying the target image according to the brightness map of the target image.
[0017] Optionally, the target image includes the first image, and the electronic device displays the first image through a display screen, including: the electronic device configures the brightness value of each display unit on the display screen according to the first brightness map.
[0018] Optionally, the target image includes the second image, and the electronic device displays the second image through a display screen, including: the electronic device configures the brightness value of each display unit on the display screen according to the second brightness map.
[0019] Optionally, the greater the transparency value indicated by the brightness map of the target image, the greater the brightness value configured by the electronic device for the corresponding position on the display screen.
[0020] Optionally, the content corresponding to the second SDR image includes the content corresponding to the first SDR image, and the content corresponding to the second SDR image also includes the edited content.
[0021] Optionally, after grayscale coloring is performed on the first brightness image and the second brightness image, the content corresponding to the second brightness image includes the edited content.
[0022] In this way, by adjusting the display brightness on the display screen according to the transparency value of each position in the brightness map provided by the above solution, the electronic device can more accurately adjust the display brightness of the edited image according to the second brightness map when the second brightness map is integrated with the edited content.
[0023] Optionally, before the electronic device displays the second image on the display screen, the method further includes: the electronic device receiving an editing operation from a user, the editing operation being used to edit the first image, the image editing including at least one of the following: a graffiti operation, text editing, a trimming operation, and a rotation operation. In response to the editing operation, the electronic device edits the first image to obtain the second image.
[0024] Optionally, the electronic device edits the first image to obtain the second image, including: creating a new first map, and drawing the first SDR image on the first map. Based on the editing operation, drawing the edited content corresponding to the editing operation on the first SDR image on the first map, so as to obtain a second SDR image of the second image on the first map. An updated SDR image is thereby obtained.
[0025] Optionally, the electronic device edits the first image to obtain the second image, further comprising: determining a second brightness map of the second image based on the first brightness map of the first image.
[0026] Optionally, determining the second brightness map of the second image includes: determining transparency values of the first position and the second position.
[0027] Optionally, determining the transparency value of the second position includes: determining a first transparency value of the second position based on a first brightness map of the first image. Based on the editing operation, obtaining a transparency value of the edited content at the second position; and determining a transparency value of the second position in the second image based on the first transparency value and the transparency value of the edited content at the second position. Transparency values are thereby obtained for each position along the edited content path.
[0028] Optionally, determining the transparency value of the first position includes determining a third transparency value of the first position based on the first brightness map of the first image. The third transparency value is determined as the transparency value of the first position in the second image. It is understood that the transparency value of the area outside the editing path may remain unchanged.
[0029] Optionally, before determining the second brightness map of the second image, the method further includes: determining that the second image needs to be brightness adjusted when displayed to obtain an E-HDR display effect. The brightness adjustment process includes: adjusting the brightness of display units at various positions on the display screen according to the second brightness map of the second image.
[0030] Optionally, determining that the second image requires brightness adjustment when displayed includes: the electronic device obtaining a type of the editing operation, and if the type of the editing operation is a first type, determining that the second image requires brightness adjustment when displayed. The editing operation type includes the first type and a second type, the first type indicating that the current editing operation is not related to brightness adjustment, and the second type indicating that the current editing operation is a brightness-related editing operation.
[0031] Optionally, the editing operations corresponding to the first type include at least one of the following: graffiti operation, text editing, trimming operation, and rotation operation. The editing operations corresponding to the second type include at least one of the following: beauty editing and filter editing.
[0032] Therefore, before performing the luminance map processing of the fused edited content, the electronic device can determine that the luminance map needs to be used for E-HDR processing, thereby avoiding the luminance map being unused after the fusion processing.
[0033] Optionally, before editing the first image to obtain the second image, the method further includes: placing editing information of the editing operation input by the user into a user operation stack. The editing information includes at least one of the following: path information of the editing operation, color information of the editing operation, and text information of the editing operation.
[0034] Optionally, the method further includes: receiving a save instruction from the user, where the save instruction is used to instruct the electronic device to store the current edited image; in response to the save instruction, the electronic device obtains and saves the second image.
[0035] Optionally, obtaining the second image includes: obtaining at least one editing information corresponding to the current editing operation from the user operation stack according to the save instruction. Determining the image information of the second image based on the at least one editing information corresponding to the current editing operation. The image information of the second image includes: the first storage address of the first image, at least one editing information corresponding to the current editing operation, and the image saving quality. Generate an image saving task, which carries the image information of the second image. Execute the image saving task, and determine the second image based on the image information of the second image. In this example, the processing and acquisition of the second SDR image and the second luminance map can be triggered after the user inputs an operation to save the edited image into the electronic device.
[0036] In a second aspect, an image processing method is provided, which is applied to an electronic device. The method includes: the electronic device displays a first image on a display screen, the first image including a first area, the brightness of the first area corresponding to a first brightness value on the display screen. A user performs an editing operation on the first image, the editing operation passing through the first area and corresponding to edited content. The electronic device stores a second image, the second image including the edited content. The electronic device displays the second image on the display screen, the second image including the first area, the area of the first area excluding the edited content corresponding to the first brightness value on the display screen, and the brightness of the edited content corresponding to a second brightness value on the display screen. The first and second brightness values are different. This solution provides another example of displaying different brightness levels based on different brightness maps. It should be noted that the first and second images may include more areas, such as a second area. If the edited content does not pass through the second area, the display effect of the second area may refer to the display effect of the area outside the edited content in the first area. If the edited content passes through at least a portion of the second area, the display effect of the portion of the second area including the edited content may refer to the display effect along the path of the edited content in the first area.
[0037] Optionally, before the electronic device displays the first image through the display screen, the method further includes: the electronic device stores a first SDR image and a first brightness map of the first image.
[0038] Optionally, before the electronic device saves the second image, the method further includes: the electronic device receiving a user's instruction to save the second image, and storing a second SDR image and a second luminance map of the second image. The first luminance map and the second luminance map are different.
[0039] Optionally, the first brightness map includes first brightness map data, and the second brightness map includes second brightness map data. The first brightness map and the second brightness map are different, including: the first brightness map data and the second brightness map data are different.
[0040] Optionally, the first brightness map data includes the transparency value of each position in the first image, and the second brightness map data includes the transparency value of each position in the second image. The first brightness map data and the second brightness map data are different, including: in the first brightness map data, the transparency value of the position corresponding to the second position is a first transparency value, and in the second brightness map data, the transparency value of the position corresponding to the second position is a second transparency value, and the first transparency value and the second transparency value are different.
[0041] In a third aspect, an electronic device is provided, comprising: a memory, a display screen, and one or more processors. The memory, the display screen, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the technical solution provided in the above-mentioned first aspect and any possible implementation thereof. Exemplarily, the display screen may have a zone dimming capability. For example, the display screen may be an OLED screen. When the electronic device displays an image, the brightness of the display unit on each display screen may be adjusted according to the brightness map of the image, thereby achieving an E-HDR display effect.
[0042] In a fourth aspect, the present application further provides a chip system, which is applied to an electronic device; the chip system may include one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected via a circuit, and the interface circuit is configured to receive a signal from the memory of the electronic device and send the signal to the processor. The signal includes computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device implements the technical solution provided in the first aspect and any possible implementation thereof.
[0043] In a fifth aspect, the present application also provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the technical solution provided in the above-mentioned first aspect and any possible implementation thereof.
[0044] In a sixth aspect, the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the technical solution provided in the above-mentioned first aspect and any possible implementation thereof.
[0045] It can be understood that the technical solutions provided in the second to sixth aspects of the present application can respectively correspond to the technical solutions provided in the first aspect and any one of its possible designs, and the beneficial effects that can be achieved are similar, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a schematic diagram of an interface;
[0047] FIG2 is a schematic diagram of image data storage;
[0048] Figure 3 is a schematic diagram of an interface;
[0049] Figure 4 is a schematic diagram of an interface;
[0050] FIG5 is a schematic diagram of a brightness adjustment process provided by an embodiment of the present application;
[0051] FIG6 is a comparative schematic diagram of an E-HDR display effect provided by an embodiment of the present application;
[0052] FIG7 is a schematic diagram of an E-HDR display effect provided by an embodiment of the present application;
[0053] FIG8 is a schematic diagram of an interface provided in an embodiment of the present application;
[0054] FIG9 is a schematic diagram of storing edited image data provided by an embodiment of the present application;
[0055] FIG10 is a schematic diagram of the composition of an electronic device provided in an embodiment of the present application;
[0056] FIG11 is a schematic diagram of the composition of an electronic device provided in an embodiment of the present application;
[0057] FIG12 is a schematic diagram of module interaction for implementing graffiti preview provided by an embodiment of the present application;
[0058] FIG13 is a logic diagram of implementing the preservation of edited content provided by an embodiment of the present application;
[0059] FIG14 is a schematic diagram of the interaction between modules for issuing a task to save an image according to an embodiment of the present application;
[0060] FIG15 is a schematic diagram of obtaining SDR image data of an edited image according to an embodiment of the present application;
[0061] FIG16 is a schematic diagram of obtaining brightness map data of an edited image according to an embodiment of the present application;
[0062] FIG17 is a schematic diagram of a luminance image fusion according to an embodiment of the present application;
[0063] FIG18 is a schematic diagram of acquiring and storing edited image data provided by an embodiment of the present application;
[0064] FIG19 is a schematic diagram of the interaction between modules of an image processing method provided in an embodiment of the present application;
[0065] FIG20 is a schematic diagram of an image editing scenario provided by an embodiment of the present application;
[0066] FIG21 is a schematic diagram showing a comparison of brightness map adjustment processing effects in different implementations provided in an embodiment of the present application;
[0067] FIG22 is a schematic diagram of the composition of an electronic device provided in an embodiment of the present application;
[0068] FIG23 is a schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0070] Currently, most electronic devices can provide users with functions such as taking photos, storing, viewing, and editing captured images.
[0071] Taking a mobile phone as an example, the process of capturing an image using the electronic device is briefly described with reference to FIG1 .
[0072] As shown in FIG1 , the main interface 101 of the mobile phone may include an icon 102 corresponding to a camera application. When the user wants to take a picture, he or she may input an operation 103 on the icon 102. For example, the operation 103 may include a touch or click operation on the icon 102.
[0073] In response to operation 103, the mobile phone may run a camera application and call the camera to capture an image. For example, the mobile phone may switch to display interface 104. This interface 104 may be the interface of the camera application. This interface 104 may include a preview image corresponding to the image currently captured by the camera. For example, the image of the scene currently captured by the camera may be image A, and a preview image 108 corresponding to image A may be displayed in interface 104. Interface 104 may also include other functional options for the photography process. For example, this interface 104 may include a capture button 105.
[0074] When the user wants to take a picture of the image A, he or she may input operation 106 to instruct the mobile phone to take and save the current image. Operation 106 may be a touch or click operation on the capture button 105. In response to operation 106, the mobile phone may store the image data of the image A.
[0075] It should be noted that, in some cases, electronic devices can provide users with high-dynamic range (HDR) image capture capabilities.
[0076] In some electronic devices, the HDR image capture capability may be enabled by default. HDR-related information may not be displayed on the capture interface. In other electronic devices, the HDR image capture capability may be user-configured.
[0077] For example, in the example shown in FIG1 , the interface 104 may further include multiple function buttons displayed above the preview image 108. For example, the multiple function buttons may include an HDR shooting function button 107. In the example shown in FIG1 , the status of the HDR shooting function button 107 is displayed as "HDR", indicating that the current HDR shooting capability has been enabled.
[0078] It is understood that when the HDR shooting capability is enabled, the electronic device can capture the current image and then obtain and save the corresponding HDR image data. Compared to ordinary images captured without the HDR shooting capability, this HDR image data can include more detailed information in the image. For example, when the HDR image data is displayed, the brightness of the bright areas in the image can be higher. And the darker parts of the image also have richer image details.
[0079] For example, the HDR image currently captured is image A as shown in FIG1 . Then, the electronic device may store the HDR image data under the instruction of the user (such as the instruction of operation 106 ).
[0080] Referring to Figure 2, when storing an HDR image, the electronic device can simultaneously store two copies of data corresponding to the current scene at the address corresponding to the image (such as address B in the memory). These data can include a Standard Dynamic Range (SDR) image corresponding to the current scene and a brightness map corresponding to the current scene.
[0081] The SDR image may include multiple SDR image data, and each SDR image data may correspond to information such as the color of a pixel.
[0082] The luminance map may include luminance map data. The luminance map data may have various implementation forms. The luminance map data may be obtained by parsing the luminance map. The file format of the luminance map may be the same as or different from the file format of the SDR image. For example, the file format of the luminance map and the file format of the SDR image may both be JPEG format.
[0083] As an example, the luminance map data may correspond to the transparency values of various locations in the current scene. In some implementations, the granularity of the luminance map data may be the same as the granularity of the SDR image data. That is, one pixel in the luminance map data may correspond to one pixel in the SDR image data. In other implementations, the granularity of the luminance map data may be greater than the granularity of the SDR image data. That is, one pixel in the luminance map data may correspond to multiple pixels in the SDR image data. Thus, the size of the luminance map is equivalent to a proportionally reduced size of the SDR image.
[0084] Generally, the transparency value can be set to a range of 0-255. A larger transparency value indicates a lower transparency (i.e., less transparency) and a correspondingly higher brightness. Conversely, a smaller transparency value indicates a higher transparency (i.e., more transparency) and a correspondingly lower brightness. For example, a pixel with a transparency value of 255 corresponds to being completely opaque and having a higher brightness. Alternatively, a pixel with a transparency value of 0 corresponds to being completely transparent and having a lower brightness.
[0085] In different implementations, the correspondence between different transparency values and brightness in the image can be flexibly configured.
[0086] In some other implementations of the present application, a pixel with a transparency value of 255 may correspond to a lower brightness, and a pixel with a transparency value of 0 may correspond to a higher brightness.
[0087] It should be noted that since the brightness map does not include color information, a brightness map drawn directly based on the transparency value is invisible. Therefore, when viewing the brightness map, grayscale shading can be performed based on the transparency value of each pixel. The resulting grayscale image corresponds to the brightness map.
[0088] In the grayscale coloring process, the larger the transparency value, the lighter the corresponding color, and the closer it is to white. Conversely, the smaller the transparency value, the darker the corresponding color, and the closer it is to black.
[0089] Table 1 below shows examples of corresponding relationships among transparency value, transparency, brightness, and grayscale coloring in two cases where the transparency value is 0 and the transparency value is 255.
[0090] Table 1
[0091] As shown in Table 1, in the transparency image colored according to grayscale, the darker the color, the higher the transparency and the lower the brightness. Conversely, the lighter the color, the higher the transparency and the higher the brightness.
[0092] It should be noted that in the embodiments of the present application, color and brightness are two different parameters. For example, "white" can be used to indicate that the color of the location is white, while "brightness" is used to indicate the brightness of the location.
[0093] Taking HDR image data as an example, the color information of each pixel can be included in the SDR image data, and the brightness information (i.e., transparency value) of each pixel can be included in the brightness map data.
[0094] As an example scenario, consider a white light source placed on a white wall. In the SDR image data, the color corresponding to the white wall can be white, and the color of the white light source can also be white. However, in the brightness distribution indicated by the brightness map data, the brightness of the white wall will be lower than that of the white light source. This combined color and brightness image display mechanism effectively differentiates the display effects of different elements in the image.
[0095] It should be noted that in some specific scenarios, electronic devices may only store the corresponding SDR image data after HDR shooting. For example, when the user uses automatic adjustment functions for the image such as automatic beauty, the electronic device may only store the SDR image corresponding to the current scene. In this case, if the electronic device needs to use the corresponding brightness map, it can process and obtain the corresponding brightness map based on the various setting parameters during shooting and the SDR image data. In the following examples, it is taken as an example that the HDR image data includes the corresponding SDR image data and brightness map data.
[0096] Thus, the electronic device can store the HDR image data of image A at address B in the memory. It should be noted that the example shown in FIG2 is based on the example of storing the corresponding SDR image and brightness map when storing the HDR image. In other implementations, the electronic device can also store the corresponding SDR image and brightness map when capturing a normal image with the HDR shooting function turned off for subsequent use.
[0097] The electronic device may also provide functions such as viewing and editing of image A.
[0098] As shown in FIG3 , the main interface 101 of the electronic device may include an icon 112 for a gallery application. The user may input an operation 113 on the icon 112 to instruct the electronic device to open the gallery so that the user can view the images that have been captured. The operation 113 may be a click operation on the icon 112.
[0099] 4 , in response to operation 113 , the electronic device may run a gallery application and switch to display an interface 201 corresponding to the gallery application.
[0100] As shown in FIG4 , the electronic device can display stored images to the user on interface 201. In some implementations, the stored images can be displayed on interface 201 in the form of thumbnails (referred to as thumbnails). For example, interface 201 can include thumbnail 202 of image A captured and stored using the scene example shown in FIG1 .
[0101] When the user wants to zoom in and view image A, an operation 203 may be input on the interface 201. The operation 203 may be an operation input on the thumbnail 202 of image A. For example, the operation 203 may be a click operation.
[0102] In response to operation 203, the electronic device may switch to display interface 204. Interface 204 may include an enlarged image 205 of image A, or simply referred to as a large image 205 of image A. In some implementations, large image 205 of image A may be an image obtained by the electronic device, after receiving operation 203, by enlarging the small image 202 of image A accordingly based on the size of the display screen.
[0103] It is understood that, in conjunction with the description of Figures 1 and 2, the data of image A stored in the electronic device may be HDR image data. Therefore, after displaying the SDR image data of image A, the large image 205 shown in Figure 4 may include more detailed information than the ordinary image data obtained in the ordinary shooting mode.
[0104] In some implementations of this application, the electronic device may also provide E-HDR display capabilities. Based on this E-HDR display capability, the electronic device may adjust the display brightness of the display units corresponding to various positions on the display screen during the display of the image according to the brightness map of the currently displayed image. This allows the user to obtain an HDR display experience with brighter highlights when viewing images through the display screen of the electronic device. In this application, the operating mechanism of adjusting the brightness of the display unit according to the brightness map may also be referred to as brightness adjustment processing.
[0105] 5 , taking image A as an example, where position 2 has a higher brightness and position 1 has a lower brightness, after grayscale coloring is performed on the brightness map of image A, the color of position 1 is closer to black, and the color of position 2 is closer to white.
[0106] When performing E-HDR display, take position 2 as an example. The electronic device can increase the brightness of the display unit at position 2 on the display screen by a certain multiple or to a certain value, so that when the user views image A through the display screen, a higher brightness viewing effect is obtained at position 2. As for the display unit at the corresponding position of position 1 on the display screen, the electronic device may not increase the brightness of the display unit, or the degree of brightness increase may be less than the degree of brightness increase at the corresponding position of position 2. In this way, the HDR display effect of image A can be obtained. In this application, the HDR display effect obtained by brightness adjustment processing may also be referred to as an E-HDR display effect. The E-HDR display effect of an image can be manifested as: when a user views an image through an electronic device, the user can obtain a brighter viewing experience of the bright parts.
[0107] As a specific example, Figure 6 provides a comparison of the display effects in an actual scene when the E-HDR function is turned on and off. The image shown in 501 with E-HDR OFF is the display effect when the E-HDR function is turned off. The image shown in 502 with E-HDR ON is the display effect when the E-HDR function is turned on.
[0108] Obviously, in the display effect of 502, the brightness of the bright part of the image (such as the area near the street lamp) is higher than the display effect of the same position in 501. The display effect in 502 is also clearer.
[0109] In order to let the user know that the E-HDR function is currently enabled for large-scale image viewing, as shown in FIG7 , in some embodiments, a logo 401 may be displayed in the large-scale image. This logo 401 can be used to remind the user that the E-HDR function is currently enabled, that is, the current display effect and the brightness adjustment process as shown in FIG5 are integrated. In other implementations, in order not to affect the user's viewing of the large-scale image, the electronic device may not display this logo 401 even if the E-HDR function is enabled.
[0110] It is understood that in different implementations, the E-HDR function may be enabled or disabled by default. Alternatively, the E-HDR function may be enabled or disabled by the user.
[0111] In the above example, the process of capturing and viewing image A is described. In some cases, the electronic device may also provide the user with the ability to edit images.
[0112] For example, in some implementations, the interface 201 shown in FIG4 may include a control 206. The control 206 may provide a display control interface for all images in the gallery. For example, a user may click the control 206 to set a sorting rule for each thumbnail.
[0113] In other implementations, the interface 204 shown in FIG4 may include a control set 207. The control set 207 may include multiple controls. Different controls may provide different functions. For example, a "Share" control may be used to provide image sharing functionality for the large image 205. Another example is an "Edit" control may be used to provide image editing functionality for the large image 205.
[0114] Take the "Edit" control shown in Figure 4 as an example.
[0115] In the "Edit" control of an image, a variety of different image processing functions can be provided to the user.
[0116] For example, through the "Edit" control, the electronic device can provide users with image processing functions such as rotation, cropping, filtering, and graffiti.
[0117] In combination with FIG4 , refer to FIG8 , which takes the user using the graffiti function as an example.
[0118] As shown in FIG. 8 , the user may input an operation 310 in the interface 204 to put the image into an editing state.
[0119] The operation 310 may be an operation, such as a click operation, on the control 301. The control 301 may correspond to the aforementioned "edit" control, and the current image (large image 205 as shown in FIG4 ) may be put into an editing state through the control 301.
[0120] In response to operation 310, the electronic device may switch to display interface 302. Interface 302 may be an interface after the large image 205 enters the editing state.
[0121] In the interface 302, an image A may be displayed so that the user can confirm that the image A is currently being edited. The interface 302 may also include a control set 303. The control set 303 may include multiple sub-controls. Each sub-control corresponds to a function under the "Edit" control.
[0122] For example, the control set 303 may include a sub-control corresponding to the rotation function, a sub-control corresponding to the trim function, a sub-control corresponding to the filter function, a sub-control corresponding to the graffiti function, etc. Take the sub-control corresponding to the graffiti function as control 304 as an example.
[0123] The user may input an operation 320 in the interface 302 to trigger a function in the control set 303 .
[0124] For example, in this example, operation 320 is used to trigger the graffiti function. As an example, operation 320 can be a click operation on sub-control 304. Thus, operation 320 can trigger the electronic device to perform graffiti processing on the currently displayed image A.
[0125] In response to operation 320 , the electronic device may enter the graffiti interface 305 corresponding to image A.
[0126] In the graffiti interface 305 , the user can graffiti and edit the image A.
[0127] For example, the user may touch the display screen of the electronic device and slide along the track 306 on the image A, ie, input operation 330 , instructing the electronic device to draw graffiti on the image A along the track 306 .
[0128] After completing the graffiti editing, the user may input a confirmation operation on the interface 305 to indicate to the electronic device that the current graffiti editing has been completed. For example, the confirmation operation may correspond to operation 340 as shown in FIG8 .
[0129] In response to operation 340 , the electronic device may jump to display interface 307 . It can be seen that in interface 307 , the graffiti effect input by the user along trajectory 306 is displayed on the large image of image A.
[0130] After determining the graffiti effect, the user may input operation 350 to indicate that the electronic device has completed editing of image A. For example, operation 350 may correspond to the user inputting an operation on a “save” button on interface 307 .
[0131] In response to operation 350 , the electronic device may save image data including various editing effects (such as the graffiti effect input along the trajectory 306 ) and image A. The editing effect may also be referred to as editing content, and the graffiti effect may also be referred to as graffiti content.
[0132] In some implementations, after receiving operation 350, the electronic device may jump to display interface 308. Interface 308 may display a large image of image A including various editing effects. For example, the large image of image A may be image 309 as shown in FIG8 . In this example, image 309 may also be referred to as the edited image. Correspondingly, image A before editing may be referred to as the original image.
[0133] It should be noted that, in the example shown in Figure 7, the graffiti operation on an image can be performed based on the image's SDR image. For example, although Image A is captured using the HDR shooting function, the electronic device's memory also stores the SDR image data and luminance map data for Image A. When performing editing operations such as graffiti, the electronic device also synthesizes and displays the edited content based on the SDR image.
[0134] That is, as shown in FIG9 , after editing the original image, the SDR image of the edited image obtained can be an SDR image that incorporates the edited content. For example, the SDR image of the original image can be a large image of image A shown in interface 204 in FIG8 . The edited image can be image 309 shown in interface 308 in FIG8 . Image 309 can include the graffiti content entered during the editing process.
[0135] As shown in Figure 9, the brightness map of the edited image does not reflect the relevant information of the editing operation. For example, the brightness map of the edited image can be the same as the brightness map of the original image.
[0136] Figures 5-7 provide examples of solutions related to the E-HDR function. Because the brightness adjustment of the display unit on the display screen is performed based on the transparency values at different locations indicated by the brightness map, the brightness map data of the edited image does not accurately reflect the transparency values related to the edited content. Therefore, when the brightness adjustment processing corresponding to the E-HDR function is performed on the edited image based on the stored brightness map data of the edited image, it will not accurately correspond to the content to be displayed in the edited image.
[0137] In order to solve the above problems, an embodiment of the present application provides an image processing method. Through this solution, the editing content of editing operations such as graffiti is integrated into the brightness map of the original image, thereby obtaining the brightness map of the edited image. By integrating the editing content into the brightness map of the edited image, the brightness map data of each position on the editing content path (i.e., the editing path) can be updated. In this example, after the image is edited, the transparency value on the editing path can decrease, that is, the brightness becomes lower. For example, the transparency of a certain position on the original image is 30. When the editing path passes through this position, the transparency value of the edited position can be less than 30, such as becoming 20. Thus, based on the brightness map of the edited image, and the SDR image of the edited image including the edited content, the electronic device can accurately perform brightness adjustment processing on the display unit on the display screen when displaying the edited image, thereby obtaining the E-HDR display effect of the edited image.
[0138] It should be noted that the electronic device in the embodiments of the present application can be a smart switch, an electronic switch, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0139] In some embodiments, the electronic device may have the following structure:
[0140] Processor, external memory interface, internal memory, universal serial bus (USB) connector, charging management module, power management module, battery, antenna 1, antenna 2, mobile communication module, wireless communication module, audio module, speaker, receiver, microphone, headphone jack, sensor module, button, motor, indicator, camera module, display, and subscriber identification module (SIM) card interface, etc. The sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0141] The processor may include one or more processing units, for example, an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0142] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
[0143] The processor may also include a memory for storing instructions and data. In some embodiments, the memory in the processor may be a cache memory. This memory can store instructions or data that have been used by the processor or that are frequently used. When the processor needs to use the instruction or data, it can directly access it from the memory. This avoids duplicate accesses, reduces processor latency, and thus improves system efficiency.
[0144] Display screens in electronic devices are used to display images, videos, and the like. Display screens include display panels. Display panels can be liquid crystal displays (LCDs), organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), MiniLEDs, MicroLEDs, Micro-oLeds, quantum dot light-emitting diodes (QLEDs), and the like. In some embodiments, an electronic device may include one or more display screens.
[0145] As an example, in this application, the display screen of an electronic device may have the capability of zone dimming. For example, the electronic device may configure the brightness of different locations on the display screen differently based on the brightness map of the currently displayed image. This allows the E-HDR effect to be displayed even without adjusting the image itself. For example, the display screen may be an OLED screen.
[0146] It is understood that the above schematic structure does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than the above examples, or combine or separate certain components, or arrange the components differently. The above components may be implemented in hardware, software, or a combination of software and hardware.
[0147] In some embodiments, the electronic device may have the software composition shown in FIG. 10 .
[0148] For example, in the example provided in FIG10 , an operating system or a software storage system may be run in the electronic device. The software system may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.
[0149] As shown in Figure 10, the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime (ART) and native C / C++ library, hardware abstraction layer (HAL) and kernel layer.
[0150] Application layer, referred to as application layer, or application layer, or APP layer.
[0151] The application layer can include a series of application packages.
[0152] As shown in Figure 10, the application package may include a gallery. In some implementations, the application package may also include applications such as a camera, map, WLAN, music, SMS, call, navigation, Bluetooth, and video.
[0153] Application framework layer, referred to as framework layer or Framework layer for short.
[0154] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0155] As shown in FIG10 , the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and the like.
[0156] The window manager provides the Window Management Service (WMS), which can be used for window management, window animation management, surface management, and as a hub for the input system. Content providers store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon can include a view for displaying text and a view for displaying images. The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager enables applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, requiring no user interaction. For example, the notification manager is used to notify users of download completions and message reminders. The notification manager can also display notifications in the system's top status bar as icons or scrolling text, such as notifications from background applications, or as dialog windows that appear on the screen. For example, it can display text messages in the status bar, emit prompt sounds, vibrate electronic devices, flash indicator lights, etc. The Activity Manager can provide Activity Manager Service (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers), as well as manage and schedule application processes. The Input Manager can provide Input Manager Service (IMS), which can be used to manage system input, such as touch screen input, key input, and sensor input. IMS extracts events from input device nodes and, through interaction with WMS, distributes the events to the appropriate window.
[0157] The Android runtime consists of the core libraries and the Android runtime. The Android runtime is responsible for converting source code into machine code. It primarily utilizes ahead-of-time (AOT) and just-in-time (JIT) compilation technologies.
[0158] The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks, etc. The core library provides an API for users to develop Android applications.
[0159] Native C / C++ libraries can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0160] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. OpenGL ES provides 2D and 3D graphics drawing and manipulation within applications. SQLite provides a lightweight relational database for electronic device applications.
[0161] The hardware abstraction layer (HAL) runs in user space, encapsulating kernel drivers and providing a calling interface to upper layers.
[0162] As shown in FIG7 , the hardware abstraction layer may include an audio module, a camera module, a Bluetooth module, and the like.
[0163] In this example, the hardware abstraction layer may also include a display module.
[0164] In some embodiments, the display module may be provided with a display algorithm unit, which may be provided with one or more display-related strategies.
[0165] For example, the display algorithm unit may include an HDR effect determination strategy. An application (such as a gallery application) can interact with the display algorithm unit and, based on the HDR effect determination strategy, determine whether to adjust the brightness of the currently displayed image to obtain the corresponding E-HDR display effect.
[0166] For another example, the display algorithm unit may include an HDR effect brightness strategy. Based on the HDR effect brightness strategy, the display algorithm unit may provide brightness adjustment parameters corresponding to each display unit on the display screen during the current brightness adjustment process.
[0167] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and Bluetooth driver.
[0168] In the example shown in Figure 10, the hardware layer below the kernel layer is also shown. It is understood that when an electronic device needs to invoke certain hardware functions, commands can be transmitted layer by layer through one or more of the application layer, application framework layer, native C / C++ library, hardware abstraction layer, and kernel layer. Ultimately, the command is sent to the corresponding hardware component in the hardware layer through the kernel layer. This allows the hardware component to provide the corresponding hardware function based on the received command.
[0169] Exemplarily, as shown in FIG10 , the hardware layer may include a memory for storing data, a CPU for processing and distributing instructions, and a GPU for image processing, etc.
[0170] In some embodiments, the memory shown in FIG. 10 may correspond to at least one of the internal memory, the external memory connected via the external memory interface, and the on-chip storage space.
[0171] It should be noted that the components shown in FIG10 are merely examples and do not constitute any limitation on the electronic device of the present application. In other embodiments, the electronic device may also have more or fewer modules or components as shown in FIG10 to implement the various functions provided in the present application.
[0172] For example, refer to Figure 11. In some embodiments of the present application, the gallery application in the application layer may be provided with multiple different functional modules for acquiring and storing the edited image after the editing operation. For example, it may be used to acquire the SDR image of the edited image and the brightness map of the edited image.
[0173] As shown in FIG11 , in this example, an editing function module may be provided in the gallery, which is mainly used to support various editing functions in the control set 303 shown in FIG8 .
[0174] In this example, the editing function module may include an adjustment function unit for supporting image brightness and contrast adjustment functions; a filter function unit for supporting image filter adjustment functions; a graffiti function unit for supporting image graffiti editing functions; a rotation function unit for supporting image horizontal / vertical adjustment functions; and a trim function unit for supporting image cropping and editing functions.
[0175] As shown in Figure 11, the gallery application may also include image cache management. This image cache management can be used to draw corresponding images in the cache based on user input during image editing. This facilitates updating the preview to the user based on the image drawn in the cache.
[0176] The task processing center in the gallery application can be used to receive, package, and distribute various tasks.
[0177] The image preservation service can be used to provide users with processing and storage capabilities for new images, including edited content and SDR images, after the user completes editing. In some implementations, the image preservation service can save the original image and the edited content on the original image as a new edited image. The edited image may also include a corresponding SDR image and a brightness map. The SDR image of the edited image can be obtained based on the edited content and the SDR image of the original image. The brightness map of the edited image can be obtained based on the brightness map of the original image and the edited content. The SDR image of the edited image and the brightness map of the edited image can be used to accurately provide the user with the E-HDR display effect of the edited image.
[0178] When implementing the above functionality, the gallery application can interact with the display algorithm unit in the HAL layer to determine parameters for specific operations. For example, whether the current editing operation requires brightness adjustment. In another example, the display algorithm unit in the HAL layer can also provide brightness adjustment parameters for brightness map adjustment.
[0179] In addition, when implementing the above functions, the gallery application can also interact with the memory of the electronic device, thereby storing the edited content, the SDR image and brightness map of the original image, the SDR image and brightness map of the edited image, etc. in the memory for easy access by other modules.
[0180] It should be noted that the example in Figure 11 uses the various functional modules as an example, implemented within a gallery application. That is, in this example, the code corresponding to each functional module can be integrated into the gallery application's application package. In other embodiments, one or more of the aforementioned functional modules can also be implemented within the framework layer of the electronic device. This allows the electronic device to be powered on and run its operating system, enabling it to implement the aforementioned functions in conjunction with the various applications installed within the application layer.
[0181] In the following example, the solution provided in the embodiment of the present application is described in detail by taking an electronic device applied to an electronic device as shown in FIG10 , where the electronic device includes a logical framework as shown in FIG11 .
[0182] It's important to note that, as mentioned in the previous example, the Gallery app provides a variety of editing functions. The following examples use the Scribble function as an example to illustrate its implementation. It's understood that the implementation of other editing functions is similar to that of the Scribble function, and they can be used as a reference, so I won't go into detail here.
[0183] Referring to Figure 12, which is a schematic diagram of the interaction between modules, the electronic device can implement drawing and updating of the preview image during the graffiti process based on the solution provided in Figure 12.
[0184] As shown in Figure 12, the solution may include:
[0185] S901: The gallery application generates a graffiti function activation instruction, and sends the graffiti function activation instruction and address B to a graffiti function unit.
[0186] Among them, address B can store the storage address of the SDR image of the current original image (such as image A). Combined with the above description, when image A is an HDR image, address B can also store the brightness map corresponding to image A.
[0187] 1 to 4 , in this example, the electronic device may display an interface 204 as shown in FIG4 after receiving user input of operations 103 and 203 as shown in FIG1 and FIG2 . The interface 204 may include a large image 205 of image A.
[0188] In some embodiments, the large image 205 may be displayed according to the SDR image of image A. Alternatively, the display of the large image 205 may also be achieved by the electronic device after performing brightness adjustment processing as shown in FIG5 .
[0189] 8 , after the user inputs operations 310 to 320 , the electronic device may determine that it needs to enter the graffiti function interface.
[0190] Then, in response to operation 320, the tile application of the electronic device may generate a graffiti function start instruction. The gallery application may send the graffiti function start instruction to the graffiti function unit so that the graffiti function unit completes initialization and further supports subsequent graffiti operations.
[0191] In this example, the electronic device may also send the address (such as address B) of the SDR image storing the currently displayed image to the graffiti function unit, so that the graffiti function unit may obtain the SDR image from the address B for subsequent processing.
[0192] S902: The graffiti function unit stores the graffiti information input by the user in a memory address A. The address A may be an address in a storage space configured for the graffiti function in the memory.
[0193] For example, the graffiti information may include the graffiti path, and the color information selected by the current editor.
[0194] 8 , the graffiti path may be track 306. The color information currently selected for editing may also correspond to the color setting in interface 305.
[0195] S903: The graffiti function unit sends the graffiti information and the SDR image information to the image cache management.
[0196] In this example, the sending of the graffiti information and the SDR image data can be achieved by sending the storage address of the graffiti information and the storage address of the SDR image data.
[0197] For example, the graffiti path and color information included in the graffiti information may be stored at address A, and the SDR image data of image A may be stored at address B. Then, the graffiti function unit may send address A and address B to the image cache management.
[0198] S904: The image cache management obtains graffiti information.
[0199] For example, the image cache management may obtain graffiti information including graffiti path, color information and other graffiti-related content from address A.
[0200] S905: Image cache management obtains SDR image data.
[0201] Exemplarily, the image cache management may also obtain SDR image data corresponding to the current original image (eg, image A) from address B.
[0202] S906: The image cache management obtains corresponding edited image data based on the scribble information and the SDR image data, and stores the edited image data at address C. Similar to address A, address C may be an address in a storage space configured for the scribble function in the memory. The edited image data stored at address C may be SDR image data of the edited image.
[0203] [Corrected 16.11.2023 according to Rule 91] In this example, the image cache management can create a new blank texture at address C and draw the SDR image obtained from address B onto the blank texture at address C. The image cache management can also draw the user-entered graffiti content onto the SDR image on the texture at address C based on graffiti information such as the graffiti path and color information. As in the example of Figure 12, the image cache management can also execute S907 to send address C to the graffiti function unit for subsequent preview and update processing.
[0204] In this way, on the newly created texture at address C, an SDR image including image A and an image of the graffiti content can be obtained.
[0205] The electronic device can display the image content on the newly created sticker at address C on the display screen, thereby achieving image preview update during the graffiti process.
[0206] For example, referring to FIG8 , after the electronic device displays the image data on the newly created sticker at address C, it may display the interface 305 shown in FIG8 .
[0207] It is understandable that when the user needs to continue inputting other graffiti content, the electronic device can repeatedly execute the above S901-S906 and subsequent display operations, thereby achieving preview updates during the graffiti process.
[0208] 8 , after using the editing functions such as graffiti provided by the gallery application, the user can save the editing results, such as by entering operations 340 to 350 as shown in FIG8 .
[0209] In response to operation 350, the electronic device may store the edited image. The edited image may include an SDR image of the original image and the edited content. For example, if the editing operation is graffiti, the edited image may include the SDR image and the graffiti content. For example, the edited image may correspond to image 309 shown in FIG8 .
[0210] It should be noted that in some implementations, the storage of the edited image and the updating of the preview image shown in FIG. 12 can occur in two separate processes. For example, the drawing and acquisition of the preview image shown in FIG. 12 can occur at address C. When the preview image needs to be updated, the image at address C can be updated by overwriting the previous data, so that the preview image is updated according to the updated data. In other words, the image data at address C will change according to the current display requirements.
[0211] The storage operation of the edited image may be performed based on an address other than the address C.
[0212] For example, the storage operation of the edited image may include drawing on a texture at address D in memory and storing it.
[0213] It is understood that after the edited image storage operation is completed, the image data stored at address D will not change and will not be overwritten by other image data. Only when the user inputs an instruction to delete the stored image will the electronic device release the storage space at address D and delete the image data stored at address D or overwrite it with other data.
[0214] In the following example, the implementation of the storage process for editing an image is described with reference to the logic components shown in FIG11 .
[0215] For example, refer to Figure 13. When storing an edited image, the graffiti function unit can receive a graffiti save instruction. Accordingly, the graffiti function unit can send a save message to the image cache management to instruct the image cache management to perform the storage operation of the edited image. The image cache management can send a save image task to the task processing center. Accordingly, the task processing center can obtain the image parameters required to execute the save image task based on the information of the image to be saved carried in the save image task. The task processing center can then start the thread corresponding to the image save task based on the image parameters, allowing other components (such as the image save service) to run the thread to implement the storage of the edited image.
[0216] The following describes in detail the storage process of the edited image shown in FIG14 in conjunction with the schematic diagram of the interaction flow between the modules provided in FIG13 .
[0217] As shown in Figure 14, the solution may include:
[0218] S1101. The graffiti function unit sends a save message to the image cache management.
[0219] Exemplarily, after receiving the edit save instruction, the graffiti function unit may send the save message to the image cache management.
[0220] In some embodiments, the image saving message may include an identifier corresponding to the completion of the editing operation, so that the image cache management can determine, based on the identifier, that the current editing has been completed and that the corresponding image needs to be stored.
[0221] In the present application, the edit-save instruction may be generated by the gallery application. For example, in conjunction with FIG8 , the gallery application may generate the edit-save instruction upon receiving operation 350 input by the user.
[0222] It is understood that, as shown in the example of FIG8 , editing operations can include multiple types. For example, after a user performs a corresponding graffiti operation in input interface 305 , they can also use other sub-controls in control set 303 to edit the image. After completing all editing operations, the user enters operation 350 . Thus, the gallery application can trigger the generation of the edit and save instruction based on operation 350 .
[0223] When the user's current edit of image A only includes the graffiti operation corresponding to operation 330 , the gallery application may also trigger the generation of an edit save instruction when receiving operation 340 input by the user.
[0224] In the following description, it is taken as an example that the user's editing of image A only includes the graffiti operation corresponding to operation 330 shown in FIG. 8 .
[0225] It should be noted that, as shown in FIG14 , in some implementations of the present application, before receiving the edit and save instruction, the graffiti function unit may also send the graffiti information of the graffiti operation input by the user to the image cache management in batches or all at once.
[0226] Correspondingly, the image cache management can store these graffiti information for subsequent use.
[0227] For example, the image cache management may place the received graffiti information into the user operation stack.
[0228] As you can understand, a stack, as a data structure, is a special linear list that can only be inserted and deleted at one end. Therefore, storing the received graffiti information sequentially in the user operation stack can accurately correspond to the order of each graffiti information, thus ensuring the accuracy of subsequent drawing and saving.
[0229] As an example, referring to FIG8 , after the user inputs operation 330, the graffiti function unit may send the graffiti track corresponding to operation 330 (i.e., track 306) and the currently selected color information to the image cache management. In response, the image cache management may store the track 306 and the currently selected color information in the user operation stack.
[0230] S1102: The image cache management determines image information based on the graffiti information.
[0231] For example, the image cache management can stack all the graffiti information corresponding to the current editing operation according to the identifier in the save message, thereby obtaining the graffiti information of all operations input in the current graffiti editing process in the order input by the user.
[0232] In some embodiments, the image cache management can encapsulate all graffiti information in the current editing process to form a data set (or called an editing operation stack), so that other modules can determine all operations (i.e., all graffiti operations) in the current editing process by calling this data set.
[0233] In other embodiments, the image cache management may further encapsulate other image information and the editing operation stack again to obtain image information corresponding to the current original image (eg, image A).
[0234] As an example, the image information may include at least one of the following:
[0235] The storage address of the original image, editing operation stack, image saving quality, HDR logo, etc.
[0236] For example, referring to the example of FIG12 , the storage address of the original image may be the SDR image data storage address of image A, such as address B. The editing operation stack may include the graffiti path, color information, etc. stored in address A.
[0237] In this example, the image information may further include image preservation quality.
[0238] It is understood that when saving an image, the image saving quality can be configured by the user or by default in the electronic device. The higher the image saving quality, the larger the amount of image data saved and the clearer the image display.
[0239] In some implementations, the image information may further include an HDR identifier.
[0240] The HDR flag can be a first value or a second value. When HDR is the first value, the corresponding current original image is an HDR image. When HDR is the second value, the corresponding current original image is not an HDR image.
[0241] In combination with the above brief description of HDR images, for an HDR image, the electronic device may include an SDR image of the image and a brightness map of the image at the storage address of the image.
[0242] In this example, image A may be an HDR image, that is, the electronic device may store an SDR image and a brightness map of image A. Then, the HDR flag of image A may be the first value.
[0243] In the following examples, image information including the storage address of the original image, the editing operation stack, and the HDR flag is taken as an example.
[0244] S1103: The image cache management sends the image saving task to the task processing center.
[0245] Exemplarily, the save image task may be used to instruct saving of the currently edited image.
[0246] The save image task may carry image information of the edited image to be saved.
[0247] S1104: The task processing center pre-processes the image information.
[0248] It is understandable that the task processing center, as a task receiving and transferring module, can be used to process the commands issued by the gallery application.
[0249] In some embodiments, a task queue may be provided in the task processing center, and the task queue may store one or more tasks from the gallery application according to the priority and chronological order of the received tasks.
[0250] After obtaining the task processing resources (such as computing resources and storage resources) configured by the electronic device, the task processing center can take out tasks from the task queue in sequence and configure them to the corresponding services for execution.
[0251] In this example, before assigning tasks to each service, the task processing center can also pre-process the received tasks so that the corresponding service can efficiently execute the corresponding task based on the pre-processed data.
[0252] As an example, after receiving the image saving task, the task processing center may pre-process the edited image to be saved.
[0253] For example, the task processing center can parse the encapsulated image information, obtain the storage address of the current original image, edit the operation stack, and the HDR identifier.
[0254] Combined with the example of Figure 12, the task processing center can parse the image information of image A and obtain the storage address of image A (that is, the storage address of the SDR image of image A) as address B. The editing operation stack includes the graffiti path and color information stored in address A, and the HDR identifier of image A is the first value (that is, image A is an HDR image).
[0255] S1105: The task processing center starts the image saving task.
[0256] For example, in some embodiments, the task processing center may start the save image task after determining that the electronic device has configured task processing resources for the save image task.
[0257] In other embodiments, the task processing center may execute S1105 after completing image information preprocessing. The task processing center may also place the initiated save image task into a task queue so that the save image task can be automatically executed after the electronic device configures task processing resources for the save image task.
[0258] In an embodiment of the present application, the image saving task initiated by the task processing center can be executed by the image saving service shown in FIG11 .
[0259] Exemplarily, in conjunction with the example in FIG14 , the image saving service may obtain image information of an image to be saved (ie, an edited image) from the image saving task.
[0260] The image information may include the storage address of the original image, the editing operation stack, the image saving quality, and the HDR identifier.
[0261] The image preservation service can obtain the SDR image and brightness map of the edited image based on the image information. When the edited image needs to be displayed, the electronic device can adjust the brightness of the display unit of the display screen based on the brightness map of the edited image, thereby achieving an E-HDR display effect.
[0262] The following examples illustrate the mechanisms for obtaining the SDR image of the edited image and the brightness map of the edited image.
[0263] For example, in some embodiments, the image preservation service can retrieve the SDR image of the original image before editing from the storage address of the original image. The image preservation service can also obtain the user's editing operations from the editing operation stack. Based on this, the image preservation service can draw the SDR image of the edited image at a pre-configured address in the memory.
[0264] For example, take the original image before editing as image A, and the editing operation stack is transmitted through the storage address of the editing operation stack.
[0265] 15 , the image saving service may obtain the SDR image of image A from address B. The image saving service may obtain the various editing operations in the editing operation stack from address A. For example, the operations in the editing operation stack may include a graffiti track along track 306 as shown in FIG8 .
[0266] The storage address configured for the image saving service in the memory may be address D.
[0267] The image saving service can then create a new tile D1 at address D. The image saving service can then draw the SDR image of image A onto the newly created tile D1 at address D. The image saving service can also draw the graffiti operation, including the track 306, from address A onto the SDR image of image A in the newly created tile D1 at address D. Thus, the SDR image of the edited image can be obtained on the newly created tile D1 at address D.
[0268] It can be understood that after drawing the SDR image of Image A on the newly created texture D1, each pixel of the texture D1 can be set to a corresponding color value. Then, after continuing to draw the graffiti track on the texture D1 and applying the corresponding color, the image preservation service can use the color information corresponding to the graffiti track to overwrite the color indicated by the SDR image of Image A at the corresponding pixel. In this way, after the graffiti operation is completed, the effect of the graffiti overlaying the SDR image of Image A can be obtained on the texture D1.
[0269] It should be noted that during the SDR rendering process of the edited image, if the graffiti operation includes color information, the image preservation service can perform a corresponding coloring operation on the graffiti track based on the color information of the graffiti operation. This will obtain the SDR image of the edited image after coloring on the newly created texture D1 at address D.
[0270] In other embodiments, the image storage service can obtain the brightness map of the original image before editing from the storage address of the original image. The image storage service can also obtain the user's editing operations from the editing operation stack. Based on this, the image storage service can draw the brightness map of the edited image at a pre-configured address in the memory.
[0271] For example, take the original image before editing as image A, and the editing operation stack is transmitted through the storage address of the editing operation stack.
[0272] 16 , the image saving service may obtain a brightness map of image A from address B. The image saving service may obtain various editing operations in an editing operation stack from address A. For example, the operations in the editing operation stack may include a graffiti track along track 306 as shown in FIG8 .
[0273] The storage address configured for the image saving service in the memory may be address D.
[0274] The image saving service can then create a new tile D2 at address D. The image saving service can then draw the brightness map of image A onto the newly created tile D2 at address D. The image saving service can also draw the graffiti operation, including the track 306, from address A onto the brightness map of image A in the newly created tile D2 at address D. Thus, the brightness map of the edited image can be obtained on the newly created tile D2 at address D.
[0275] It is understandable that, unlike the drawing of SDR images, in the process of luminance map fusion drawing, since each pixel does not have a fixed color value, a simple overlay operation cannot be performed.
[0276] Taking the example of identifying a brightness image by a transparency value, each pixel in image A may correspond to a corresponding transparency value. This transparency value may be included in the SDR image information of image A stored at address B. Similarly, each pixel involved in a graffiti operation may also correspond to a corresponding transparency value. The transparency value of each pixel involved in the graffiti operation may be stored in an editing operation stack. For example, the transparency value of each pixel may be stored in the color information in the editing operation stack.
[0277] As an implementation, the image storage service can grayscale image D2 based on the brightness image of image A to obtain a grayscale image corresponding to the transparency. The grayscale shading process can refer to Table 1 and its related descriptions. For example, pixels with a transparency value of 0 are filled with black. Pixels with a transparency value of 255 are filled with white. Other transparency values can be filled according to the corresponding grayscale values.
[0278] The image saving service can also create a new texture D3. This texture D3 can be stored at address D or elsewhere. This texture D3 can be used to draw a mask layer. The mask layer can be drawn with a transparency color corresponding to the editing operation.
[0279] For example, if the editing operation includes a graffiti operation, the image preservation service can fill the pixels covered by the graffiti track with grayscale according to the transparency value in the editing operation stack.
[0280] Next, the image saving service can draw the mask layer image on the texture D3 onto the texture D2. This process can be called transparency fusion.
[0281] When fusing the transparency of any pixel, the image preservation service can determine the transparency of the pixel after fusion according to the following formula (1).
[0282] Formula (1): Transparency after fusion = (transparency in original image * (1-mask layer transparency / maximum transparency)).
[0283] The maximum transparency value is 255.
[0284] Thus, for pixels not covered by the graffiti track, since the mask layer does not include the transparency value of these pixels, the transparency of the mask layer for these pixels can be considered to be 0, that is, completely transparent. Therefore, the transparency of these pixels after fusion = the transparency of the original image. For pixels covered by the graffiti track, the transparency of these pixels after transparency fusion can be calculated according to formula (1).
[0285] Thus, by fusing the transparency values of the pixels on the map D2 one by one, a brightness map corresponding to the edited image can be obtained on the map D2. The brightness map includes the transparency value of each pixel of the edited image.
[0286] As a specific example, FIG17 provides a schematic diagram of a comparison of brightness images before and after fusion in an actual scene.
[0287] Here, the original image is taken as image B, and the editing operations include graffiti operation and text editing as examples.
[0288] In the scene example of image B in FIG17 , objects such as a light strip with relatively high brightness and a ceiling with relatively low brightness may be included.
[0289] Correspondingly, in the brightness image of image B, the transparency values of pixels near the light strip are larger, while the transparency values of pixels near the ceiling are smaller.
[0290] By grayscale-shading the brightness image of image B based on the transparency value, we can achieve the effect shown in 1401 in Figure 17. As can be seen, near the light strip (such as in area A), the transparency value is higher, and the brightness image after grayscale shading is closer to white. Near the ceiling (such as in area B), the transparency value is lower, and the brightness image after grayscale shading is closer to black.
[0291] In the example of FIG. 17 , the mask layer drawn according to each editing operation in the editing operation stack is shown as 1402 .
[0292] The mask layer image shows the drawing results corresponding to the graffiti operation and text editing. In this example, the graffiti operation can include two tracks, with the right track being lighter in color than the left track. In addition, the mask layer can also include two lines of text corresponding to the text editing, such as "Text Text" and "Text Text".
[0293] After the transparency fusion based on formula (1), the brightness map of the edited image corresponding to the image B shown in FIG17 can be obtained, as shown in 1403 in FIG17. It should be noted that in the brightness map shown in FIG17, for ease of explanation, the image effect after grayscale coloring according to the transparency value is used as an example.
[0294] As shown in FIG17 , in the brightness map of the edited image corresponding to image B, the bright light strips in the brightness map of image B correspond to the interspersed graffiti tracks drawn. In addition, the brightness map of the edited image corresponding to image B may also include the text edited content during the editing operation.
[0295] Therefore, through the example shown in FIG17 , it can be seen that the solution provided by the above formula (1) can effectively fuse the brightness map of the editing operation with the brightness map of the original image.
[0296] In this way, the image saving service can obtain the SDR image of the edited image on the map D1 at address D through the scheme shown in Figure 15. The image saving service can obtain the luminance map of the edited image on the map D2 at address D through the scheme shown in Figure 16.
[0297] The image storage service can then store the two maps at address D, thereby storing the SDR image and brightness map of the edited image. Therefore, when a user needs to view the edited image, for example, with HDR display enabled, the electronic device can adjust the brightness of the display unit on the display screen based on the brightness map of the edited image, thereby achieving an E-HDR display effect with brighter highlights.
[0298] As an example, referring to FIG18 , there is provided a schematic diagram of module interaction for an image saving service to obtain an SDR image and a brightness map of an edited image.
[0299] As shown in Figure 18, the solution may include:
[0300] S1501. The image preservation service obtains the SDR image of the edited image based on the SDR image of the original image and the editing operation stack.
[0301] Exemplarily, the image saving service may execute S1501 after receiving the image saving task from the task processing center.
[0302] In conjunction with the above description, the image saving task may include image information of the edited image obtained by parsing by the task processing center.
[0303] The image information may include: the storage address of the original image, the editing operation stack, the HDR identifier, etc.
[0304] Take the original image as image A as an example. The storage address of the original image may store the SDR image and the brightness map of image A. For example, the storage address may be address B as shown in FIG12 .
[0305] The editing operation stack may include the content of each editing operation entered by the user in image A. For example, if the user enters a graffiti editing operation, the editing operation stack may include the trajectory information, color information, etc. corresponding to the graffiti operation. For another example, if the user also enters a text editing operation, the editing operation stack may also include the position information, text information, color information, etc. corresponding to the text edit.
[0306] The image preservation quality can be used to perform corresponding data compression after obtaining the SDR image and / or brightness map of the edited image.
[0307] The HDR flag is used to indicate whether the original image is an HDR image. In this example, taking the original image (i.e., image A) as an HDR image, the corresponding HDR flag can be the first value.
[0308] In this example, the image preservation service may obtain the SDR image of the edited image on the tile D1 at the address D according to the scheme shown in FIG. 15 .
[0309] S1502: The image saving service sends an HDR display request to the display algorithm unit. The HDR display request may include an editing operation stack in the image saving task.
[0310] S1503: The display algorithm unit determines that the edited image requires an E-HDR display effect.
[0311] In conjunction with the description of the display algorithm unit in Figure 11, in this example, one or more display-related strategies may be pre-set in the display algorithm unit.
[0312] In some embodiments, the display algorithm unit may include an HDR effect determination strategy, which may be used by the display algorithm unit to determine whether brightness adjustment processing is required for the edited image obtained after editing, based on the current editing operation.
[0313] As an example, when the current editing operation includes brightness-related editing operations, the display algorithm unit can determine, based on the HDR effect judgment strategy, that it is not necessary to perform brightness adjustment processing on the display unit when displaying the edited image.
[0314] Among them, brightness-related editing operations may include: beauty editing and / or filter editing, etc.
[0315] In some implementations, if the display algorithm unit determines that brightness adjustment processing is not required, the determination result can be sent to the image storage service. The image storage service can then no longer store the brightness map data of the edited image, and only store the SDR image of the edited image. The SDR image of the edited image can be obtained using the solution shown in Figure 15.
[0316] Correspondingly, when the current editing operation does not include brightness-related editing operations, the display algorithm unit can determine, based on the HDR effect judgment strategy, that it is necessary to perform brightness adjustment processing on the display unit when displaying the edited image.
[0317] For example, when the current editing operation includes at least one of a graffiti operation, a text editing operation, a trimming operation, and a rotation operation, the display algorithm unit may determine that it is necessary to perform brightness adjustment processing on the display unit when displaying the edited image.
[0318] For example, if the current editing operation includes a graffiti operation, the display algorithm unit can determine, based on the HDR effect judgment strategy, that it is necessary to adjust the brightness of the display unit when displaying the edited image to obtain the corresponding E-HDR display effect.
[0319] It should be noted that, in the above example, the HDR display request includes the editing operation stack. In other embodiments of the present application, the HDR display request may further include an HDR identifier of the original image.
[0320] Correspondingly, before the display algorithm unit determines that it is necessary to perform brightness adjustment processing on the display unit when displaying the edited image based on the current editing operation, the display algorithm unit can also trigger the judgment of whether to perform brightness adjustment processing based on the editing operation when it determines that the HDR identifier is the first value, that is, indicating that the original image is an HDR image (with a corresponding brightness map stored).
[0321] It is understood that, in conjunction with the examples in Figures 15 and 16 , in this application, the brightness adjustment process for the display unit requires the use of the brightness map of the edited image. Acquiring the brightness map of the edited image requires the use of the brightness map of the original image. In other words, the image storage service can only successfully acquire the brightness map of the edited image when the original image is an HDR image and a corresponding brightness map is stored.
[0322] S1504: The display algorithm unit feeds back the determined HDR display information to the image storage service.
[0323] For example, the HDR display determination information may be used to instruct the image preservation service to perform brightness adjustment processing on the display unit when displaying the edited image. Accordingly, upon receiving the HDR display determination information, the image preservation service may trigger execution of the following S1505 to obtain a brightness map of the edited image.
[0324] S1505: The image saving service obtains the brightness map of the edited image according to the brightness map of the original image and the editing operation stack.
[0325] For example, the image saving service can obtain the brightness map of the original image from the storage address of the original image according to the scheme shown in Figure 16 or Figure 17, and obtain the brightness map of the edited image based on the editing operation stack. The specific implementation of this step can be referred to the description of Figures 16 and 17, and will not be repeated here.
[0326] S1506. The image saving service stores the SDR image and the brightness map of the edited image.
[0327] The SDR image of the edited image may be obtained in S1501, and the brightness map of the edited image may be obtained in S1505. In some embodiments, the SDR image and brightness map of the edited image may be stored in different maps at the same physical location. For example, with reference to Figures 15 and 16, the SDR image of the edited image corresponding to Figure A may be stored in map D1 at address D, and the brightness map of the edited image corresponding to Figure A may be stored in map D2 at address D.
[0328] It should be noted that the above FIG18 is only an example of obtaining the SDR image and brightness map of the edited image. In other implementations, the specific implementation method may also be different from the process shown in FIG18.
[0329] Exemplarily, in some embodiments, when the image information of the edited image carries the image preservation quality, after S1505 and before S1506, the image preservation service can also perform a compression operation on the acquired SDR image and / or brightness map of the edited image according to the compression rate indicated by the image preservation quality, so as to obtain image data of a size corresponding to the image preservation quality for storage.
[0330] In other embodiments, after completing S1501, the image preservation service may further determine the current number of image edits and update the edit operations. For example, if the current number of image edits is 0, the SDR image of the edited image obtained in S1501 is updated. This allows the obtained SDR image of the edited image to include content corresponding to all edit operations input by the user.
[0331] In other embodiments, during S1506, the image saving service may further perform other processing on the editing operation, such as updating the header information of the currently edited image, saving the file of the edited image in the data, setting the HDR flag of the edited image to the first value, and updating the file descriptor of the edited image (such as the Special_file_expand field).
[0332] Here, setting the HDR flag of the edited image to the first value can be achieved in the following manner: writing the ehdar information into the tail of the file of the edited image for identification.
[0333] Thus, through the solutions provided in Figures 12-18, the electronic device can automatically store the SDR image and brightness map of the edited image, including the edited content and the original image, when the user decides to save the current editing operation. This allows the electronic device to adjust the brightness of the display unit at the corresponding position on the display screen based on the stored brightness map of the edited image when the edited image is subsequently displayed in E-HDR, thereby achieving an E-HDR display effect for the edited image.
[0334] It should be noted that, in the descriptions of FIG. 16 , FIG. 17 and FIG. 18 , the image saving service actually performs operations such as coloring the brightness map of the original image and drawing a mask layer when obtaining the brightness map of the edited image.
[0335] In some other embodiments of the present application, the image preservation service may not perform brightness map rendering and / or mask layer drawing of the original image.
[0336] Then, in this example, when the image preservation service needs to determine the transparency value of a pixel in the edited image, it can directly calculate the transparency value of the pixel in the edited image based on the transparency value of the corresponding position in the original image and the transparency value of the edited content at that position, combined with the above formula (1). The image preservation service can repeat the above operation for each pixel in the edited image, thereby obtaining and saving the transparency value of each pixel. In this way, the transparency value corresponding to each pixel point included in the brightness map of the edited image can be obtained without actually drawing the grayscale colored image corresponding to the brightness map of the original image and / or the mask layer image corresponding to the edited content.
[0337] In this way, through the solution provided in Figure 18, the electronic device can provide a more accurate E-HDR display effect when displaying the edited image in a large image.
[0338] In order to enable those skilled in the art to more clearly and accurately understand the solution provided in the embodiments of the present application, the following, in combination with the interaction diagrams in each scenario of Figures 11 to 18, starts from the user's instruction to trigger the entry of the graffiti function, and exemplifies the specific implementation of obtaining and storing the SDR image data and brightness map data of the edited image in this application.
[0339] Exemplarily, as shown in FIG19 , the solution may include:
[0340] S1901: The gallery application generates a graffiti function start instruction and determines the data storage address B of the original image.
[0341] For example, the gallery application may generate the graffiti function start instruction under the user's instruction. For example, the user's instruction may include operation 320 as shown in FIG8 .
[0342] In this example, the gallery application may enter a graffiti mode for Image A under the instruction of operation 320. To enable subsequent preview updates of the graffiti content and storage of the edited image, the gallery application may also determine the data storage address B of the image currently being edited (i.e., Image A). The SDR image data and brightness map data of Image A may be stored in the data storage address B.
[0343] S1902: The gallery application sends a graffiti function start instruction and address B to the graffiti function unit.
[0344] In this way, the graffiti function unit can determine to trigger the graffiti mode for the current image (ie, image A).
[0345] S1903: The gallery application sends graffiti information to the graffiti function unit.
[0346] It is understandable that after the user input operation 320, graffiti content can be input on the current interface, such as a graffiti path, setting a graffiti color, etc. Correspondingly, the gallery application can send the graffiti information including the graffiti path, graffiti color, etc. to the graffiti function unit.
[0347] S1904: The graffiti function unit sends the graffiti information to the memory for storage.
[0348] S1905: The memory stores the graffiti information at address A.
[0349] For example, the memory may store graffiti information such as a graffiti path and a graffiti color input by the user at address A.
[0350] S1906: The graffiti function unit sends address A and address B to the image cache management.
[0351] Among them, address A stores graffiti information, and address B stores SDR image data and brightness map data of the original image.
[0352] S1907 . The image cache management obtains the graffiti information from address A of the memory and obtains the SDR image data of the original image from address B.
[0353] S1908: The image cache management obtains the edited image including the current graffiti content.
[0354] Exemplarily, the image cache management may draw the graffiti content corresponding to the graffiti information into the SDR image, thereby obtaining an edited image including the graffiti content.
[0355] S1909: The image cache management sends the edited image including the current graffiti content to the memory.
[0356] S1910. The memory stores the data of the edited image at address C.
[0357] In this way, the image data including the current graffiti content can be obtained at address C. It is understandable that as the user inputs more graffiti operations or other editing operations, the content of the image data stored at address C can also be updated accordingly. The updated image data can include the content of all editing operations input by the user.
[0358] In some implementations, the electronic device may display the image data in address C at a certain frequency (such as a screen refresh rate), thereby enabling the user to update the preview image while editing the original image.
[0359] The specific implementation of S1901-S1910 can also refer to the steps in Figure 12, and the specific implementation can refer to each other.
[0360] It is understandable that the user's editing operations on the image can be input gradually. In this case, the gallery application will also receive multiple other editing operations input by the user. For example, more graffiti operations, text editing, etc. For example, the operations input by the user are all graffiti operations.
[0361] In this example, the gallery application can send the editing information corresponding to the received editing operations to the graffiti function unit, so that the graffiti function unit can sequentially put the editing information into the user operation stack.
[0362] After completing the graffiti operation and other editing operations, the user can input a save instruction to the electronic device. For example, the save instruction can correspond to operation 350 shown in Figure 8. In response to operation 350, the electronic device can perform the following steps to save the edited image.
[0363] S1911. The gallery application sends a save message to the graffiti function unit.
[0364] S1912: The graffiti function unit pops the corresponding editing information from the stack according to the operation identifier indicated by the save message, and packages it with the image information.
[0365] It is understandable that the user operation stack may include multiple operation information. Therefore, in order to accurately extract the user's editing operation content in the current image, the graffiti function unit can pop the editing information of the original image from the user operation stack based on the identifier of the original image indicated by the save message.
[0366] In addition, to support accurate storage of subsequent images, the tutu function unit can also obtain image information of the current original image. For example, the image information may include the user operation stack composed of the above user operations, as well as the storage address of the original image, image storage quality, HDR flag, and other information.
[0367] The graffiti function unit can package the above image information to facilitate subsequent module calls.
[0368] S1913: The Tuya function unit initiates a save image task to the task processing center. The save image task may carry a data packet containing packaged image information.
[0369] S1914: The task processing center pre-processes the image information and obtains the image information. For example, the task processing center may receive a task to save an image, parse the data packet carried by the task, and obtain the image information.
[0370] S1915: The task processing center initializes HDR information and obtains a brightness map of the original image.
[0371] It is understandable that in this solution, the brightness map of the stored edited image is also updated based on the brightness map of the original image. This allows the task processing center to pre-parse and obtain the brightness map data of the original image, or obtain the storage address of the brightness map data of the original image, before issuing the image save task, to facilitate subsequent quick access.
[0372] S1916: The task processing center sends a save image task to the image saving service. The save image task may include the brightness map data or data storage address of the original image initialized and obtained by the task processing center. The save image task may also include image information.
[0373] The execution of the above S1910-S1916 can refer to the solution description in Figure 14, and their specific implementation can refer to each other.
[0374] S1917. The image saving service reads the SDR image data of the original image from address B.
[0375] S1918. The image saving service loads the SDR image data of the original image to the texture D1 at address D.
[0376] S1919: The image saving service reads the graffiti information from address A.
[0377] S1920: The image saving service draws the graffiti information onto the map D1.
[0378] S1921. The memory stores the SDR image data of the edited image in the map D1 at the address D.
[0379] S1922: The image preservation service sends an HDR display request to the display algorithm unit. The HDR display request may include a type identifier for the current editing operation. For example, the type identifier may indicate that the current editing operation is a graffiti operation. In another example, the type identifier may indicate that the current editing operation includes graffiti, text editing, and the like. In other examples, if the user enters a beauty operation, the type identifier may indicate that the current editing operation is a beauty operation.
[0380] S1923: The display algorithm unit determines that the edited image requires an E-HDR display effect.
[0381] For example, the display algorithm unit may determine that the edited image requires an E-HDR display effect based on the type identification of the previous editing operation, including graffiti operation, text editing, etc.
[0382] For example, in other embodiments, when the type identifier indicates that the type of the current editing operation is brightness-related editing such as a beauty operation, the display algorithm unit may determine that the edited image does not require an E-HDR display effect.
[0383] S1924. The display algorithm unit sends the determined HDR display information to the image storage service.
[0384] In response to the determined HDR display information, the image preservation service may perform the following fusion operation on the brightness map of the original image and the edited content.
[0385] S1925. The image saving service initializes a transparent bitmap at address D to obtain the texture D2.
[0386] S1926 . The image saving service reads the graffiti information from address A and applies it to the texture D2 to obtain the corresponding mask image.
[0387] S1927. The image saving service reads the brightness map data of the original image from address B.
[0388] S1928. The image saving service determines the transparency value of each position in the edited image based on the mask image and the brightness map data of the original image.
[0389] In this example, a mask layer image is drawn on map D2. In conjunction with the above description, in other embodiments, the mask image may not need to be drawn. The image preservation service can directly calculate the transparency value of each location in the brightness map of the edited image using formula (1) based on the transparency value of each location and the transparency value of the location indicated by the edited content.
[0390] In this way, the SDR image data and brightness map data of the fused editing content can be obtained.
[0391] In some cases, the image preservation service may also perform one or more of the following operations based on the image information to implement disk storage of the SDR image data and brightness map data of the edited image.
[0392] S1929. The image saving service compresses the brightness map of the edited image into a byte array.
[0393] Exemplarily, specific parameters of the compression process (such as compression ratio) can be determined according to the image preservation quality in the image information.
[0394] S1930. The image saving service sends the byte array corresponding to the compressed brightness image to the memory.
[0395] S1931. The memory stores the byte array corresponding to the brightness map in the map D2 at address D.
[0396] S1932. The memory stores the image files and the database.
[0397] S1933: The memory writes the ehdar information to the end of the file. The ehdar information can be used to indicate the image data stored at the current location and can be used to support E-HDR display.
[0398] S1934. The memory updates the database and the special_file_expand field to facilitate accurate calling of image data during the display process.
[0399] It should be noted that in some implementations, the storage address of the edited image and the storage address of the original image can be different. For example, the image data of the edited image is stored at address D, and the image data of the original image is stored at address B. Then, after the image data of the edited image is written to the disk, the image data of the edited image and the image data of the original image can be stored separately in the memory.
[0400] In other embodiments, the storage address of the edited image may be the same as that of the original image. After acquiring the edited image, the electronic device may store the image data of the edited image over the image data of the original image. Thus, after the image data of the edited image is saved to disk, only one copy of the image data related to Image A, namely, the image data of the edited image including the edited content, is stored in the memory.
[0401] In other embodiments, the storage address of the edited image may be different from that of the original image. However, based on a user input indicating that only the edited image should be stored, the image storage service may delete the image data of the original image after the edited image data is written to disk. Thus, after the edited image data is written to disk, only one copy of the image data related to Image A, i.e., the image data of the edited image including the edited content, will be stored in the memory.
[0402] In this way, through the above solution, the edited content can be integrated into the brightness map of the edited image, thereby facilitating subsequent accurate brightness adjustment processing of the edited image by the electronic device.
[0403] For example, refer to FIG20 , which is an example of an image editing scenario.
[0404] In this example, the image before editing may be an original image C. The original image C may include a region C1 and a region C2. The transparency values of the region C1 and the region C2 are different.
[0405] For example, as shown in FIG20 , in the original image C, the transparency value of region C1 is OP1. In the original image C, the transparency value of region C2 is OP2.
[0406] A graffiti operation can be performed in region C2 of the original image C. Thus, the SDR image of the edited image obtained can be the edited image D. For example, the transparency value on the graffiti track can be a transparency value OP3. In some implementations, region C2 can also be referred to as a first region.
[0407] OP1, OP2 and OP3 are different.
[0408] Thus, Figure 21 shows a comparison of brightness adjustment processing using the fusion transparency solution provided by this application (as shown in Figure 19) and not using the solution shown in Figure 19. The solution shown in Figure 19 can be referred to as Implementation A. Correspondingly, the solution shown in Figure 19 not being used can be referred to as Implementation B.
[0409] As shown in Figure 21, in implementation B, the brightness map of edited image D is the brightness map of the original image shown in Figure 20. Based on this, when performing brightness adjustment processing, the display unit corresponding to area C1 on the display screen can be brightened by a factor of a. The display unit corresponding to area C2 on the display screen can be brightened by a factor of b. The brightening factor of the graffiti path included in area C2 can also be b.
[0410] Correspondingly, in implementation A, the brightness map of edited image D can be updated in region C2 to reflect the brightness of the fused graffiti operation. Based on this, when performing brightness adjustment, the display units corresponding to region C1 on the display screen can be brightened by a factor of a. The display units outside the graffiti path in region C2 on the display screen can be brightened by a factor of b. The brightening factor on the graffiti path in region C2 can be adjusted to a factor of c based on the updated brightness map.
[0411] It should be noted that, as shown in FIG21 , the brightness adjustment process is described using the configuration of the brightening multiple. It is understandable that, based on the same or similar brightness values, the higher the brightening multiple, the higher the brightness value after brightening.
[0412] From another perspective, the two implementations shown in FIG21 can also be described using brightness values as follows:
[0413] For example, when the original image C is displayed, the brightness value of the display unit at the position corresponding to the area C1 is d1 (or the first brightness value), and the brightness value of the display unit at the position corresponding to the area C2 is d2 (or the second brightness value).
[0414] Based on implementation method B, the brightness map of the edited image D is consistent with the brightness map of the original image C. After the brightness adjustment process, when the edited image D is displayed, the brightness value of the display unit at the corresponding position of area C1 is adjusted to d1'. The brightness value of the display unit at the corresponding position of area C2 is adjusted to d2'. In some implementations, d1' may be the same as d1. In other implementations, d1' may be different from d1. Similarly, in some implementations, d2' may be the same as d2. In other implementations, d2' may be different from d2. In the following examples, it is taken as an example that d1' and d1 are both the first brightness value, and d2' and d2 are both the second brightness value.
[0415] In this example, area C2 may also include graffiti content. In this implementation B, the brightness value of the display unit at the position corresponding to the graffiti content may be the same as the brightness values corresponding to other positions in area C2, both being d2'.
[0416] In contrast, based on implementation A, the brightness map of edited image D incorporates the graffiti content, which is located in region C2.
[0417] After the brightness adjustment process, when the edited image D is displayed, the brightness value of the display unit at the position corresponding to the area C1 is adjusted to d1', and the brightness value of the display unit at the position corresponding to the area C2 is adjusted to d2'.
[0418] Unlike implementation B, in implementation A, the brightness value of the display unit at the location corresponding to the graffiti content can be different from the brightness values at other locations in region C2. For example, the brightness value of the display unit at the location corresponding to the graffiti content can be adjusted to d3. Meanwhile, the brightness value of the display unit at other locations in region C2 other than the graffiti content can be adjusted to d2'.
[0419] For example, in implementation A, the brightness value of the display unit at the position corresponding to the graffiti content may be different from the second brightness value, for example, d3 corresponds to the third brightness value.
[0420] For ease of description, in this application, the original image may also be referred to as the first image, and the edited image may also be referred to as the second image. The SDR image of the original image is the first SDR image, and the luminance map of the original image is the first luminance map. Correspondingly, the SDR image of the edited image is the second SDR image, and the luminance map of the edited image is the second luminance map.
[0421] The first image may include a first position and a second position, and the corresponding second image may also include the first position and the second position. It is understood that the first position may be a position outside the editing path, and the second position may be any position on the editing path. For example, the first position may be any position outside the graffiti path shown in Figure 21. For another example, the second position may be any position on the graffiti path shown in Figure 21.
[0422] In this way, the brightness adjustment processing performed on the image data of the edited image obtained by the scheme shown in Figure 19 can effectively incorporate the impact of the graffiti content on the image display process into the final display control, thereby providing a more accurate E-HDR display effect.
[0423] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of each functional module. Those skilled in the art should easily appreciate that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0424] The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
[0425] For example, Figure 22 shows a schematic diagram of the components of an electronic device 2200. As shown in Figure 22, the electronic device 2200 may include a processor 2201 and a memory 2202. The memory 2202 is used to store computer-executable instructions. For example, in some embodiments, when the processor 2201 executes the instructions stored in the memory 2202, the electronic device 2200 may perform any of the methods described in the above embodiments.
[0426] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0427] Figure 23 shows a schematic diagram of the composition of a chip system 2300. The chip system 2300 may include: a processor 2301 and a communication interface 2302, which are used to support related devices to implement the functions involved in the above embodiments. In one possible design, the chip system also includes a memory for storing program instructions and data necessary for electronic devices. The chip system can be composed of chips, or it can include chips and other discrete devices. It should be noted that in some implementations of the present application, the communication interface 2302 may also be referred to as an interface circuit.
[0428] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0429] The functions, actions, operations, steps, etc. in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0430] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.
Claims
1. An image processing method, characterized in that: The method is applied to an electronic device, in which a first application is running; a first image and a second image are stored in the electronic device; the second image includes the first image and edited content added to the first image after editing; The method comprises: The electronic device displays the first image through a display screen, the brightness value of a first position on the display screen is a first brightness value; the brightness value of a second position on the display screen is a second brightness value; The electronic device displays the second image through the display screen, the brightness value of the first position is the first brightness value; the brightness value of the second position is a third brightness value; the second brightness value is different from the third brightness value; The second position on the display screen is on a path of the edited content, and the first position on the display screen is not on the path of the edited content.
2. The method according to claim 1, characterized in that The first image includes a first SDR image and a first brightness map, and the second image includes a second SDR image and a second brightness map.
3. The method according to claim 2, characterized in that The first luminance map and the second luminance map are different.
4. The method according to claim 3, characterized in that The first brightness map includes first brightness map data, and the second brightness map includes second brightness map data; The first brightness map and the second brightness map are different, including: The first brightness map data and the second brightness map data are different.
5. The method according to claim 4, characterized in that The first brightness map data includes transparency values at various positions in the first image, and the second brightness map data includes transparency values at various positions in the second image. The first brightness map data and the second brightness map data are different, including: In the first brightness map data, the transparency value of the position corresponding to the second position is the first transparency value, In the second brightness map data, the transparency value of the position corresponding to the second position is a second transparency value, The first transparency value and the second transparency value are different.
6. The method according to any one of claims 2 to 5, characterized in that: The electronic device configures the brightness value of each display unit on the display screen when displaying the target image according to the brightness map of the target image.
7. The method according to claim 6, characterized in that The target image includes the first image, The electronic device displays the first image through a display screen, including: The electronic device is configured to display the brightness value of each display unit on the display screen according to the first brightness map.
8. The method according to claim 6 or 7, characterized in that: The target image includes the second image, The electronic device displays the second image through a display screen, including: The electronic device is configured to display the brightness value of each display unit on the display screen according to the second brightness map.
9. The method according to any one of claims 6 to 8, characterized in that: The greater the transparency value indicated by the brightness map of the target image, the greater the brightness value of the corresponding position on the display screen configured by the electronic device.
10. The method according to any one of claims 2 to 9, characterized in that: The content corresponding to the second SDR image includes the content corresponding to the first SDR image, and the content corresponding to the second SDR image also includes the edited content.
11. The method according to any one of claims 2 to 10, characterized in that: After grayscale coloring is performed on the first brightness map and the second brightness map, the content corresponding to the second brightness map includes the edited content.
12. The method according to any one of claims 2 to 11, characterized in that: Before the electronic device displays the second image through the display screen, the method further includes: The electronic device receives an editing operation of a user, wherein the editing operation is used to edit the first image, and the image editing includes at least one of the following: a graffiti operation, a text editing, a trimming operation, and a rotation operation; In response to the editing operation, the electronic device edits the first image to obtain the second image.
13. The method according to claim 12, characterized in that The electronic device performs editing processing on the first image to obtain the second image, including: Create a new first texture, and draw the first SDR image on the first texture; According to the editing operation, the editing content corresponding to the editing operation is drawn on the first SDR image on the first map to obtain a second SDR image of the second image on the first map.
14. The method according to claim 13, characterized in that The electronic device edits the first image to obtain the second image, further comprising: A second brightness map of the second image is determined according to the first brightness map of the first image.
15. The method according to claim 14, characterized in that The determining a second brightness map of the second image includes: determining transparency values of the first position and the second position.
16. The method according to claim 15, characterized in that The determining the transparency value of the second position includes: determining a first transparency value of the second position according to a first brightness map of the first image; According to the editing operation, obtaining a transparency value of the editing content at the second position, The transparency value of the second position in the second image is determined according to the first transparency value and the transparency value of the edited content at the second position.
17. The method according to claim 15 or 16, characterized in that The determining the transparency value of the first position includes: determining a third transparency value of the first position according to a first brightness map of the first image; The third transparency value is determined as the transparency value of the first position in the second image.
18. The method according to claim 17, characterized in that Before determining the second brightness map of the second image, the method further includes: Determining that the second image needs to be subjected to brightness adjustment processing when being displayed to obtain an E-HDR display effect; The brightness adjustment process includes: adjusting the brightness of display units at various positions on the display screen according to a second brightness map of the second image.
19. The method according to claim 18, characterized in that The determining that the second image needs to be subjected to brightness adjustment processing when being displayed includes: The electronic device obtains the type of the editing operation, When the type of the editing operation is the first type, determining that the second image needs to be subjected to brightness map adjustment processing when being displayed; The types of editing operations include the first type and the second type, the first type indicates that the current editing operation is not related to brightness adjustment; the second type indicates that the current editing operation is a brightness-related editing operation.
20. The method according to claim 19, characterized in that The editing operation corresponding to the first type includes at least one of the following: graffiti operation, text editing, trimming operation, and rotation operation; The editing operations corresponding to the second type include at least one of the following: beauty editing and filter editing.
21. The method according to any one of claims 12 to 20, characterized in that Before editing the first image to obtain the second image, the method further includes: Put the editing information of the editing operation input by the user into the user operation total stack; The editing information includes at least one of the following: path information of the editing operation, color information of the editing operation, and text information of the editing operation.
22. The method according to claim 21, characterized in that The method further comprises: receiving a save instruction from a user, wherein the save instruction is used to instruct the electronic device to store the current edited image, In response to the saving instruction, the electronic device acquires and saves the second image.
23. The method according to claim 22, characterized in that The acquiring the second image comprises: According to the saving instruction, obtaining at least one editing information corresponding to the current editing operation from the user operation total stack; determining image information of the second image according to at least one editing information corresponding to the current editing operation; The image information of the second image includes: a first storage address of the first image, at least one editing information corresponding to the current editing operation, and image preservation quality; generating an image saving task, wherein the image saving task carries image information of the second image; The image saving task is executed, and the second image is determined according to the image information of the second image.
24. An image processing method, characterized in that: The method is applied to electronic equipment; The method comprises: The electronic device displays a first image through a display screen, the first image includes a first area, and the brightness of the first area on the display screen corresponding to a first brightness value; receiving an editing operation performed by a user on the first image, wherein the editing operation passes through the first area and corresponds to editing content; The electronic device stores a second image, wherein the second image includes the edited content; The electronic device displays the second image through the display screen, the second image includes the first area, the brightness of the area in the first area other than the edited content on the display screen is the first brightness value, and the brightness of the edited content on the display screen is the second brightness value; The first brightness value and the second brightness value are different.
25. The method according to claim 24, characterized in that Before the electronic device displays the first image through a display screen, the method further includes: The electronic device stores a first SDR image and a first brightness map of the first image.
26. The method according to claim 24 or 25, characterized in that Before the electronic device saves the second image, the method further includes: The electronic device receives a saving instruction from a user and stores a second SDR image and a second brightness map of a second image; the first brightness map and the second brightness map are different.
27. The method according to claim 26, characterized in that The first brightness map includes first brightness map data, and the second brightness map includes second brightness map data; The first brightness map and the second brightness map are different, including: The first brightness map data and the second brightness map data are different.
28. The method according to claim 27, characterized in that The first brightness map data includes transparency values at various positions in the first image, and the second brightness map data includes transparency values at various positions in the second image. The first brightness map data and the second brightness map data are different, including: In the first brightness map data, the transparency value of the position corresponding to the second position is the first transparency value, In the second brightness map data, the transparency value of the position corresponding to the second position is a second transparency value, The first transparency value and the second transparency value are different.
29. An electronic device, characterized in that: The electronic device comprises: a memory, a display screen and one or more processors; the memory, the display screen and the processor are coupled; The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1 to 23 or any one of claims 24 to 28.
30. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute a method as claimed in any one of claims 1 to 23 or any one of claims 24 to 28.
Citation Information
Patent Citations
Image processing method and electronic equipment
CN118605759A
Image processing method and electronic equipment
CN111127595A
Image processing method and electronic equipment
CN111327814A
Image processing method and device, electronic equipment and storage medium
CN114968040A
Image processing method, image processing device and electronic equipment
CN115631109A
