Data generation method, image processing method, data and electronic device

By acquiring descriptive information of graphic elements and performing independent tone mapping, the image quality problem when converting high dynamic range images to images with smaller dynamic range is solved, and the quality of graphic element regions after image conversion is improved.

WO2025251827A1PCT designated stage Publication Date: 2025-12-11HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/093183
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-07
Filing Date
2025-05-07
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

When converting high dynamic range images to smaller dynamic range images, existing technologies are prone to image quality problems such as loss of detail, reduced contrast, color distortion, overexposure or underexposure, and halo effects in areas with graphic elements.

Method used

By acquiring the descriptive information of graphic elements, target data is generated, and independent tone mapping is performed based on the descriptive information to ensure that the graphic element area uses appropriate tone mapping information, and graphic elements and other areas are processed separately.

Benefits of technology

It improves the image quality of graphic element areas after image conversion, avoiding problems such as loss of detail, reduced contrast, color distortion, overexposure or underexposure, and ensuring the overall effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025093183_11122025_PF_FP_ABST
    Figure CN2025093183_11122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a data generation method, an image processing method, data, and an electronic device. The data generation method comprises: first, acquiring a first image; then, acquiring description information of a graphic element in the first image, the description information of the graphic element being used for performing tone mapping on an area where the graphic element is located in the first image; and generating target data on the basis of the first image and the description information of the graphic element. In this way, the image quality when converting an HDR image having the graphic element into an SDR image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data generation method, image processing method, data and electronic device

[0001] The present application claims priority from the Chinese patent application No. 202410741736.8 filed on June 7, 2024, and entitled "Data generation method, image processing method, data and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of multimedia, and in particular to a data generation method, an image processing method, data and an electronic device. BACKGROUND

[0003] The prior art converts a high dynamic range (HDR) image into a target image with a smaller dynamic range in the following manner: a tone mapping curve corresponding to the HDR image is used to perform tone mapping on the HDR image to obtain the target image, which is a standard dynamic range (SDR) image or a second HDR image with a smaller dynamic range (hereinafter collectively referred to as an SDR image). Generally, the tone mapping curve corresponding to the HDR image is determined according to the image content of the HDR image, that is, for a single HDR image, the tone mapping curve corresponding to different single HDR images is different; for an HDR video, the tone mapping curve corresponding to the HDR images belonging to different scenes is different.

[0004] If the HDR image is edited, such as adding graphical elements such as watermarks, stickers, user interfaces (UIs), etc., before being converted into an SDR image, since these graphical elements are located in the SDR layer, the tone mapping curve corresponding to these graphical elements is different from the tone mapping curve corresponding to the HDR image; therefore, if the region in the HDR image where these graphical elements are located is tone mapped using the tone mapping curve corresponding to the HDR image, the region in the obtained SDR image where these graphical elements are located may have image quality problems, such as loss of details, reduction of contrast, color distortion, overexposure or underexposure, or halo effect, etc. SUMMARY

[0005] Therefore, the present application provides a data generation method, an image processing method, data and an electronic device to improve the image quality when converting an HDR image with a graphic element into an SDR image, i.e., the region where the graphic element is located in the SDR image generated by the image processing method will not have image quality problems such as loss of details, reduction of contrast, color distortion, overexposure or underexposure, halo effect, flicker, inconsistent brightness after multiple conversions, too dark brightness after conversion, and inconsistent brightness with the graphic user interface after conversion.

[0006] In a first aspect, the present application provides a data generation method, which comprises: first, obtaining a first image; then, obtaining description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping a region where the graphic element is located in the first image; and subsequently, generating target data based on the first image and the description information of the graphic element.

[0007] The target data can be used for display, transmission, distribution or storage. When subsequent processing of the first image is required, the tone mapping process of the region where the graphic element is located in the first image can be independent of that of other regions. For the region where the graphic element is located in the first image, the tone mapping information (such as a tone mapping curve) corresponding to the graphic element can be determined based on the description information of the graphic element in the target data; and then, the region where the graphic element is located in the first image is tone mapped based on the tone mapping information corresponding to the graphic element, so as to realize the processing of the first image. That is, appropriate tone mapping information is used for the region where the graphic element is located in the first image, so that the region where the graphic element is located in the processed image will not have quality problems such as loss of details, reduction of contrast, color distortion, overexposure or underexposure, halo effect, flicker, inconsistent brightness after multiple processing, too dark brightness after processing, and inconsistent brightness with the graphic user interface after processing.

[0008] Exemplarily, the graphic element can include an element such as a watermark, a logo or a sticker that can be used for identification, decoration, copyright protection or information provision; and can also include a user interface (UI) and similar elements related to user interaction.

[0009] Exemplarily, the first image can include one or more of the above-mentioned graphic elements, and each graphic element in the first image can be one or more.

[0010] Exemplarily, the first image can be an HDR image or an SDR image.

[0011] Exemplarily, the first image can be an image decoded from a bitstream, or a screenshot image obtained by screenshot, or a photo obtained by taking a picture.

[0012] Exemplarily, the description information of the graphic element in the first image can be received from other electronic devices.

[0013] Exemplarily, the description information of the graphic element in the first image can be generated based on the first image.

[0014] Exemplarily, the tone mapping of the present application can refer to a process of converting an HDR image into a target image of a smaller dynamic range (such as an SDR image or another HDR image with a smaller dynamic range than the HDR image), or a process of converting an SDR image into a target image of a larger dynamic range (such as an HDR image or another SDR image with a larger dynamic range than the SDR image).

[0015] Exemplarily, for other regions in the first image (i.e. regions other than the region where the graphic element is located), a tone mapping manner different from that of the region where the graphic element is located can be adopted for tone mapping. For example, the tone mapping of the other regions in the first image is performed by using the tone mapping information corresponding to the first image, wherein the tone mapping information corresponding to the first image is different from the tone mapping information corresponding to the graphic element. For example, the tone mapping information corresponding to the first image can be determined based on the pixel values of the pixel points in the other regions in the first image.

[0016] In a possible manner, the first image can be encoded to obtain a code stream; then, the description information of the graphic element can be written into the code stream to obtain the first target data. For example, the code stream can be encapsulated according to a video file format to obtain first intermediate data; then, the first intermediate data can be encapsulated according to a network transmission protocol to obtain the first target data.

[0017] In a possible manner, the first image can be encoded to obtain a code stream; then, the description information of the graphic element can be written into the code stream to obtain the first target data. For example, the code stream can be encapsulated according to a video file format to obtain first intermediate data; then, the first intermediate data can be encapsulated according to a network transmission protocol to obtain the first target data.

[0018] In a possible manner, the first image can be encoded to obtain a code stream; then, the description information of the graphic element can be written into the code stream to obtain the first target data. For example, the code stream can be encapsulated according to a video file format to obtain first intermediate data; then, the first intermediate data can be encapsulated according to a network transmission protocol to obtain the first target data.

[0019] Exemplarily, the first image can be one frame of image in a video sequence, and the above data generation method can be performed on images of all frames or part of frames in the video sequence to obtain a new video file (i.e. target data).

[0020] According to a first aspect, the first image is a high dynamic range, HDR, image, the first image comprises an HDR layer and a standard dynamic range, SDR, layer, the SDR layer comprises the graphic element, the HDR layer comprises a second image, the second image is an HDR image, a dynamic range of pixel values of pixels in a region where the graphic element is located is smaller than a dynamic range of pixel values of pixels in the second image.

[0021] According to the first aspect, or any one of the implementations of the first aspect, a tone mapping manner of the second image is different from a tone mapping manner of the region where the graphic element is located.

[0022] Exemplarily, the second image can be tone mapped by using tone mapping information corresponding to the second image. For example, the tone mapping information corresponding to the second image can be determined based on pixel values of pixels in the second image.

[0023] According to the first aspect, or any one of the implementations of the first aspect, the graphic element comprises at least one of a watermark, a logo, a user interface, and a sticker.

[0024] According to the first aspect, or any one of the implementations of the first aspect, the description information of the graphic element comprises at least one of category information of the graphic element, region information of the region where the graphic element is located, or tone mapping information corresponding to the graphic element.

[0025] The region where the graphic element is located can refer to a region covered by pixels included in the graphic element (for example, the region where the watermark “HUAWEI mate 60” is located can refer to a region covered by pixels included in the string “HUAWEI mate 60”), or a circumscribed rectangle of the region covered by the pixels included in the graphic element (for example, the region where the watermark “HUAWEI mate 60” is located can refer to a circumscribed rectangle of the region covered by the pixels included in the string “HUAWEI mate 60”).

[0026] Exemplarily, the category information of the graphic element can be a category indicator or a category index.

[0027] Exemplarily, the tone mapping information corresponding to the graphic element can be a tone mapping table or a tone mapping curve. According to the first aspect, or any one of the implementations of the first aspect, the region information of the region where the graphic element is located comprises at least one of a shape of the region where the graphic element is located, a size of the region where the graphic element is located, a position of the region where the graphic element is located, and pixel position mask information of the region where the graphic element is located.

[0028] The shape of the region where the graphic element is located can refer to shape description information of the region where the graphic element is located.

[0029] According to the first aspect, or any one of the implementations of the above first aspect, the generating the first target data based on the first image and the description information of the graphic element comprises: encoding the first image to obtain a code stream; and writing the description information of the graphic element into the code stream to obtain the first target data.

[0030] Exemplarily, the description information of the graphic element can be regarded as metadata, and the description information of the graphic element can be written into the code stream according to an encoding mode of the metadata.

[0031] According to the first aspect, or any one of the implementations of the above first aspect, the encoding the first image to obtain a code stream comprises: performing tone mapping on a region in which the graphic element is located in the first image based on the description information of the graphic element to obtain a third image; generating enhancement data based on the first image and the third image, the enhancement data comprising enhancement values of all pixel points in the first image; adjusting the enhancement values of the pixel points in a region in which the graphic element is located in the enhancement data to preset values to obtain adjusted enhancement data; and encoding the third image and the adjusted enhancement data to obtain the code stream. In this way, after receiving the target data, a terminal device that only supports displaying an SDR image can decode a base layer code stream to obtain an SDR image (i.e., a reconstructed image of the third image) and display. After receiving the target data, a terminal device that supports HDR display can decode a base layer code stream to obtain an SDR image (i.e., a reconstructed image of the third image), and decode an enhancement layer code stream to obtain enhancement data; based on the SDR image and the enhancement data, an HDR (i.e., a reconstructed image of the first image) image can be synthesized and displayed. Further, the compatibility of the target data can be improved.

[0032] In addition, the adjustment of the enhancement values of the pixel points in the region in which the graphic element is located in the enhancement data to preset values can make the HDR image synthesized based on the SDR image and the enhancement data closer to the HDR image before encoding (i.e., the first image).

[0033] Exemplarily, the third image can be regarded as base data, and the third image can be input into an encoder to obtain a base layer code stream (which can also be referred to as a code stream of the third image) output by the encoder; and the enhancement data can be input into the encoder to obtain an enhancement layer code stream (which can also be referred to as a code stream of the enhancement data) output by the encoder; the base layer code stream and the enhancement layer code stream can be referred to as a code stream in a double-layer structure.

[0034] In a possible manner, the first image can be directly encoded to obtain a single-layer structure code stream. Specifically, the first image can be input into an encoder to obtain a code stream of the first image output by the encoder, and the code stream of the first image is a single-layer structure code stream (it should be understood that the single-layer structure code stream is named relative to a double-layer structure code stream).

[0035] According to the first aspect or any possible implementation of the above first aspect, the region in the first image where the graphic element is located is tone-mapped based on the description information of the graphic element to obtain the third image, including: when the description information of the graphic element is the category information of the graphic element or the region information of the region where the graphic element is located, determining the tone-mapping information corresponding to the graphic element based on the description information of the graphic element; and tone-mapping the region in the first image where the graphic element is located based on the tone-mapping information corresponding to the graphic element to obtain the third image. In this case, different types of graphic elements can correspond to different tone-mapping curves.

[0036] According to the first aspect or any possible implementation of the above first aspect, the tone-mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: determining the preset tone-mapping information as the tone-mapping information corresponding to the graphic element. In this case, different types of graphic elements can correspond to the same tone-mapping curve, i.e., the preset tone-mapping curve, such as the curve corresponding to the function y = x.

[0037] According to the first aspect or any possible implementation of the above first aspect, when the description information of the graphic element is the category information of the graphic element, the tone-mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: obtaining a first mapping relationship, the first mapping relationship including a correspondence relationship between a plurality of category information and a plurality of tone-mapping information, one category information corresponding to one type of graphic element and one tone-mapping information; selecting the tone-mapping information corresponding to the category information of the graphic element from the plurality of tone-mapping information based on the first mapping relationship; and determining the tone-mapping information corresponding to the category information of the graphic element as the tone-mapping information corresponding to the graphic element. In this way, when the description information of the graphic element only includes the category information of the graphic element, the tone-mapping information corresponding to the graphic element can also be obtained. And compared with the case where the description information of the graphic element is the region information of the region where the graphic element is located, the case where the description information of the graphic element is the category information of the graphic element requires less code rate overhead.

[0038] According to the first aspect or any one of the implementations of the first aspect, when the description information of the graphical element is the region information of the region where the graphical element is located, the color mapping information corresponding to the graphical element is determined based on the description information of the graphical element, including: obtaining a second mapping relationship, the second mapping relationship including a plurality of region information and a plurality of color mapping information corresponding relationship, one color mapping information corresponds to one or more region information; based on the second mapping relationship, selecting the color mapping information corresponding to the region information of the region where the graphical element is located from the plurality of color mapping information; the color mapping information corresponding to the region information of the region where the graphical element is located is determined as the color mapping information corresponding to the graphical element. In this way, when the description information of the graphical element only includes the region information of the region where the graphical element is located, the color mapping information corresponding to the graphical element can also be obtained. And compared with the case where the description information of the graphical element is the category information or the color mapping information, when the description information of the graphical element is the region information of the region where the graphical element is located, the region where the graphical element is located can be more accurately determined subsequently, which facilitates accurate color mapping subsequently, thereby ensuring the quality of the image obtained by color mapping.

[0039] According to the first aspect or any one of the implementations of the first aspect, the description information of the graphical element in the first image is obtained based on the first image.

[0040] In this way, whether the graphical element in the first image is a watermark added when photographing, a UI intercepted when screenshot, a graphical element added based on historical editing operations, or a newly added graphical element, the description information of the graphical element can be generated based on the first image.

[0041] The historical editing operation can refer to an editing operation on the first image before the data generation process of the present application is performed. The historical editing operation can be performed by the electronic device executing the above data generation method, or can be performed by other electronic devices.

[0042] According to the first aspect or any one of the implementations of the first aspect, the method further includes: receiving an editing operation on the first image, the editing operation being used to add the graphical element to the first image. The editing operation on the first image can be received after the first image is obtained; the electronic device can add the graphical element in the first image based on the editing operation.

[0043] According to a first aspect, or any possible implementation mode of the first aspect, the method further comprises: receiving second target data, the second target data comprising the first image and the description information of the graphic element; and obtaining the first image comprises: obtaining the first image from the second target data; and obtaining the description information of the graphic element in the first image comprises: obtaining the description information of the graphic element from the second target data. That is, the description information of the graphic element can be received from other electronic devices, and the electronic device does not need to generate the description information of the graphic element by executing the above data generation method, thereby improving the efficiency of obtaining the description information of the graphic element.

[0044] According to the first aspect, or any possible implementation mode of the first aspect, the description information of the graphic element is generated based on the first image, comprising: determining the category information of the graphic element and / or the region information of the region where the graphic element is located based on the first image; determining the tone mapping information corresponding to the graphic element based on at least one of the first image, the category information of the graphic element or the region information of the region where the graphic element is located; and generating the description information of the graphic element according to at least one of the category information of the graphic element, the region information of the region where the graphic element is located or the tone mapping information corresponding to the graphic element.

[0045] According to the first aspect, or any possible implementation mode of the first aspect, the category information of the graphic element and / or the region information of the region where the graphic element is located is determined based on the first image, comprising: identifying a first region in the first image, the pixel value of the pixel point in the first region satisfying a preset condition; and determining the category information of the graphic element and / or the region information of the region where the graphic element is located based on at least one of the size of the first region, the shape of the first region, the position of the first region or the pixel value of the pixel point in the first region, the pixel position identification mask information of the region where the first region is located.

[0046] According to the first aspect, or any possible implementation mode of the first aspect, the category information of the graphic element and / or the region information of the region where the graphic element is located is determined based on the first image, comprising: performing similarity comparison between the first image and a plurality of reference images, one reference image corresponding to one preset graphic element; when there is a second region in the first image with a similarity greater than a similarity threshold to a first reference image, then the category information of the preset graphic element corresponding to the first reference image is determined as the category information of the graphic element, and / or the region information of the second region is determined as the region information of the region where the graphic element is located, the first reference image being any one of the plurality of reference images.

[0047] According to a first aspect, or any possible implementation mode of the first aspect, the category information of the graphic element and / or the region information of the region where the graphic element is located are determined based on the first image, including: determining the category information of the graphic element and / or the region information of the region where the graphic element is located based on an editing operation for the first image. The editing operation can be a current editing operation or a historical editing operation.

[0048] According to a second aspect, the present application provides an image processing method, including: first, obtaining a first image and obtaining description information of a graphic element in the first image; then, based on the description information of the graphic element, determining a region where the graphic element is located in the first image and color tone mapping information corresponding to the graphic element; and then, based on the color tone mapping information corresponding to the graphic element, performing color tone mapping on the region where the graphic element is located in the first image to obtain a second image.

[0049] Wherein, the description information of the graphic element in the first image can be obtained from the received target data, and then the color tone mapping process of the region where the graphic element is located in the first image can be independent of other regions. For the region where the graphic element is located in the first image, the color tone mapping information (such as color tone mapping curve) corresponding to the graphic element can be determined based on the description information of the graphic element in the target data; and then, based on the color tone mapping information corresponding to the graphic element, the color tone mapping is performed on the region where the graphic element is located in the first image to realize the processing of the first image. That is, the color tone mapping information suitable and different from other regions in the first image is used for the region where the graphic element is located in the first image, so that the quality problems such as loss of details, reduction of contrast, color distortion, overexposure or underexposure, halo effect, inconsistency of brightness after multiple processing, too dark after processing, or incoordination of brightness after processing and graphic user interface brightness, etc. can be avoided in the region where the graphic element is located in the processed image.

[0050] Exemplarily, the image processing described above can be image conversion.

[0051] Exemplarily, the first image can be an HDR image or an SDR image.

[0052] Exemplarily, the first image can be an image obtained by decoding a code stream, or a screenshot image obtained by screenshot, or a photo obtained by taking a photo.

[0053] Exemplarily, the description information of the graphic element in the first image can be received from other electronic devices.

[0054] Exemplarily, the description information of the graphic element in the first image can be generated based on the first image.

[0055] Exemplarily, the tone mapping of the present application can refer to a process of converting an HDR image into a target image of a smaller dynamic range (such as an SDR image or another HDR image with a smaller dynamic range than the HDR image), or a process of converting an SDR image into a target image of a larger dynamic range (such as an HDR image or another SDR image with a larger dynamic range than the SDR image).

[0056] In one possible manner, the region in the first image where the graphic element is located can be tone mapped by using the tone mapping information corresponding to the graphic element, and the other regions in the first image can be tone mapped by using the tone mapping information corresponding to the first image, to obtain the target image. The tone mapping information corresponding to the graphic element is different from the tone mapping information corresponding to the first image, and it can also be understood that the tone mapping manner of the region in the first image where the graphic element is located is different from the tone mapping manner of the other regions in the first image.

[0057] Exemplarily, the pixel values of all the pixel points in the region in the first image where the graphic element is located can be tone mapped by using the tone mapping information corresponding to the graphic element, to obtain first pixel values of all the pixel points in the region where the graphic element is located. In one possible manner, the first pixel values of all the pixel points in the region where the graphic element is located can be taken as the pixel values of all the pixel points in the region where the graphic element is located in the target image. In one possible manner, the pixel values of all the pixel points in the region where the graphic element is located in the first image can also be tone mapped by using the tone mapping information corresponding to the first image, to obtain second pixel values of all the pixel points in the region where the graphic element is located. Then, the first pixel values and the second pixel values of all the pixel points in the region where the graphic element is located in the first image can be weighted to obtain the pixel values of all the pixel points in the region where the graphic element is located in the target image. The second manner can make the region where the graphic element is located in the second image more smoothly connected with the other regions. The tone mapping information corresponding to the first image can be received from other electronic devices, or can be generated based on the pixel values of the pixel points in the other regions in the first image. In one possible manner, the region in the first image where the graphic element is located can be tone mapped by using the tone mapping information corresponding to the graphic element, and the other regions in the first image can not be tone mapped, to obtain the target image. That is, the region where the graphic element is located in the target image is obtained by tone mapping the region where the graphic element is located in the first image, and the other regions in the target image are the same as the other regions in the first image.

[0058] According to a second aspect, the first image is a high dynamic range (HDR) image, the first image comprises an HDR layer and a standard dynamic range (SDR) layer, the SDR layer comprises the graphic element, and the HDR layer comprises a second image, the second image is an HDR image, and a dynamic range of pixel values of pixels in a region where the graphic element is located is smaller than a dynamic range of pixel values of pixels in the second image.

[0059] According to the second aspect or any possible implementation manner of the second aspect, the mapping the region where the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element to obtain the target image comprises: mapping the SDR layer based on first tone mapping information corresponding to the graphic element, and mapping the HDR layer based on second tone mapping information corresponding to the second image to obtain the target image, the first tone mapping information being different from the second tone mapping information.

[0060] That is, the SDR layer and the HDR layer of the first image are respectively mapped, that is, the mapping is performed on the layers respectively. In this way, the transition at the connection between the region where the graphic element is located and other regions in the target image can be smoother.

[0061] According to the second aspect or any possible implementation manner of the second aspect, the first tone mapping information is tone mapping information corresponding to the SDR layer; or the first tone mapping information is generated based on the second tone mapping information and third tone mapping information, the third tone mapping information being tone mapping information corresponding to the SDR layer.

[0062] Exemplarily, the tone mapping information corresponding to the SDR layer can be the tone mapping information corresponding to the graphic element.

[0063] According to the second aspect or any possible implementation manner of the second aspect, the obtaining the first image and the description information of the graphic element in the first image comprises: receiving target data, the target data comprising the first image and the description information of the graphic element in the first image; and obtaining the first image and the description information of the graphic element in the first image from the target data.

[0064] According to the second aspect or any possible implementation manner of the second aspect, the description information of the graphic element comprises at least one of the following: category information of the graphic element, region information of the region where the graphic element is located, or tone mapping information corresponding to the graphic element.

[0065] According to a second aspect, or any possible implementation mode of the second aspect, when the description information of the graphic element is the category information of the graphic element, the color mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: obtaining a first mapping relationship, the first mapping relationship including a corresponding relationship between a plurality of category information and a plurality of color mapping information, one category information corresponding to one graphic element and one color mapping information; based on the first mapping relationship, selecting the color mapping information corresponding to the category information of the graphic element from the plurality of color mapping information; and determining the color mapping information corresponding to the category information of the graphic element as the color mapping information corresponding to the graphic element.

[0066] According to the second aspect, or any possible implementation mode of the second aspect, when the description information of the graphic element is the region information of the region where the graphic element is located, the color mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: obtaining a second mapping relationship, the second mapping relationship including a corresponding relationship between a plurality of region information and a plurality of color mapping information, one color mapping information corresponding to one or more region information; based on the second mapping relationship, selecting the color mapping information corresponding to the region information of the region where the graphic element is located from the plurality of color mapping information; and determining the color mapping information corresponding to the region information of the region where the graphic element is located as the color mapping information corresponding to the graphic element.

[0067] According to the second aspect, or any possible implementation mode of the second aspect, when the description information of the graphic element is the category information of the graphic element, the region where the graphic element is located in the first image is determined based on the description information of the graphic element, including: obtaining a third mapping relationship, the third mapping relationship including a corresponding relationship between a plurality of category information and a plurality of region information, one category information corresponding to one graphic element, the one category information corresponding to one or more region information; based on the third mapping relationship, selecting the region information corresponding to the category information of the graphic element from the plurality of region information; and based on the region information corresponding to the category information of the graphic element, determining the region where the graphic element is located in the first image.

[0068] According to a second aspect, or any possible implementation mode of the second aspect, when the description information of the graphic element is the tone mapping information corresponding to the graphic element, the region in the first image where the graphic element is located is determined based on the description information of the graphic element, including: obtaining a fourth mapping relationship, the fourth mapping relationship including a corresponding relationship between a plurality of tone mapping information and a plurality of region information, one tone mapping information corresponding to one or more region information; based on the fourth mapping information, selecting the region information corresponding to the tone mapping information corresponding to the graphic element from the plurality of region information; based on the region information corresponding to the tone mapping information corresponding to the graphic element, determining the region in the first image where the graphic element is located.

[0069] The second aspect and any possible implementation mode of the second aspect correspond to the first aspect and any possible implementation mode of the first aspect respectively. The technical effects of the second aspect and any possible implementation mode of the second aspect can refer to the technical effects of the first aspect and any possible implementation mode of the first aspect, which will not be described here.

[0070] In a third aspect, the present application provides data, the data including a first image and description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping a region in the first image where the graphic element is located.

[0071] According to the third aspect, the data includes a code stream, the code stream including encoded data of the first image and encoded data of the description information of the graphic element.

[0072] According to the third aspect, the data includes a code stream, the code stream including encoded data of the first image.

[0073] Exemplarily, the code stream can be a code stream of a double-layer structure or a code stream of a single-layer structure. If the code stream is a code stream of a double-layer structure including a base layer code stream and an enhancement layer code stream, the encoded data of the base data contained in the base layer code stream and the encoded data of the enhancement data contained in the enhancement layer code stream can be referred to as the encoded data of the first image.

[0074] In a fourth aspect, the present application provides a data generation apparatus, which can include:

[0075] An image acquisition module, configured to acquire a first image;

[0076] A description information acquisition module, configured to acquire description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping a region in the first image where the graphic element is located;

[0077] A data generation module, configured to generate first target data based on the first image and the description information of the graphic element.

[0078] Exemplarily, the data generation apparatus can be used to execute the method in the first aspect or any possible implementation manner of the first aspect.

[0079] In a fifth aspect, the present application provides an image processing apparatus, which can comprise:

[0080] an acquisition module configured to acquire a first image and description information of a graphic element in the first image;

[0081] an information determination module configured to determine, based on the description information of the graphic element, a region in which the graphic element is located in the first image and tone mapping information corresponding to the graphic element;

[0082] a tone mapping module configured to perform tone mapping on the region in which the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element, to obtain a target image.

[0083] Exemplarily, the image processing apparatus can be used to execute the method in the second aspect or any possible implementation manner of the second aspect.

[0084] In a sixth aspect, the present application provides an electronic device, which comprises a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the method in the first aspect or any possible implementation manner of the first aspect, or executes the method in the second aspect or any possible implementation manner of the second aspect.

[0085] In a seventh aspect, the present application provides a chip, which comprises one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits; when the one or more processors execute computer instructions, the chip executes the method in the first aspect or any possible implementation manner of the first aspect, or executes the method in the second aspect or any possible implementation manner of the second aspect.

[0086] In an eighth aspect, the present application provides a computer readable storage medium, which stores computer programs; when the computer programs run on a computer or a processor, the computer or the processor executes the method in the first aspect or any possible implementation manner of the first aspect, or executes the method in the second aspect or any possible implementation manner of the second aspect.

[0087] In a ninth aspect, the present application provides a computer program product, which comprises computer instructions, when the computer instructions are executed by a computer or a processor, causing the computer or the processor to execute the method in the first aspect or any possible implementation manner of the first aspect, or execute the method in the second aspect or any possible implementation manner of the second aspect.

[0088] In a tenth aspect, the present application provides a computer readable storage medium, which stores data, the data comprising a first image and description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping a region in the first image where the graphic element is located.

[0089] In an eleventh aspect, the present application provides a device for storing data, the device comprising: a receiver configured to receive data; and at least one storage medium configured to store the data, the data being the data in the third aspect or any possible implementation manner of the third aspect.

[0090] In a twelfth aspect, the present application provides a device for transmitting data, the device comprising: a transmitter and at least one storage medium, the at least one storage medium being configured to store the data, the data being the data in the third aspect or any possible implementation manner of the third aspect; and the transmitter being configured to obtain the data from the storage medium and transmit the data to an end-side device via a transmission medium.

[0091] In a thirteenth aspect, the present application provides a system for distributing data, the system comprising: at least one storage medium configured to store at least one data, the at least one data being the data in the third aspect or any possible implementation manner of the third aspect; and a streaming media device configured to obtain target data from the at least one storage medium and transmit the target data to an end-side device, wherein the streaming media device comprises a content server or a content distribution server.

[0092] In a fourteenth aspect, the present application provides a system for displaying, the system comprising: at least one storage medium configured to store at least one target data, the at least one target data being generated according to the first aspect or any possible implementation manner of the first aspect; and a display device configured to obtain the target data from the at least one storage medium and decode and display the target data.

[0093] In the embodiments of the present application, the electronic device, the computer readable storage medium, the computer program product, the chip or codec, the system and the like are used to execute the corresponding method provided in the above, and thus the beneficial effects achieved by the electronic device, the computer readable storage medium, the computer program product, the chip or codec, the system and the like can refer to the beneficial effects of the corresponding method provided in the above. BRIEF DESCRIPTION OF DRAWINGS

[0094] FIG. 1A is a schematic diagram of an application scenario according to an embodiment of the present application;

[0095] FIG. 1B is a schematic diagram of another application scenario according to an embodiment of the present application;

[0096] FIG. 1C is a schematic diagram of yet another application scenario according to an embodiment of the present application;

[0097] FIG. 1D is a schematic diagram of yet another application scenario according to an embodiment of the present application;

[0098] FIG. 1E is a schematic diagram of yet another application scenario according to an embodiment of the present application;

[0099] FIG. 1F is a block diagram of a system 100 according to an embodiment of the present application;

[0100] FIG. 2 is a schematic diagram of a data generation process 200 according to an embodiment of the present application;

[0101] FIG. 3A is a schematic diagram of another data generation process 300 according to an embodiment of the present application;

[0102] FIG. 3B is a schematic diagram of yet another data generation process according to an embodiment of the present application;

[0103] FIG. 3C is a schematic diagram of yet another data generation process according to an embodiment of the present application;

[0104] FIG. 4A is a schematic diagram of yet another data generation process 400 according to an embodiment of the present application;

[0105] FIG. 4B is a schematic diagram of yet another data generation process according to an embodiment of the present application;

[0106] FIG. 4C is a schematic diagram of yet another data generation process according to an embodiment of the present application;

[0107] FIG. 5A is a schematic diagram of yet another data generation process 500 according to an embodiment of the present application;

[0108] FIG. 5B is a schematic diagram of yet another data generation process according to an embodiment of the present application;

[0109] FIG. 6 is a schematic diagram of an image processing process 600 according to an embodiment of the present application;

[0110] FIG. 7 is a schematic diagram of another image processing process 700 according to an embodiment of the present application;

[0111] FIG. 8 is a schematic diagram of a data generation apparatus 800 according to an embodiment of the present application;

[0112] FIG. 9 is a schematic diagram of an image processing apparatus 900 according to an embodiment of the present application;

[0113] FIG. 10 is a schematic diagram of a structure of an apparatus according to an embodiment of the present application. DETAILED DESCRIPTION

[0114] The technical solutions in the embodiments of the present application will be clearly and completely described in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0115] The term "and / or" in the present application is only used to describe the association relationship of the associated objects, and can represent three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone.

[0116] The terms "first" and "second" and the like in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe a specific order of the target objects.

[0117] In the embodiments of the present application, the words such as "exemplarily" or "for example" are used to represent as an example, illustration or description. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words such as "exemplarily" or "for example" are intended to present the relevant concept in a specific manner.

[0118] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.

[0119] In the embodiments of the present application, the modules / components shown in the frame diagram (or structure diagram or system diagram) are only one example of the present application, and the actual frame (or structure or system) can include more or less modules / components than those shown in the diagram, or can have a different configuration of components. In addition, the various components / modules shown in the diagram can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0120] FIG. 1A is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario shown in FIG. 1A is an image editing scenario, specifically, editing an image in an image editing interface 101.

[0121] The image editing interface 101 in FIG. 1A can include, but is not limited to, the following elements: a cropping option, a sticker option 102, a filter option, a watermark option, a finish option 103, and the like. The user can edit the HDR image, for example, by clicking the sticker option 102 to add a sticker 104 in the HDR image. After the user finishes editing the HDR image, the finish option 103 can be clicked, and the mobile phone can generate target data by using the data generation method provided in the present application in response to the operation behavior of the user. The target data can include the HDR image after adding the sticker and description information of the sticker, and the description information of the sticker can be used to perform tone mapping on the region corresponding to the sticker in the HDR image. Subsequently, when the HDR image after adding the sticker needs to be sent to other electronic devices, the target data can be sent; in this way, when the other electronic devices have a demand to convert the HDR image after adding the sticker into an SDR image, the description information of the sticker obtained from the target data can be used to perform tone mapping on the region corresponding to the sticker in the HDR image after adding the sticker, which is different from the tone mapping on other regions in the HDR image, so as to obtain the SDR image.

[0122] FIG. 1B is a schematic diagram of another application scenario of an embodiment of the present application. The application scenario shown in FIG. 1B is a photographing scenario.

[0123] The photographing interface 105 in FIG. 1B(1) can include, but is not limited to, the following elements: a photographing frame, a photographing option 106, an image preview interface, and the like. The user clicks the photographing option 106, and the mobile phone can perform photographing in response to the operation behavior of the user, save the photo to the album, and display the thumbnail of the photo in the image preview interface 107, as shown in FIG. 1B(2). Exemplarily, some mobile phones add a watermark (such as a mobile phone model) in the photo after photographing, to obtain a photo with a watermark, wherein the watermark is shown as 108 in FIG. 1B(2).

[0124] Exemplarily, the mobile phone can generate target data by using the data generation method of the present application after obtaining the photo with the watermark. The target data can include the photo (HDR image) after adding the watermark and description information of the watermark, and the description information of the watermark can be used to perform tone mapping on the region corresponding to the watermark in the photo after adding the watermark. Subsequently, when the photo after adding the watermark needs to be sent to other electronic devices, the target data can be sent; in this way, when the other electronic devices have a demand to convert the photo after adding the watermark into an SDR image, the description information of the watermark obtained from the target data can be used to perform tone mapping on the region corresponding to the watermark in the photo after adding the watermark, which is different from the tone mapping on other regions in the HDR image, so as to obtain the SDR image.

[0125] FIG. 1C is a schematic diagram of still another application scenario of an embodiment of the present application. The application scenario shown in FIG. 1C is a screenshot scenario.

[0126] The video playing interface 109 in FIG. 1C can include, but is not limited to, a video picture, UI elements (such as a pause / play button, a progress bar, a next episode button, a previous episode button, a fast forward button, a fast backward button, and the like), and the like. During the process of video playing, the user can perform a screenshot operation, at which time the mobile phone can perform the screenshot in response to the operation behavior of the user to obtain a screenshot image 110; wherein the screenshot image 110 includes a UI element 111. After obtaining the screenshot image 110, the mobile phone can generate target data by using the data generation method provided in the present application. In this case, the target data can include the screenshot image 110 (an HDR image) and description information of the UI element 111, and the description information of the UI element can be used for tone mapping the region corresponding to the UI element 111 in the screenshot image 110. Subsequently, when it is necessary to send the screenshot image 110 to other electronic devices, the target data can be sent; in this way, when there is a need to convert the screenshot image 110 into an SDR image in the other electronic devices, the description information of the UI element obtained from the target data can be used to perform tone mapping on the region corresponding to the UI element in the screenshot image 110, which is different from the tone mapping on other regions in the HDR image, so as to obtain the SDR image.

[0127] FIG. 1D is a schematic diagram of another application scenario of an embodiment of the present application. The application scenario shown in FIG. 1D is an image forwarding scenario.

[0128] The image preview interface 112 in FIG. 1D can include, but is not limited to, a photo 113, a sharing option 114, a collection option, an editing option, a deletion option, and the like. When the user desires to share the photo 113, the sharing option 114 can be clicked; at this time, the mobile phone can generate target data by using the data generation method provided in the present application in response to the operation behavior of the user, and send the target data to other electronic devices. The target data in this case is similar to the target data in FIG. 1B, and a watermark (such as a mobile phone model) is added in the photo to obtain a photo with a watermark, which will not be described herein again. In this way, when there is a need to convert the photo 113 into an SDR image in the other electronic devices, the description information of the watermark obtained from the target data can be used to perform tone mapping on the region corresponding to the watermark in the photo 113, so as to obtain the SDR image.

[0129] FIG. 1E is a schematic diagram of another application scenario of an embodiment of the present application. The application scenario shown in FIG. 1E is an image processing scenario. For example, the image processing scenario can be an image conversion scenario. The image conversion can refer to converting an image from one format to another format; for example, converting an HDR image into an SDR image.

[0130] Exemplarily, the personal computer 11 sends target data (the target data includes a code stream directly encoded from an HDR image and description information of a graphic element) to a plurality of terminal devices, such as the mobile phone 13, the VR / AR glasses 14, the personal computer 15, the tablet computer 16, and the like, through a cloud server.

[0131] In a possible manner, for a terminal device (such as the mobile phone 13 or the tablet computer 16) that only supports displaying an SDR image, the image processing method provided in this application can be performed, that is, the description information of the graphic element and the HDR image are obtained from the target data; then, the region in which the graphic element is located in the HDR image is tone-mapped based on the description information of the graphic element, and other regions in the HDR image are tone-mapped based on the tone-mapping information corresponding to the HDR image, to obtain an SDR image and display the SDR image.

[0132] In a possible manner, for a terminal device (such as the AR / VR glasses 14 or the personal computer 15) that supports displaying an HDR image and simultaneously displaying an SDR image, the image processing method provided in this application can also be performed, that is, the description information of the graphic element and the HDR image are obtained from the target data; then, the region in which the graphic element is located in the HDR image is tone-mapped based on the description information of the graphic element, and other regions in the HDR image are not tone-mapped (that is, the other regions in the HDR image are not converted into an SDR image), to obtain a target image and display the target image. In this case, the region in which the graphic element is located in the target image is an SDR image, and the other regions are HDR images.

[0133] It should be understood that the present application can also include other application scenarios, for example, a scenario in which a third-party platform adds a platform logo in a video or an image (in this scenario, target data (including the video or the image after adding the platform logo and the description information of the platform logo) can also be generated), and the present application does not limit this.

[0134] It should be understood that the application scenarios described above are illustrated by taking images as examples, and the present application can also include application scenarios for videos, for example, a video editing scenario, a video recording scenario, a screen recording scenario, a video forwarding scenario, a video processing scenario, and the like.

[0135] FIG. 1F is a block diagram of a system 100 according to an embodiment of the present application.

[0136] The system 100 in FIG. 1F can include: a terminal device 11, a terminal device 12, …, a terminal device 1N, a server, a terminal device 21, a terminal device 22, …, a terminal device 2M. Wherein, N and M are both positive integers.

[0137] In a possible manner, the data generation method of the present application can be performed by any one of the terminal device 11, the terminal device 12, …, the terminal device 1N to generate target data, and then the target data is sent to the server, and the target data is distributed to one or more of the terminal device 21, the terminal device 22, …, the terminal device 2M by the server.

[0138] It should be understood that after any one of the terminal device 11, the terminal device 12, …, the terminal device 1N performs the data generation method of the present application to generate target data, the target data can be directly sent to one or more of the terminal device 21, the terminal device 22, …, the terminal device 2M by Bluetooth, Huawei Share, etc.

[0139] In a possible manner, the first image can be sent to the server by any one of the terminal device 11, the terminal device 12, …, the terminal device 1N, and the data generation method of the present application is performed by the server to generate target data (including the first image); then the target data is distributed to one or more of the terminal device 21, the terminal device 22, …, the terminal device 2M by the server.

[0140] Exemplarily, after any one of the terminal device 21, the terminal device 22, …, the terminal device 2M receives the target data, the image processing method of the present application can be performed to obtain a target image; then the target image can be displayed.

[0141] Exemplarily, the server can include but is not limited to a cloud server, a physical (independent) server, a station cluster server, etc., which is not limited in the present application.

[0142] Exemplarily, the terminal device can include but is not limited to a personal computer, a computer workstation, a smart phone, a tablet computer, a smart camera, a smart car or other types of cellular phones, a media consumption device, a wearable device, a set-top box, a game console, etc.

[0143] The data generation method and the image processing method of the present application are respectively illustrated below by taking an image as an example.

[0144] FIG. 2 is a schematic diagram of a data generation process 200 according to an embodiment of the present application. The data generation process 200 can be performed by any one of the terminal device 11, the terminal device 12, …, the terminal device 1N in FIG. 1F, or can be performed by the server in FIG. 1F.

[0145] S201, a first image is obtained.

[0146] Exemplarily, the first image can be an image obtained by decoding a bitstream (which can also be referred to as a coded bitstream or a coded stream), or a screenshot image obtained by taking a screenshot, or a photo obtained by taking a photo.

[0147] The present application does not limit whether the first image is an HDR image or an SDR image.

[0148] In S202, description information of a graphical element in the first image is obtained, and the description information of the graphical element is used for tone mapping a region in which the graphical element is located in the first image.

[0149] Exemplarily, the graphical element can include an element for identification, decoration, copyright protection or information provision; for example, a watermark, a logo, a sticker, etc.

[0150] A watermark can refer to a semi-transparent mark created on an image or video, usually used to prove ownership, prevent copying or as a copyright declaration.

[0151] A logo is a visual identifier of a company, brand, organization or product. It is usually composed of text, graphics or a combination of the two, aiming to convey specific information and establish brand recognition.

[0152] A sticker refers to a visual element (such as text, graphics, etc.) added to an image or video during video or image editing.

[0153] Exemplarily, the graphical element can also include a user interface (UI) and similar UI elements related to user interaction.

[0154] UI elements refer to graphical components and controls used to interact with users in software, applications, websites or other interactive systems; for example, progress bars, fast-forward buttons, rewind buttons, search boxes, notification bars, etc.

[0155] Exemplarily, the first image can include one or more of the above-mentioned graphical elements, and there can be one or more of each type of graphical element in the first image.

[0156] Exemplarily, the tone mapping of the present application can refer to the process of converting an HDR image into a target image with a smaller dynamic range (such as an SDR image or another HDR image with a smaller dynamic range than the HDR image), or the process of converting an SDR image into a target image with a larger dynamic range (such as an HDR image or another SDR image with a larger dynamic range than the SDR image).

[0157] Exemplarily, the description information of the graphic element includes at least one of the following: category information of the graphic element, region information of a region where the graphic element is located, or tone mapping information corresponding to the graphic element.

[0158] For other regions in the first image (i.e., regions other than the region where the graphic element is located), a different tone mapping manner from that of the region where the graphic element is located can be used for tone mapping. For example, the tone mapping information corresponding to the first image is used to perform tone mapping on the other regions in the first image; wherein the tone mapping information corresponding to the first image is different from the tone mapping information corresponding to the graphic element. For example, the tone mapping information corresponding to the first image can be determined based on the pixel values of the pixel points in the other regions in the first image.

[0159] S203, generating first target data based on the first image and the description information of the graphic element.

[0160] In a possible manner, the first image can be encoded to obtain a code stream; then, the description information of the graphic element can be written into the code stream to obtain the first target data. For example, the code stream can be encapsulated according to a video file format to obtain first intermediate data; then, the first intermediate data can be encapsulated according to a network transmission protocol to obtain the first target data.

[0161] In a possible manner, the first image can be encoded to obtain a code stream; then, the code stream and the description information of the graphic element can be encapsulated according to a video file format to obtain second intermediate data; and then, the second intermediate data can be encapsulated according to a network transmission protocol to obtain the first target data.

[0162] In a possible manner, the first image can be encoded to obtain a code stream; then, the code stream can be encapsulated according to a video file format to obtain third intermediate data; and then, the third intermediate data and the description information of the graphic element can be encapsulated according to a network transmission protocol to obtain the first target data.

[0163] The first target data generated in S203 can be used for display, transmission, distribution or storage, so that when the first image needs to be processed later, the tone mapping process of the region where the graphical element is located in the first image can be independent of other regions. For the region where the graphical element is located in the first image, the tone mapping information (such as a tone mapping curve) corresponding to the graphical element can be determined based on the description information of the graphical element in the target data. Then, the region where the graphical element is located in the first image is tone mapped based on the tone mapping information corresponding to the graphical element, so as to realize the processing of the first image. That is, appropriate tone mapping information is used for the region where the graphical element is located in the first image, so that the region where the graphical element is located in the processed image can not have quality problems such as loss of details, reduction of contrast, color distortion, overexposure or underexposure, halo effect, flicker, inconsistent brightness after multiple processing, too dark brightness after processing, or incoordination between the brightness after processing and the brightness of the graphical user interface.

[0164] Exemplarily, the first image can be an HDR image, the first image can include an HDR layer and an SDR layer, the SDR layer can include the graphical element, and the HDR layer can include a second image, the second image being an HDR image, and the dynamic range of pixel values of the pixel points in the region where the graphical element is located is smaller than the dynamic range of pixel values of the pixel points in the second image. The following is described by taking the first image as an HDR image as an example.

[0165] FIG. 3A is a schematic diagram of another data generation process 300 according to an embodiment of the present application. The data generation process 300 describes a process of obtaining the description information of the graphical element in the first image based on the data generation process 200 described above, in a case where the first image obtained contains the graphical element but the description information of the graphical element is not received from other electronic devices. The data generation process 300 can be performed by any one of the terminal devices 11, 12,..., 1N in FIG. 1F described above, or can be performed by the server in FIG. 1F described above.

[0166] S301, obtaining a first image.

[0167] Exemplarily, the first image obtained in S301 is an HDR image.

[0168] S302, generating description information of a graphical element based on the first image.

[0169] Exemplarily, it can be determined whether the first image contains the graphical element first, and then the description information of the graphical element is generated when it is determined that the first image contains the graphical element.

[0170] Exemplarily, the graphical element in the first image can be a watermark added when taking a photo, or a UI intercepted when taking a screenshot, or a graphical element added based on a historical editing operation. The historical editing operation can refer to an editing operation on the first image before the data generation process of the present application is performed. The historical editing operation can be performed by the electronic device performing the data generation process described above, or can be performed by another electronic device. The following describes an example of generating a description information of a graphical element.

[0171] Exemplarily, one way of determining whether the first image contains a graphical element can be as follows:

[0172] First, a first region in the first image that meets a preset condition can be identified. In one possible way, the preset condition can be that all pixel points in the region have the same brightness value. In one possible way, the preset condition can be that the difference between the maximum brightness value and the minimum brightness value in the region is less than a difference threshold value. The difference threshold value can be set as required.

[0173] Next, whether the first image contains a graphical element can be determined based on at least one of the size of the first region, the shape of the first region, the position of the first region, or the pixel value of the pixel points in the first region.

[0174] In one possible way, whether the first image contains a graphical element is determined based on the size of the first region. For example, it can be determined whether the size of the first region is equal to a preset size; when the size of the first region is equal to the preset size, it can be determined that the first image contains a graphical element. Exemplarily, the preset size can be set according to the size of a preset graphical element (the graphical element contained in the first image can be one or more preset graphical elements); the preset graphical element can include at least one of a watermark, a logo, a UI, a sticker, and each preset graphical element can be one or more. For example, the preset graphical element can include a watermark of a mobile phone model A, a watermark of a mobile phone model B, a logo of a television station A, a logo of a television station B, a search box, a smiley sticker, etc. For example, the preset size can be set according to the size of the logo, such as the size of the logo of the television station A being 12*15, and the preset size can be set to 12*15. For another example, the preset size can be set according to the size of the UI, such as the size of the progress bar being 5*70, and the preset size can be set to 5*70.

[0175] In a possible implementation, it is determined whether the first image contains the graphic element based on a shape of the first region. For example, it is determined whether the shape of the first region is a preset shape; and when the shape of the first region is the preset shape, it is determined that the first image contains the graphic element. For example, the preset shape can be set according to the shape of the preset graphic element. For example, the preset shape is set according to the shape of the logo; for example, if the logo of the television station B is a triangle, the preset shape can be set as a triangle. For another example, the preset shape is set according to the shape of the UI; for example, the shape of the search box is a rectangle, and the preset shape can be set as a rectangle.

[0176] In a possible implementation, it is determined whether the first image contains the graphic element based on a position of the first region. For example, it is determined whether the position of the first region is a preset position; and when the position of the first region is the preset position, it is determined that the first image contains the graphic element. For example, the preset position can be set according to a position where the preset graphic element appears more frequently in the image. For example, the logo of the television station usually appears in the upper left corner of the image, and therefore the upper left corner can be set as a preset position. For another example, the watermark of the mobile phone model usually appears in the lower right corner of the image, and therefore the lower right corner can be set as a preset position.

[0177] In a possible implementation, it is determined whether the first image contains the graphic element based on a pixel value of a pixel point in the first region. For example, it is determined whether the brightness of the pixel point in the first region satisfies a brightness condition; and when the brightness of the pixel point in the first region satisfies the brightness condition, it is determined that the first image contains the graphic element.

[0178] For example, the brightness condition is that the average brightness (or the maximum brightness value or the minimum brightness value) of all pixel points in the first region is greater than a first brightness threshold (the first brightness threshold can be a linear value (a value of a Y component) or a nonlinear value (for example, a value between 0 and 1)).

[0179] For example, the brightness condition is that the average brightness (or the maximum brightness value or the minimum brightness value) of all pixel points in the first region is equal to a second brightness threshold (the second brightness threshold can be a linear value (a value of a Y component) or a nonlinear value (for example, a value between 0 and 1)). The second brightness threshold can be a system reference white.

[0180] For example, the brightness condition is that the average brightness (or the maximum brightness value or the minimum brightness value) of all pixel points in the first region is less than a third brightness threshold (the third brightness threshold can be a linear value (a value of a Y component) or a nonlinear value (for example, a value between 0 and 1)).

[0181] The first luminance threshold is greater than the second luminance threshold, and the second luminance threshold is greater than the third luminance threshold. It should be understood that other luminance conditions can also be included, which are not limited in the present application.

[0182] It should be understood that at least two of the above-mentioned manners can also be combined to determine whether the first image contains the graphic element.

[0183] Exemplarily, one manner of determining whether the first image contains the graphic element can be as follows: performing similarity comparison between the first image and a plurality of reference images, one reference image corresponding to one preset graphic element; when there is a second region in the first image with a similarity greater than a similarity threshold to the first reference image, it can be determined that the first image contains the graphic element.

[0184] Exemplarily, for each preset graphic element, a corresponding reference image can be generated. Subsequently, a window (the size of the window is the same as the size of the reference image) can be slid on the first image according to a preset step size to intercept a plurality of comparison regions. Exemplarily, the preset step size can include a horizontal step size and a vertical step size, the horizontal step size can refer to the step size of the window moving horizontally on the first image each time, and the vertical step size can refer to the step size of the window moving vertically on the first image each time. Then, for one reference image, the reference image can be compared with a plurality of comparison regions for similarity. Specifically, the similarity between each comparison region in the plurality of comparison regions and the reference image can be determined; when the similarity between a certain comparison region and the reference image is greater than a similarity threshold, the comparison region can be referred to as a second region, and the reference image can be referred to as a first reference image. The similarity threshold can be set as 0.9 according to requirements, which is not limited in the present application.

[0185] Exemplarily, the electronic device can record the editing information corresponding to the editing operation in the process of editing the first image; for example, the editing information can include the processing manner (such as adding a sticker, deleting a sticker, adding a filter, etc.), the processing position, the category information of the processing object, etc.; therefore, according to the editing information, it can be known where and what kind of graphic element is added in the first image. Further, one manner of determining whether the first image contains the graphic element can be as follows: the historical editing information of the first image can be received from other electronic devices or the historical editing information recorded by the electronic device performing the above-mentioned data generation method for the historical editing operation of the first image; then, according to the historical editing information, it can be determined whether the first image contains the graphic element.

[0186] It should be understood that there can be other implementation manners for determining whether the first image contains the graphic element, which are not limited in the present application.

[0187] Exemplarily, when it is determined that the first image contains the graphic element, the following steps S3021-S3023 can be performed to generate the description information of the graphic element.

[0188] S3021, determine the category information of the graphic element and / or the region information of the region where the graphic element is located based on the first image.

[0189] In a possible manner, the category information of the graphic element can be determined based on at least one of the size of the first region, the shape of the first region, the position of the first region, the pixel value of the pixel point in the first region, or the pixel mask information of the first region.

[0190] In a possible manner, the category information of the graphic element is determined based on the size of the first region. Exemplarily, a first preset relationship can be established based on the preset graphic element and the size of the preset graphic element. One preset graphic element can correspond to one or more sizes. In this way, the category information of the graphic element can be determined based on the size of the first region and the first preset relationship.

[0191] In a possible manner, the category information of the graphic element is determined based on the shape of the first region. Exemplarily, a second preset relationship can be established based on the preset graphic element and the shape of the preset graphic element. One preset graphic element can correspond to one or more shapes. In this way, the category information of the graphic element can be determined according to the shape of the first region and the second preset relationship.

[0192] In a possible manner, the category information of the graphic element is determined based on the position of the first region. Exemplarily, a third preset relationship can be established based on the preset graphic element and the position where the preset graphic element has a relatively high frequency of occurrence in the image. One preset graphic element can correspond to one or more positions where the preset graphic element has a relatively high frequency of occurrence in the image. In this way, the category information of the graphic element can be determined according to the position of the first region and the third preset relationship.

[0193] In a possible manner, the category information of the graphic element is determined based on the pixel value of the pixel point in the first region. Exemplarily, each preset graphic element usually has a fixed brightness feature; for example, the average pixel value (or the maximum brightness value or the minimum brightness value) of all pixel points in the logo of a television station A is a preset brightness value. Therefore, a fourth preset relationship can be established based on the preset graphic element and the brightness feature of the preset graphic element. One preset graphic element can correspond to one brightness feature. In this way, when it is determined that the first image contains the graphic element based on the pixel value of the pixel point in the first region, the brightness feature of the first region can be determined according to the pixel value of the pixel point in the first region; then, the category information of the graphic element is determined according to the brightness feature of the first region and the fourth preset relationship.

[0194] In a possible implementation, the category information of the graphic element is determined based on the pixel mask information of the first region. The pixel mask information of the first region can be used to indicate the positions of the pixel points included in the first region in the first image, or to indicate the positions of the pixel points of the graphic element in the first region in the first image. For example, the fifth preset relationship can be established based on the preset graphic elements and the corresponding pixel mask information. One preset graphic element can correspond to one or more pixel mask information. In this way, when the first image includes the graphic element, the category information of the graphic element can be determined according to the pixel mask information of the first region and the fifth preset relationship.

[0195] It should be understood that at least two of the above-mentioned manners can be combined to determine the category information of the graphic element.

[0196] In a possible implementation, the region information of the region where the graphic element is located can be determined based on at least one of the size of the first region, the shape of the first region, the position of the first region, the pixel value of the pixel point in the first region, or the pixel mask information of the first region.

[0197] For example, the region information of the region where the graphic element is located can be determined based on the position of the first region. In a possible implementation, the position of the first region (i.e., the position information) can be used as the region information of the region where the graphic element is located.

[0198] For example, the region information of the region where the graphic element is located can be determined based on the shape of the first region. For example, the shape description information can be generated based on the shape of the first region and the size of the first region, and the shape description information can be used as the region information of the region where the graphic element is located.

[0199] For example, the region information of the region where the graphic element is located can be determined based on the size of the first region, the pixel value of the pixel point in the first region, or the pixel mask information of the first region, which is similar to the manner of determining the category information of the graphic element based on the size of the first region, the pixel value of the pixel point in the first region, or the pixel mask information of the first region. That is, a preset relationship between the size and the region information, or the brightness feature and the region information, or the pixel mask information and the region information is established in advance. Then, the region information of the region where the graphic element is located is determined according to the preset relationship and the size of the first region or the pixel value of the pixel point in the first region or the pixel mask information of the first region. Details are not described herein again.

[0200] In a possible implementation, the category information of the preset graphic element corresponding to the first reference image can be determined as the category information of the graphic element, and / or the region information of the region where the graphic element is located can be determined based on the position of the second region.

[0201] In a possible implementation, the category information of the graphic element and / or the region information of the region where the graphic element is located can be determined according to historical editing information.

[0202] In S3022, the tone mapping information corresponding to the graphic element is determined based on at least one of the first image, the category information of the graphic element, or the region information of the region where the graphic element is located.

[0203] In a possible implementation, the tone mapping information corresponding to the graphic element can be determined based on the first image. Specifically, the pixel values of the pixel points in the region where the graphic element is located in the first image can be used to generate the tone mapping information corresponding to the graphic element. In this case, the tone mapping information corresponding to the graphic element can be a tone mapping curve or a tone mapping table.

[0204] In a possible implementation, the tone mapping information corresponding to the graphic element can be determined based on the category information of the graphic element. Specifically, a first mapping relationship can be obtained, where the first mapping relationship includes a correspondence between a plurality of category information and a plurality of tone mapping information, one category information corresponds to one graphic element and one tone mapping information. Then, based on the first mapping relationship, the tone mapping information corresponding to the category information of the graphic element is selected from the plurality of tone mapping information; and the tone mapping information corresponding to the category information of the graphic element is determined as the tone mapping information corresponding to the graphic element.

[0205] For example, the tone mapping curve corresponding to the watermark in the first mapping relationship is the curve corresponding to the function y=x, the tone mapping curve corresponding to the logo in the first mapping relationship is the curve corresponding to the function y=0.9x, the tone mapping curve corresponding to the UI in the first mapping relationship is the curve corresponding to the function y=x, and the tone mapping curve corresponding to the map in the first mapping relationship is the curve corresponding to the function y=0.8x.

[0206] In a possible implementation, the tone mapping information corresponding to the graphic element can be determined based on the region information of the region where the graphic element is located. Specifically, a second mapping relationship can be obtained, where the second mapping relationship includes a correspondence between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponds to one or more region information. Then, based on the second mapping relationship, the tone mapping information corresponding to the region information of the region where the graphic element is located is selected from the plurality of tone mapping information; and the tone mapping information corresponding to the region information of the region where the graphic element is located is determined as the tone mapping information corresponding to the graphic element.

[0207] For example, the tone mapping curve corresponding to the upper left corner (which can be understood as the region information of the upper left corner) in the second mapping relationship is the curve corresponding to the function y=x, the tone mapping curve corresponding to the upper right corner (which can be understood as the region information of the upper right corner) in the second mapping relationship is the curve corresponding to the function y=x, the tone mapping curve corresponding to the lower left corner (which can be understood as the region information of the lower left corner) in the second mapping relationship is the curve corresponding to the function y=0.7x, and the tone mapping curve corresponding to the lower right corner (which can be understood as the region information of the lower right corner) in the second mapping relationship is the curve corresponding to the function y=0.9x.

[0208] In a possible manner, the tone mapping information corresponding to different kinds of preset graphical elements is preset tone mapping information; at this time, based on the kind information of the graphical element and / or the region information of the region where the graphical element is located, the tone mapping information corresponding to the graphical element can be determined by taking the preset tone mapping information as the tone mapping information corresponding to the graphical element. The preset tone mapping information can be a preset tone mapping curve such as a curve corresponding to the function y=x.

[0209] S3023, generating description information of the graphical element based on at least one of the kind information of the graphical element, the region information of the region where the graphical element is located, or the tone mapping information corresponding to the graphical element.

[0210] It should be understood that when S3021 is a necessary step, S3022 can be an optional step. When S3022 is a necessary step, S3021 can be an optional step; wherein, "determining the kind information of the graphical element based on the first image" in S3021 is an optional step, or "determining the region information of the region where the graphical element is located based on the first image" is an optional step.

[0211] The region where the graphical element is located can refer to a region covered by pixel points included in the graphical element (for example, the region where the watermark "HUAWEI mate 60" is located can refer to a region covered by pixel points included in the string "HUAWEI mate 60"), or a circumscribed rectangle of a region covered by pixel points included in the graphical element (for example, the region where the watermark "HUAWEI mate 60" is located can refer to a circumscribed rectangle of a region covered by pixel points included in the string "HUAWEI mate 60").

[0212] The representation form of the kind information of the graphical element can be as follows:

[0213] In a possible manner, the kind information of the graphical element can be an identifier. For example, the graphical element is 1, and the non-graphical element is 0.

[0214] In one possible implementation, the category information of the graphic element can be a category indicator. For example, the category indicator of the UI is UI, the category indicator of the map is MP, the category indicator of the watermark is WM, the category indicator of the logo is LO, and the category indicator of other graphic elements is O.

[0215] In one possible implementation, the category information of the graphic element can be a category index. A category list can be established in advance, which can include the names (or category indicators) and corresponding category indexes of multiple preset graphic elements. For example, the category index of the UI is 0, the category index of the map is 1, the category index of the watermark is 2, the category index of the logo is 3, and the category index of other graphic elements is 4. Alternatively, the names (or category indicators) of the multiple preset graphic elements in the category list are arranged from bottom to top, and the positions of the various preset graphic elements in the category list are used as the indexes corresponding to the various preset graphic elements.

[0216] In one possible implementation, the category information of the graphic element can be implicitly transmitted through the enhancement layer data of the dual-layer code stream. The enhancement layer data of the pixels in the region where the graphic element is located is a preset value (such as 0 or 1 to indicate that the HDR data of the current region has no change in brightness or value relative to the SDR data). In the receiving end, when a continuous region with the preset value of the enhancement layer data is identified, and the number of pixels in the continuous region is greater than a preset threshold (0 or other preset value), the continuous region is set as the graphic element type.

[0217] The representation form of the region information of the region where the graphic element is located can be as follows:

[0218] In one possible implementation, the region information of the region where the graphic element is located can include a first size and a first mask graph, where the first size is the size of the first image, and the size of the first mask graph is equal to the first size. The first mask graph can be used to indicate the position of the region where the graphic element is located. For example, the pixel value of the pixel point in the first mask graph corresponding to the position of the region where the graphic element is located in the first image is 1, and the pixel value of other pixel points is 0.

[0219] In one possible implementation, the region information of the region where the graphic element is located can include a second size and a second mask graph, where the second size is the size of the first image scaled by a preset multiple (the length and the width are scaled at a same ratio), and the size of the second mask graph is equal to the second size. The second mask graph can be used to indicate the position of the region where the graphic element is located in the first image scaled by the preset multiple.

[0220] In a possible manner, the region information of the region where the graphic element is located can include first size and first transparency information, where the first size is the size of the first image, and the first transparency information includes the transparency of all pixel points in the first image. The first transparency information can be used to indicate the position of the region where the graphic element is located. For example, the transparency of the pixel point corresponding to the position of the region where the graphic element is located in the first transparency information is 1, and the transparency of other pixel points is 0.

[0221] In a possible manner, the region information of the region where the graphic element is located can include second size and second transparency information, where the second size is the size of the first image scaled by a preset multiple (the length and the width are scaled in proportion), and the second transparency information includes the transparency of all pixel points in the first image scaled by the preset multiple. The second transparency information can be used to indicate the position of the region where the graphic element is located in the first image scaled by the preset multiple.

[0222] In a possible manner, the region information of the region where the graphic element is located can include first size and first weight information, where the first size is the size of the first image, and the first weight information includes the weight value of all pixel points in the first image. The first weight information can be used to indicate the position of the region where the graphic element is located. For example, the weight value of the pixel point corresponding to the position of the region where the graphic element is located in the first weight information is 1, and the weight value of other pixel points is 0.

[0223] In a possible manner, the region information of the region where the graphic element is located can include second size and second weight information, where the second size is the size of the first image scaled by a preset multiple (the length and the width are scaled in proportion), and the second weight information includes the weight value of all pixel points in the first image scaled by the preset multiple. The second weight information can be used to indicate the position of the region where the graphic element is located in the first image scaled by the preset multiple.

[0224] In a possible manner, the region information of the region where the graphic element is located can include shape description information of the region where the graphic element is located. For example, the region where the graphic element is located is a rectangular region, and the region information of the region where the graphic element is located can include the coordinates of the upper left corner of the rectangular region, the length of the rectangular region, and the width of the rectangular region. For example, the region where the graphic element is located is a circular region, and the region information of the region where the graphic element is located can include the coordinates of the center of the circular region and the radius of the circular region.

[0225] In a possible manner, the region information of the region where the graphic element is located can include shape description information of the region where the graphic element is located and a third mask image. The third mask image can be used to indicate the position of the pixel point of the graphic element.

[0226] In a possible manner, in a case where local tone mapping is performed on other regions in the first image (generally, the first image is divided into a plurality of blocks, and a corresponding local tone mapping curve is determined for each block; subsequently, tone mapping is performed on each block by using the corresponding local tone mapping curve), the region information of the region where the graphic element is located can be block information divided by local tone mapping (LTM). For example, the region information of the region where the graphic element is located can be a block index. In this case, a block is either the region where the graphic element is located or contains other regions in addition to the region where the graphic element is located; that is, a block is either tone mapped by using the tone mapping information corresponding to the graphic element or tone mapped by using the local tone mapping curve corresponding to the block.

[0227] In a possible manner, the region information of the region where the graphic element is located can be implicitly transmitted by using enhancement layer data of a dual-layer bitstream. The enhancement layer data of the pixels in the region where the graphic element is located is a preset value (such as 0 or 1 to indicate that there is no change in brightness or value of the HDR data of the current region relative to the SDR data). In the receiving end, when a continuous region with the preset value of the enhancement layer data is identified, and the number of pixels in the continuous region is greater than a preset threshold, the information of the continuous region is taken as the region information of the region where the graphic element is located.

[0228] The representation form of the tone mapping information corresponding to the graphic element can be as follows:

[0229] In a possible manner, the tone mapping information corresponding to the graphic element is a look up table (lut).

[0230] In a possible manner, the tone mapping information corresponding to the graphic element is a tone mapping function corresponding to the tone mapping curve.

[0231] In a possible manner, the tone mapping information corresponding to the graphic element is an index of the tone mapping curve.

[0232] In a possible manner, the tone mapping information corresponding to the graphic element is a parameter used to determine the tone mapping curve.

[0233] Exemplarily, the local tone mapping information of LTM can be reused; and the local tone mapping information of one or more blocks included in the region where the graphic element is located can be adjusted to the tone mapping information corresponding to the graphic element.

[0234] S303, encode the first image to obtain a bitstream.

[0235] In a possible manner, S303 can refer to the following steps S3031-S3034:

[0236] S3031, perform tone mapping on a region in the first image where the graphic element is located based on the description information of the graphic element, to obtain a third image.

[0237] Illustratively, the tone mapping information corresponding to the graphic element can be determined based on the description information of the graphic element; then, the region in the first image where the graphic element is located can be tone mapped based on the tone mapping information corresponding to the graphic element, to obtain the third image; the specific process can refer to the description in the subsequent image processing process, and will not be described here.

[0238] S3032, generate enhanced data based on the first image and the third image, the enhanced data including enhanced values of all pixel points in the first image.

[0239] In one possible manner, the difference between the pixel values of the pixel points at corresponding positions in the first image and the third image can be calculated to obtain the enhanced data. Wherein, the pixel value of the pixel point in the first image can be subtracted by the pixel value of the pixel point at the corresponding position in the third image to obtain the enhanced data.

[0240] In one possible manner, the quotient between the pixel values of the pixel points at corresponding positions in the first image and the third image can be calculated to obtain the enhanced data. Wherein, the pixel value of the pixel point in the first image can be divided by the pixel value of the pixel point at the corresponding position in the third image to obtain the enhanced data.

[0241] S3033, adjust the enhanced values of the pixel points in the region of the enhanced data where the graphic element is located to a preset value, to obtain adjusted enhanced data.

[0242] Generally, the decoding end is obtained by multiplying or adding the pixel values of the corresponding position pixels in the third image and the enhancement data. In the case that the first image does not contain the graphic element (i.e., all regions of the first image are subjected to tone mapping by using the tone mapping information corresponding to the first image to obtain the third image), the difference between the reconstructed image of the first image and the first image is small. However, in the present application, the first image contains the graphic element, and the region where the graphic element is located is subjected to tone mapping according to the tone mapping information corresponding to the graphic element (the other regions are subjected to mapping by using the tone mapping information corresponding to the first image). Therefore, in order to make the region where the graphic element is located in the reconstructed image of the first image closer to the region where the graphic element is located in the first image, the enhancement value of the pixel in the region where the graphic element is located in the enhancement data can be adjusted to a preset value to obtain the adjusted enhancement data. The preset value can be determined according to the tone mapping information corresponding to the graphic element. For example, if the tone mapping information corresponding to the graphic element is a curve corresponding to the function y=x, the preset value can be 1.0. For example, if the tone mapping information corresponding to the graphic element is a curve corresponding to the function y=0.9x, the preset value can be 0.9.

[0243] S3034, encode the third image and the adjusted enhancement data to obtain a bitstream.

[0244] Exemplarily, the third image can be regarded as the base data. The third image can be input into an encoder to obtain a base layer bitstream (also referred to as a bitstream of the third image) output by the encoder; and the enhancement data can be input into the encoder to obtain an enhancement layer bitstream (also referred to as a bitstream of the enhancement data) output by the encoder; the base layer bitstream and the enhancement layer bitstream can be referred to as a bitstream of a double-layer structure.

[0245] In a possible manner, the first image can be directly encoded to obtain a bitstream of a single-layer structure. Specifically, the first image can be input into an encoder to obtain a bitstream of an HDR image output by the encoder, and the bitstream of the HDR image is a bitstream of a single-layer structure (it should be understood that the bitstream of the single-layer structure is named relative to the bitstream of the double-layer structure).

[0246] S304, write the description information of the graphic element into the bitstream to obtain the first target data.

[0247] Exemplarily, the graphic element can be regarded as metadata, and the graphic element can be written into the bitstream according to the encoding manner of the metadata. The metadata refers to data describing key information and features required in the process of video or image processing.

[0248] FIGS. 3B and 3C are schematic diagrams of one implementation manner of S303 and S304 in the data generation process 300 of FIG. 3A, taking the first image as an HDR image as an example.

[0249] FIG. 3B is a schematic diagram of another data generation process according to an embodiment of the present application.

[0250] The first image in FIG. 3B is an HDR image, which can be obtained by taking a picture, taking a screenshot, or decoding from a bitstream. The first target data generated according to the data generation process 300 described above can include a single-layer structure bitstream, which includes a bitstream of the HDR image and encoded data of the metadata (including encoded data of the description information of the graphic elements in the HDR image).

[0251] FIG. 3C is a schematic diagram of another data generation process according to an embodiment of the present application.

[0252] The first image in FIG. 3C is an HDR image, which can be obtained by taking a picture, taking a screenshot, or decoding from a bitstream. The first target data generated according to the data generation process 300 described above can include a double-layer structure bitstream, which includes an enhancement layer bitstream, a base layer bitstream, and encoded data of the metadata (including encoded data of the description information of the graphic elements in the HDR image).

[0253] For example, after obtaining the first image, the first image can be edited to add a graphic element in the first image. For the graphic element added in the first image, the first target data can be generated according to the data generation process 400 described below.

[0254] FIG. 4A is a schematic diagram of another data generation process 400 according to an embodiment of the present application. The data generation process 400 describes a process of obtaining the description information of the graphic elements in the first image after adding the graphic elements in the first image based on the data generation process 200 described above. The data generation process 400 can be performed by any one of the terminal devices 11, 12, …, 1N in FIG. 1F described above, or can be performed by the server in FIG. 1F described above.

[0255] S401, obtaining a first image.

[0256] S402, receiving an editing operation for the first image, the editing operation being used to add a graphic element in the first image.

[0257] For example, the editing operation for the first image can include adding a watermark, a sticker, a LOGO, or the like in the first image.

[0258] For example, after receiving the editing operation for the first image, a graphic element can be added in the first image to obtain an edited first image.

[0259] S403, generate description information of the added graphical element based on the edited first image.

[0260] Exemplarily, the added graphical element refers to a graphical element added in the first image based on the editing operation.

[0261] In a possible manner, the manner of determining the category information of the graphical element and / or the region information of the region where the graphical element is located based on at least one of the size of the first region, the shape of the first region, the position of the first region, the pixel value of the pixel point in the first region, or the pixel mask information of the first region, and determining the tone mapping information corresponding to the graphical element based on at least one of the first image, the category information of the graphical element, or the region information of the region where the graphical element is located, can be similar to the above S302, and details are not repeated here.

[0262] In a possible manner, the category information of the graphical element and / or the region information of the region where the graphical element is located can be determined based on the editing operation on the first image. Exemplarily, when the editing operation on the first image is received, the mobile phone can execute the editing operation and record the corresponding editing information in response to the operation behavior of the user. The editing information can include the processing manner (such as adding a sticker, deleting a sticker, adding a filter, etc.), the processing position, and the category information of the processing object. Further, according to the editing information corresponding to the editing operation, it can be known where and what kind of graphical element is added in the first image. That is, according to the editing information corresponding to the editing operation, the category information of the graphical element and / or the region information of the region where the graphical element is located can be determined.

[0263] S404, encode the edited first image to obtain a bitstream.

[0264] S405, write the description information of the graphical element into the bitstream to obtain first target data.

[0265] Exemplarily, S404-S405 can refer to the description of S303-S304 described above, and details are not repeated here.

[0266] FIGS. 4B and 4C are schematic diagrams of one implementation of S402-S405 in the data generation process 400 of FIG. 4A, taking the first image as an HDR image as an example.

[0267] FIG. 4B is a schematic diagram of another data generation process of an embodiment of the present application.

[0268] The first image in FIG. 4B is an HDR image 1, which can be obtained by photographing, screen capturing, or decoding from a bitstream. The HDR image 1 is edited (including adding a new graphical element), and the obtained image can be referred to as an HDR image 2 (i.e., the edited first image). The first target data generated according to the data generation process 400 described above can include a single-layer structure bitstream, which includes a bitstream of the HDR image 2 and encoded data of the metadata (including encoded data of the description information of the added graphical element).

[0269] FIG. 4C is a schematic diagram of another data generation process according to an embodiment of the present application.

[0270] The first image in FIG. 4C is an HDR image 1, which can be obtained by photographing, screen capturing, or decoding from a bitstream. The HDR image 1 is edited (including adding a new graphical element), and the obtained image can be referred to as an HDR image 2 (i.e., the edited first image). The first target data generated according to the data generation process 400 described above can include a single-layer structure bitstream, which includes a bitstream of the HDR image 2 and encoded data of the metadata (including encoded data of the description information of the added graphical element).

[0271] FIG. 5A is a schematic diagram of another data generation process 500 according to an embodiment of the present application. The data generation process 500 is based on the data generation process 200 described above, and describes a process of obtaining the description information of the graphical element in the first image when the first image obtained contains a graphical element and the description information of the graphical element is received from another electronic device. The data generation process 500 can be performed by any one of the terminal devices 11, 12, …, 1N in FIG. 1F described above, or can be performed by the server in FIG. 1F described above.

[0272] S501, receiving second target data, the second target data including a first image and description information of a graphical element in the first image.

[0273] Exemplarily, the second target data is generated in the same way as the first target data described above.

[0274] In a possible manner, the second target data includes a double-layer structure bitstream, and the double-layer structure bitstream includes an enhancement layer bitstream, a base layer bitstream, and encoded information of the description information of the graphical element.

[0275] In a possible manner, the second target data includes a single-layer structure bitstream, and the single-layer structure bitstream includes a bitstream of the first image and encoded information of the description information of the graphical element.

[0276] S502, obtaining the first image from the second target data.

[0277] The following Figure 5B is a schematic diagram of a manner of obtaining the description information of the first image and the graphic element from the second target data in the data generation process 500 of Figure 5A, taking the code stream of the first target data containing a double-layer structure as an example, and a schematic diagram of one implementation of S504-S505 in the data generation process 500 of Figure 5A.

[0278] Figure 5B is a schematic diagram of another data generation process according to an embodiment of the present application.

[0279] In Figure 5B, the second target data includes a code stream of a double-layer structure. The reconstructed data of the second enhancement data can be decoded from the second enhancement layer code stream, and the reconstructed data of the second base data can be decoded from the second base layer code stream; then, based on the reconstructed data of the second enhancement data and the reconstructed data of the second base data, an HDR image (i.e., the first image, which is essentially the reconstructed image of the first image in the second target data, and the present application does not distinguish the image before encoding and the image after decoding in name) is generated. Specifically, the pixel values of the corresponding pixel points of the reconstructed data of the second enhancement data and the reconstructed data of the second base data can be added or multiplied to obtain the first image.

[0280] Exemplarily, when the second target data includes a code stream of a single-layer structure, the first image can be decoded from the code stream of the first image.

[0281] S503, obtaining the description information of the graphic element from the second target data.

[0282] In Figure 5B, the encoded data of the second metadata in the code stream of the double-layer structure can be decoded to obtain the description information of the graphic element (here, the description information of the graphic element is essentially the reconstructed data of the description information of the graphic element in the second target data, and the present application does not distinguish the description information of the graphic element before encoding and the description information of the graphic element after decoding in name).

[0283] Similarly, for the code stream of a single-layer structure, the encoded data of the metadata in the single-layer structure can also be decoded to obtain the description information of the graphic element.

[0284] S504, encoding the first image to obtain a code stream.

[0285] S505, writing the description information of the graphic element into the code stream to obtain the first target data.

[0286] Exemplarily, S404-S405 can refer to the description of S303-S304 described above, and will not be described here.

[0287] The manner of implementing S504 in FIG. 5B can refer to the description of S3031-S3034, which will not be repeated here.

[0288] It should be noted that the manner of obtaining the description information of the graphical element in the data generation process 300, the data generation process 400, and the data generation process 500 can be combined.

[0289] FIG. 6 is a schematic diagram of an image processing process 600 according to an embodiment of the present application. The image processing process 600 can be performed by any of the terminal devices 21, 22, …, 2M in FIG. 1F.

[0290] S601, obtaining a first image and description information of a graphical element in the first image.

[0291] Exemplarily, the first image can be an image obtained by decoding a bitstream, a screenshot image obtained by screenshot, or a photo obtained by taking a photo.

[0292] In a possible manner, the description information of the graphical element in the first image can be received from another electronic device.

[0293] In a possible manner, the description information of the graphical element in the first image can be generated based on the first image.

[0294] S602, determining a region where the graphical element is located in the first image and tone mapping information corresponding to the graphical element based on the description information of the graphical element.

[0295] Exemplarily, the description information of the graphical element includes at least one of the following: category information of the graphical element, region information of the region where the graphical element is located, or tone mapping information corresponding to the graphical element.

[0296] When the description information of the graphical element is the category information of the graphical element or the tone mapping information corresponding to the graphical element, the region where the graphical element is located in the first image can be determined according to a preset mapping relationship and the description information of the graphical element as the category information (or the tone mapping information corresponding to the graphical element). When the description information of the graphical element is the region information of the region where the graphical element is located, the region where the graphical element is located in the first image can be directly determined according to the region information of the region where the graphical element is located.

[0297] When the description information of the graphical element is the category information of the graphical element or the region information of the region where the graphical element is located, the tone mapping information corresponding to the graphical element in the first image can be determined according to preset tone mapping information. The preset tone mapping information can be a preset tone mapping curve, such as a curve corresponding to the function y=x.

[0298] When the description information of the graphic element is the category information of the graphic element or the region information of the region where the graphic element is located, the tone mapping information corresponding to the graphic element can be determined according to a preset mapping relationship and the category information of the graphic element (or the region information of the region where the graphic element is located).

[0299] When the description information of the graphic element is the tone mapping information corresponding to the graphic element, the description information of the graphic element can be directly determined as the tone mapping information corresponding to the graphic element.

[0300] S603, performing tone mapping on the region where the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element, to obtain a target image.

[0301] In a possible manner, the region where the graphic element is located in the first image can be tone mapped by using the tone mapping information corresponding to the graphic element, and other regions in the first image can be tone mapped by using the tone mapping information corresponding to the first image, to obtain a target image. The tone mapping information corresponding to the graphic element is different from the tone mapping information corresponding to the first image, and it can also be understood that the tone mapping manner of the region where the graphic element is located in the first image is different from the tone mapping manner of other regions in the first image.

[0302] The tone mapping information corresponding to the first image can be received from another electronic device, or can be generated based on pixel values of pixel points in other regions in the first image.

[0303] For example, the pixel values of all pixel points in the region where the graphic element is located in the first image can be tone mapped by using the tone mapping information corresponding to the graphic element, to obtain first pixel values of all pixel points in the region where the graphic element is located. In a possible manner, the first pixel values of all pixel points in the region where the graphic element is located can be taken as pixel values of all pixel points in the region where the graphic element is located in a target image. In a possible manner, the pixel values of all pixel points in the region where the graphic element is located in the first image can also be tone mapped by using the tone mapping information corresponding to the first image, to obtain second pixel values of all pixel points in the region where the graphic element is located. Then, the first pixel values and the second pixel values of all pixel points in the region where the graphic element is located in the first image can be weighted to obtain pixel values of all pixel points in the region where the graphic element is located in the target image. The second manner can make the region where the graphic element is located in the second image more smoothly connected with other regions.

[0304] In a possible manner, the region in the first image where the graphic element is located can be tone-mapped by using the tone-mapping information corresponding to the graphic element, and no tone-mapping is performed on other regions in the first image, so as to obtain the target image. That is, the region in the target image where the graphic element is located is obtained by tone-mapping the region in the first image where the graphic element is located, and the other regions in the target image are the same as the other regions in the first image.

[0305] FIG. 7 is a schematic diagram of another image processing process 700 according to an embodiment of the present application. The image processing process 700 is based on the image processing process 600, and describes the process of determining the region in the first image where the graphic element is located, and describes the process of determining the tone-mapping information corresponding to the graphic element. The image processing process 700 can be performed by any one of the terminal devices 21, 22, …, 2M in FIG. 1F.

[0306] S701, receiving target data, the target data including a first image and description information of a graphic element in the first image.

[0307] S702, obtaining the first image and the description information of the graphic element in the first image from the target data.

[0308] For example, S701-S702 can refer to the description of S501-S502, which will not be repeated here.

[0309] For example, the description information of the graphic element includes at least one of the following: category information of the graphic element, region information of the region where the graphic element is located, or tone-mapping information corresponding to the graphic element.

[0310] S703, determining the region in the first image where the graphic element is located based on the description information of the graphic element.

[0311] For example, when the description information of the graphic element is the category information of the graphic element, S703 can include the following steps S7031-S7033:

[0312] S7031, obtaining a third mapping relationship, the third mapping relationship including a correspondence relationship between a plurality of category information and a plurality of region information, one category information corresponding to one graphic element, and one category information corresponding to one or more region information.

[0313] Exemplarily, the third mapping relationship can be constructed in advance. Specifically, for each of the plurality of preset graphic elements, the region information corresponding to the type of the preset graphic element can be determined; wherein one graphic element corresponds to one or more region information. For example, the region information corresponding to the watermark is at least one of the region information of the upper left corner region, the region information of the lower right corner region, or the region information of the center region of the image. For another example, the region information corresponding to the UI is the region information of the edge region. Then, based on the category information of each of the plurality of preset graphic elements, and the mapping relationship between the category information of each of the plurality of preset graphic elements and the region information corresponding to the type of the preset graphic element, the third mapping relationship is generated.

[0314] S7032, based on the third mapping relationship, selecting the region information corresponding to the category information of the graphic element from the plurality of region information.

[0315] S7033, determining the region in which the graphic element is located in the first image based on the region information corresponding to the category information of the graphic element.

[0316] When the region information corresponding to the category information of the graphic element is one, the region in which the graphic element is located in the first image is directly determined based on the region information corresponding to the category information of the graphic element.

[0317] When the region information corresponding to the category information of the graphic element is multiple, one region information can be selected (such as randomly selected) from the multiple region information corresponding to the category information of the graphic element; then, the region in which the graphic element is located in the first image is determined based on the region information.

[0318] When the region information corresponding to the category information of the graphic element is multiple, based on each of the region information corresponding to the category information of the graphic element, one region in which the graphic element is located in the first image can be determined; in this way, multiple regions in which the graphic element is located in the first image, or in other words, the region in which each of the multiple graphic elements in the first image is located, can be obtained.

[0319] Exemplarily, when the description information of the graphic element is the tone mapping information corresponding to the graphic element, S703 can include the following steps S7034-S7036:

[0320] S7034, obtaining a fourth mapping relationship, the fourth mapping relationship including a corresponding relationship between a plurality of tone mapping information and a plurality of region information, one tone mapping information corresponding to one or more region information.

[0321] Exemplarily, the fourth mapping relationship can be constructed in advance. Specifically, for each of the plurality of preset graphic elements, the color mapping information and the region information corresponding to the type of the preset graphic element can be determined; wherein one or more region information corresponds to one preset graphic element, and one color mapping information corresponds to one preset graphic element; therefore, one color mapping information corresponds to one or more region information. For example, the region information corresponding to the watermark is at least one of the region information of the upper left corner region, the region information of the lower right corner region, or the region information of the center region of the image, and the color mapping information corresponding to the watermark is color mapping information A. For another example, the region information corresponding to the UI is the region information of the edge region, and the color mapping information corresponding to the UI is color mapping information B. Then, the fourth mapping relationship is generated based on the mapping relationship between the region information and the color mapping information corresponding to each of the plurality of graphic elements.

[0322] S7035, based on the fourth mapping information, selecting the region information corresponding to the color mapping information corresponding to the graphic element from the plurality of region information.

[0323] S7036, determining the region in the first image where the graphic element is located based on the region information corresponding to the color mapping information corresponding to the graphic element.

[0324] Exemplarily, S7036 can refer to the description of S7033 described above, which will not be repeated here.

[0325] S704, determining the color mapping information corresponding to the graphic element based on the description information of the graphic element.

[0326] Exemplarily, when the description information of the graphic element is the category information of the graphic element, S704 can include the following steps S7041-S7043:

[0327] S7041, obtaining the first mapping relationship, the first mapping relationship including the correspondence between the plurality of category information and the plurality of color mapping information, one category information corresponding to one graphic element and one color mapping information.

[0328] Exemplarily, the first mapping relationship can be constructed in advance. Specifically, for each of the plurality of preset graphic elements, the color mapping information corresponding to the type of the preset graphic element can be determined; wherein one color mapping information corresponds to one preset graphic element. For example, the color mapping information corresponding to the watermark is color mapping information A. For another example, the color mapping information corresponding to the UI is color mapping information B. Then, the first mapping relationship can be generated based on the category information of each of the plurality of preset graphic elements and the color mapping information corresponding to each of the plurality of preset graphic elements.

[0329] S7042, selecting, based on the first mapping relationship, the tone mapping information corresponding to the category information of the graphic element from the plurality of tone mapping information.

[0330] S7043, determining the tone mapping information corresponding to the category information of the graphic element as the tone mapping information corresponding to the graphic element.

[0331] Exemplarily, when the description information of the graphic element is the region information of the region where the graphic element is located, S704 can include steps S7044-S7046 as follows:

[0332] S7044, obtaining a second mapping relationship, the second mapping relationship including a corresponding relationship between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponding to one or more region information.

[0333] Exemplarily, the second mapping relationship can be constructed in advance. Wherein, the process of generating the second mapping relationship is similar to the fourth mapping relationship, which will not be repeated here.

[0334] Exemplarily, the second mapping relationship is the fourth mapping relationship.

[0335] S7045, selecting, based on the second mapping relationship, the tone mapping information corresponding to the region information of the region where the graphic element is located from the plurality of tone mapping information.

[0336] S7046, determining the tone mapping information corresponding to the region information of the region where the graphic element is located as the tone mapping information corresponding to the graphic element.

[0337] S705, performing tone mapping on the region where the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element, and performing tone mapping on other regions in the first image based on the tone mapping information corresponding to the first image, to obtain a second image.

[0338] It should be noted that in the above image processing process 600 and image processing 700, the first image is divided into a region where the graphic element is located and other regions for tone mapping, that is, the tone mapping is performed regionally. In one possible manner, the first image is a high dynamic range (HDR) image, the first image includes an HDR layer and a standard dynamic range (SDR) layer, the SDR layer includes the graphic element, the HDR layer includes the second image, the second image is an HDR image, and the dynamic range of the pixel value of the pixel point in the region where the graphic element is located is smaller than the dynamic range of the pixel value of the pixel point in the second image. Therefore, the SDR layer and the HDR layer of the first image can be tone mapped respectively, that is, the tone mapping is performed layer by layer.

[0339] In a possible manner, the SDR layer can be tone mapped based on first tone mapping information corresponding to the graphic element, and the HDR layer can be tone mapped based on second tone mapping information corresponding to the second image, to obtain the target image, the first tone mapping information being different from the second tone mapping information. That is, the tone mapping manner of the graphic element is different from the tone mapping manner of the second image. In this way, the transition at the connection between the region where the graphic element is located and other regions in the target image can be smoother.

[0340] In a possible manner, the first tone mapping information is tone mapping information corresponding to the SDR layer. The tone mapping information corresponding to the SDR layer can be regarded as the tone mapping information corresponding to the graphic element.

[0341] In a possible manner, the first tone mapping information is generated based on the second tone mapping information and third tone mapping information, and the third tone mapping information is tone mapping information corresponding to the SDR layer.

[0342] FIG. 8 is a schematic diagram of a data generation apparatus 800 according to an embodiment of the present application. The data generation apparatus 800 can be used to execute the method according to the foregoing embodiments, and therefore, the beneficial effects that can be achieved by the data generation apparatus 800 can refer to the beneficial effects provided in the corresponding method, which will not be described herein again. The data generation apparatus 800 can be a terminal device or a server, or can be a device (as shown in FIG. 8) in a terminal device or a server.

[0343] The data generation apparatus 800 can include:

[0344] An image acquisition module 801 configured to acquire a first image.

[0345] A description information acquisition module 802 configured to acquire description information of a graphic element in the first image, the description information of the graphic element being used to tone map a region where the graphic element is located in the first image.

[0346] A data generation module 803 configured to generate first target data based on the first image and the description information of the graphic element.

[0347] Exemplarily, the first image is a high dynamic range (HDR) image, the first image includes an HDR layer and a standard dynamic range (SDR) layer, the SDR layer includes the graphic element, the HDR layer includes a second image, the second image is an HDR image, and a dynamic range of pixel values of pixel points in the region where the graphic element is located is smaller than a dynamic range of pixel values of pixel points in the second image.

[0348] Exemplarily, a tone mapping manner of the second image is different from a tone mapping manner of the region where the graphic element is located.

[0349] Exemplarily, the graphic element comprises at least one of a watermark, a logo, a user interface, and a sticker.

[0350] Exemplarily, the description information of the graphic element comprises at least one of category information of the graphic element, region information of a region where the graphic element is located, or tone mapping information corresponding to the graphic element.

[0351] Exemplarily, the region information of the region where the graphic element is located comprises at least one of a shape of the region where the graphic element is located, a size of the region where the graphic element is located, a position of the region where the graphic element is located, and pixel position mask information of the region where the graphic element is located.

[0352] Exemplarily, the data generation module 803 is specifically configured to encode the first image to obtain a code stream, and write the description information of the graphic element into the code stream to obtain first target data.

[0353] Exemplarily, the data generation module 803 is specifically configured to perform tone mapping on the region where the graphic element is located in the first image based on the description information of the graphic element to obtain a third image, generate enhancement data based on the first image and the third image, the enhancement data comprising enhancement values of all pixel points in the first image, adjust the enhancement values of the pixel points in the region where the graphic element is located in the enhancement data to preset values to obtain adjusted enhancement data, and encode the third image and the adjusted enhancement data to obtain the code stream.

[0354] Exemplarily, the data generation module 803 is specifically configured to, when the description information of the graphic element is the category information of the graphic element or the region information of the region where the graphic element is located, determine the tone mapping information corresponding to the graphic element based on the description information of the graphic element, and perform tone mapping on the region where the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element to obtain the third image.

[0355] Exemplarily, the data generation module 803 is specifically configured to determine the preset tone mapping information as the tone mapping information corresponding to the graphic element.

[0356] Exemplarily, the data generation module 803 is specifically configured to, when the description information of the graphic element is the category information of the graphic element, determine the tone mapping information corresponding to the graphic element based on the description information of the graphic element, comprising: obtaining a first mapping relationship, the first mapping relationship comprising a corresponding relationship between a plurality of category information and a plurality of tone mapping information, one category information corresponding to one graphic element and one tone mapping information; selecting the tone mapping information corresponding to the category information of the graphic element from the plurality of tone mapping information based on the first mapping relationship; and determining the tone mapping information corresponding to the category information of the graphic element as the tone mapping information corresponding to the graphic element.

[0357] Exemplarily, the data generation module 803 is specifically configured to: obtain a second mapping relationship, the second mapping relationship comprising a correspondence between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponding to one or more region information; select, based on the second mapping relationship, tone mapping information corresponding to region information of a region where the graphic element is located from the plurality of tone mapping information; and determine the tone mapping information corresponding to the region information of the region where the graphic element is located as tone mapping information corresponding to the graphic element.

[0358] Exemplarily, the description information generation module 802 is specifically configured to generate description information of the graphic element based on the first image.

[0359] Exemplarily, the apparatus further comprises an interaction module, the interaction module being configured to receive an editing operation for the first image, the editing operation being configured to add the graphic element into the first image.

[0360] Exemplarily, the apparatus further comprises a communication module, the communication module being configured to receive second target data, the second target data comprising the first image and the description information of the graphic element.

[0361] The image acquisition module 801 is specifically configured to acquire the first image from the second target data.

[0362] The description information acquisition module 802 is specifically configured to acquire the description information of the graphic element from the second target data.

[0363] FIG. 9 is a schematic diagram of an image processing apparatus 900 according to an embodiment of the present application. The image processing apparatus 900 can be configured to execute the method according to the foregoing embodiments, and therefore, the beneficial effects that can be achieved by the image processing apparatus 900 can refer to the beneficial effects of the corresponding method provided above, which will not be described herein again. The image processing apparatus 900 can be a terminal device or a device in a terminal device (as shown in FIG. 9).

[0364] The image processing apparatus 900 can comprise:

[0365] The acquisition module 901 is configured to acquire the first image and the description information of the graphic element in the first image.

[0366] The information determination module 902 is configured to determine, based on the description information of the graphic element, a region where the graphic element is located in the first image and tone mapping information corresponding to the graphic element.

[0367] The tone mapping module 903 is configured to perform tone mapping on the region where the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element, to obtain a target image.

[0368] Exemplarily, the first image is a high dynamic range (HDR) image, the first image includes an HDR layer and a standard dynamic range (SDR) layer, the SDR layer includes the graphic element, and the HDR layer includes a second image, the second image is an HDR image, and a dynamic range of pixel values of pixels in a region where the graphic element is located is smaller than a dynamic range of pixel values of pixels in the second image.

[0369] Exemplarily, the tone mapping module 902 is specifically configured to perform tone mapping on the SDR layer based on first tone mapping information corresponding to the graphic element, perform tone mapping on the HDR layer based on second tone mapping information corresponding to the second image, and obtain the target image, the first tone mapping information being different from the second tone mapping information.

[0370] Exemplarily, the first tone mapping information is tone mapping information corresponding to the SDR layer, or the first tone mapping information is generated based on the second tone mapping information and third tone mapping information, and the third tone mapping information is tone mapping information corresponding to the SDR layer.

[0371] Exemplarily, the obtaining module 901 is specifically configured to receive target data, the target data including the first image and description information of the graphic element in the first image, and obtain the first image and the description information of the graphic element in the first image from the target data.

[0372] Exemplarily, the description information of the graphic element includes at least one of the following: category information of the graphic element, region information of a region where the graphic element is located, or tone mapping information corresponding to the graphic element.

[0373] Exemplarily, the tone mapping module 903 is specifically configured to, when the description information of the graphic element is the category information of the graphic element, obtain a first mapping relationship, the first mapping relationship including a correspondence relationship between a plurality of category information and a plurality of tone mapping information, one category information corresponding to one graphic element and one tone mapping information, select, based on the first mapping relationship, tone mapping information corresponding to the category information of the graphic element from the plurality of tone mapping information, and determine the tone mapping information corresponding to the category information of the graphic element as the tone mapping information corresponding to the graphic element.

[0374] Exemplarily, the tone mapping module 903 is specifically configured to, when the description information of the graphic element is the region information of the region where the graphic element is located, obtain a second mapping relationship, the second mapping relationship including a correspondence relationship between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponding to one or more region information, select, based on the second mapping relationship, tone mapping information corresponding to the region information of the region where the graphic element is located from the plurality of tone mapping information, and determine the tone mapping information corresponding to the region information of the region where the graphic element is located as the tone mapping information corresponding to the graphic element.

[0375] Exemplarily, the acquisition module 902 is specifically configured to: when the description information of the graphic element is category information of the graphic element, acquire a third mapping relationship, the third mapping relationship comprising a corresponding relationship between a plurality of category information and a plurality of region information, one category information corresponding to one graphic element, and one category information corresponding to one or more region information; based on the third mapping relationship, select region information corresponding to the category information of the graphic element from the plurality of region information; and based on the region information corresponding to the category information of the graphic element, determine the region in which the graphic element is located in the first image.

[0376] Exemplarily, the acquisition module 902 is specifically configured to: when the description information of the graphic element is tone mapping information corresponding to the graphic element, acquire a fourth mapping relationship, the fourth mapping relationship comprising a corresponding relationship between a plurality of tone mapping information and a plurality of region information, one tone mapping information corresponding to one or more region information; based on the fourth mapping information, select region information corresponding to the tone mapping information corresponding to the graphic element from the plurality of region information; and based on the region information corresponding to the tone mapping information corresponding to the graphic element, determine the region in which the graphic element is located in the first image.

[0377] In one example, FIG. 10 shows a schematic block diagram of an apparatus 1000 according to the embodiments of the present application. The apparatus 1000 can include a processor 1001 and a transceiver 1002, and optionally further include a memory 1003.

[0378] The various components of the apparatus 1000 are coupled by a bus 1004, which can include a data bus, a power bus, a control bus, and a state signal bus. However, for the sake of clarity, the various buses are shown as a bus 1004.

[0379] Optionally, the memory 1003 can be used to store instructions of the foregoing method embodiments. The processor 1001 can be used to execute the instructions in the memory 1003, and control the transceiver 1002 to receive signals and control the transceiver 1002 to send signals.

[0380] The apparatus 1000 can be a terminal device (or a server) or a chip of a terminal device (or a server) in the foregoing method embodiments.

[0381] Wherein, all relevant contents of each step involved in the foregoing method embodiments can be cited to the function description of the corresponding function module, which will not be repeated here.

[0382] The embodiment of the present application further provides a chip, comprising one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the above-mentioned related method steps are executed to realize the steps of the method in the above-mentioned embodiment. Wherein, the interface circuit is the transceiver 1002.

[0383] The embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and when the computer instructions run on an electronic device, the electronic device executes the above-mentioned related method steps to realize the method in the above-mentioned embodiment. Exemplarily, the computer readable storage medium comprises a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various storage program codes.

[0384] The embodiment of the present application further provides a computer program product, which contains computer instructions, and when the computer instructions are executed by a computer or a processor, the computer executes the above-mentioned related steps to realize the method in the above-mentioned embodiment. Exemplarily, the computer program product can be stored in a random access memory (RAM), a flash memory, a ROM, an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disc (CD-ROM) or any other form of storage medium well-known in the art.

[0385] Wherein, the electronic device, the computer readable storage medium, the computer program product or the chip provided by the embodiment are used to execute the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be described herein again.

[0386] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0387] The units described as separate components may or may not be physically separate, and the components displayed as units may be a physical unit or multiple physical units, that is, may be located in one place, or also can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0388] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0389] Any content of each embodiment of the present application, and any content of the same embodiment, can be freely combined. Any combination of the above is within the scope of the present application.

[0390] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above specific embodiments, and the above specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims, which are all within the protection of the present application.

Claims

1. A data generating method characterized by comprising: The method comprises: acquiring a first image; acquiring description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping a region in which the graphic element is located in the first image; generating first target data based on the first image and the description information of the graphic element.

2. The method of claim 1, wherein, The first image is a high dynamic range (HDR) image, the first image comprises an HDR layer and a standard dynamic range (SDR) layer, the SDR layer comprises the graphic element, the HDR layer comprises a second image, the second image is an HDR image, and a dynamic range of pixel values of pixel points in the region in which the graphic element is located is smaller than a dynamic range of pixel values of pixel points in the second image.

3. The method of claim 2, wherein, A tone mapping manner of the second image is different from a tone mapping manner of the region in which the graphic element is located.

4. The method according to any one of claims 1 to 3, characterized in that, The graphic element comprises at least one of a watermark, a logo, a user interface, and a sticker.

5. The method according to any one of claims 1 to 4, characterized in that, The description information of the graphic element comprises at least one of category information of the graphic element, region information of the region in which the graphic element is located, or tone mapping information corresponding to the graphic element.

6. The method of claim 5, wherein, The region information of the region in which the graphic element is located comprises at least one of a shape of the region in which the graphic element is located, a size of the region in which the graphic element is located, a position of the region in which the graphic element is located, or pixel position mask information of the region in which the graphic element is located.

7. The method according to any one of claims 1 to 6, characterized in that, The generating of the first target data based on the first image and the description information of the graphic element comprises: encoding the first image to obtain a bitstream; writing the description information of the graphic element into the bitstream to obtain the first target data.

8. The method of claim 7, wherein, The encoding of the first image to obtain the bitstream comprises: tone mapping the region in which the graphic element is located in the first image based on the description information of the graphic element to obtain a third image; generating enhancement data based on the first image and the third image, the enhancement data comprising enhancement values of all pixel points in the first image; adjusting the enhancement values of the pixel points in the region in which the graphic element is located in the enhancement data to preset values to obtain adjusted enhancement data; and encoding the third image and the adjusted enhancement data to obtain the bitstream.

9. The method of claim 8, wherein, The tone mapping of the region in which the graphic element is located in the first image based on the description information of the graphic element to obtain the third image comprises: when the description information of the graphic element is the category information of the graphic element or the region information of the region in which the graphic element is located, determining tone mapping information corresponding to the graphic element based on the description information of the graphic element; and tone mapping the region in which the graphic element is located in the first image based on the tone mapping information corresponding to the graphic element to obtain the third image.

10. The method of claim 9, wherein, The determining of the tone mapping information corresponding to the graphic element based on the description information of the graphic element comprises: determining preset tone mapping information as the tone mapping information corresponding to the graphic element.

11. The method of claim 9, wherein, When the description information of the graphical element is category information of the graphical element, the determining, based on the description information of the graphical element, of the tone mapping information corresponding to the graphical element comprises: obtaining a first mapping relationship, the first mapping relationship comprising a correspondence relationship between a plurality of category information and a plurality of tone mapping information, one category information corresponding to one kind of graphical element and one tone mapping information; selecting, based on the first mapping relationship, the tone mapping information corresponding to the category information of the graphical element from the plurality of tone mapping information; determining the tone mapping information corresponding to the category information of the graphical element as the tone mapping information corresponding to the graphical element.

12. The method of claim 9, wherein, When the description information of the graphical element is region information of a region in which the graphical element is located, the determining, based on the description information of the graphical element, of the tone mapping information corresponding to the graphical element comprises: obtaining a second mapping relationship, the second mapping relationship comprising a correspondence relationship between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponding to one or more region information; selecting, based on the second mapping relationship, the tone mapping information corresponding to the region information of the region in which the graphical element is located from the plurality of tone mapping information; determining the tone mapping information corresponding to the region information of the region in which the graphical element is located as the tone mapping information corresponding to the graphical element.

13. The method according to any one of claims 1 to 12, characterized in that, The obtaining of the description information of the graphical element in the first image comprises: generating the description information of the graphical element based on the first image.

14. The method according to any one of claims 1 to 13, characterized in that, The method further comprises: receiving an editing operation for the first image, the editing operation being used to add the graphical element to the first image.

15. The method according to any one of claims 1 to 14, characterized in that, The method further comprises: receiving second target data, the second target data comprising the first image and the description information of the graphical element; The obtaining of the first image comprises: obtaining the first image from the second target data; The obtaining of the description information of the graphical element in the first image comprises: obtaining the description information of the graphical element from the second target data.

16. An image processing method characterized by, The method comprises: obtaining a first image and description information of a graphical element in the first image; determining a region in which the graphical element in the first image is located and tone mapping information corresponding to the graphical element based on the description information of the graphical element; performing tone mapping on the region in which the graphical element in the first image is located based on the tone mapping information corresponding to the graphical element to obtain a target image.

17. The method of claim 16, wherein, The first image is a high dynamic range (HDR) image, the first image comprises an HDR layer and a standard dynamic range (SDR) layer, the SDR layer comprises the graphical element, the HDR layer comprises a second image, the second image is an HDR image, and a dynamic range of pixel values of a pixel point in the region in which the graphical element is located is smaller than a dynamic range of pixel values of a pixel point in the second image.

18. The method of claim 17, wherein, The performing of the tone mapping on the region in which the graphical element in the first image is located based on the tone mapping information corresponding to the graphical element to obtain a target image comprises: The SDR layer is tone mapped based on first tone mapping information corresponding to the graphic element, and the HDR layer is tone mapped based on second tone mapping information corresponding to the second image, to obtain the target image, the first tone mapping information being different from the second tone mapping information.

19. The method of claim 18, wherein, The first tone mapping information is tone mapping information corresponding to the SDR layer; or The first tone mapping information is generated based on the second tone mapping information and third tone mapping information, the third tone mapping information being tone mapping information corresponding to the SDR layer.

20. The method of any one of claims 16-19, wherein, The first image and the description information of the graphic element in the first image are obtained, including: Receiving target data, the target data including the first image and the description information of the graphic element in the first image; From the target data, the first image and the description information of the graphic element in the first image are obtained.

21. The method of any one of claims 16-20, wherein, The description information of the graphic element includes at least one of the following: category information of the graphic element, region information of a region where the graphic element is located, or tone mapping information corresponding to the graphic element.

22. The method according to any one of claims 16 to 21, characterized in that, When the description information of the graphic element is the category information of the graphic element, the tone mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: Obtaining a first mapping relationship, the first mapping relationship including a correspondence relationship between a plurality of category information and a plurality of tone mapping information, one category information corresponding to one graphic element and one tone mapping information; Based on the first mapping relationship, the tone mapping information corresponding to the category information of the graphic element is selected from the plurality of tone mapping information; The tone mapping information corresponding to the category information of the graphic element is determined as the tone mapping information corresponding to the graphic element.

23. The method according to any one of claims 16 to 22, characterized in that, When the description information of the graphic element is the region information of the region where the graphic element is located, the tone mapping information corresponding to the graphic element is determined based on the description information of the graphic element, including: Obtaining a second mapping relationship, the second mapping relationship including a correspondence relationship between a plurality of region information and a plurality of tone mapping information, one tone mapping information corresponding to one or more region information; Based on the second mapping relationship, the tone mapping information corresponding to the region information of the region where the graphic element is located is selected from the plurality of tone mapping information; The tone mapping information corresponding to the region information of the region where the graphic element is located is determined as the tone mapping information corresponding to the graphic element.

24. The method according to any one of claims 16 to 23, characterized in that, When the description information of the graphic element is the category information of the graphic element, the region where the graphic element in the first image is located is determined based on the description information of the graphic element, including: Obtaining a third mapping relationship, the third mapping relationship including a correspondence relationship between a plurality of category information and a plurality of region information, one category information corresponding to one graphic element, the one category information corresponding to one or more region information; select, based on the third mapping relationship, region information corresponding to the category information of the graphic element from the plurality of region information; determine, based on the region information corresponding to the category information of the graphic element, the region in the first image where the graphic element is located.

25. The method according to any one of claims 16 to 24, characterized in that, When the description information of the graphic element is the tone mapping information corresponding to the graphic element, the determining, based on the description information of the graphic element, of the region in the first image where the graphic element is located comprises: obtain a fourth mapping relationship, the fourth mapping relationship comprising a corresponding relationship between a plurality of tone mapping information and a plurality of region information, one tone mapping information corresponding to one or more region information; select, based on the fourth mapping information, region information corresponding to the tone mapping information corresponding to the graphic element from the plurality of region information; determine, based on the region information corresponding to the tone mapping information corresponding to the graphic element, the region in the first image where the graphic element is located.

26. Data, characterized in that, The data comprises a first image and description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping of a region in the first image where the graphic element is located.

27. The data of claim 26, wherein, The data comprises a bitstream, the bitstream comprising encoded data of the first image and encoded data of the description information of the graphic element.

28. The data of claim 26, wherein, The data comprises a bitstream, the bitstream comprising encoded data of the first image.

29. An electronic device, comprising: comprise: a memory and a processor, the memory being coupled to the processor; the memory stores program instructions, when the program instructions are executed by the processor, the electronic device performs the method in any one of claims 1 to 25.

30. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program runs on a computer or a processor, the computer or the processor executes the method in any one of claims 1 to 25.

31. A computer program product, characterised in that, The computer program product comprises computer instructions, when the computer instructions are executed by a computer or a processor, the steps of the method in any one of claims 1 to 25 are executed.

32. A computer-readable storage medium, comprising: The computer readable storage medium stores data, the data comprising a first image and description information of a graphic element in the first image, the description information of the graphic element being used for tone mapping of a region in the first image where the graphic element is located.

Citation Information

Patent Citations

  • User interface and graphics composition with high dynamic range video

    US20150245004A1

  • Graphics-safe HDR image luminance re-grading

    US20200193935A1

  • Controlling display brightness when rendering composed scene-referred and output-referred content

    US20210027435A1

  • Video processing method and apparatus

    WO2023160295A1

  • HDR image editing method and apparatus, electronic device, and readable storage medium

    WO2024001829A1