Tone conversion method and device, electronic equipment and readable medium

By performing personalized mapping brightness conversion for each pixel, the overexposure problem caused by uniform mapping brightness in the existing technology is solved, and the editing and playback effects of multimedia materials are improved.

CN120856871APending Publication Date: 2025-10-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410509820.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing tone conversion methods easily cause overexposure of some areas when uniformly mapping brightness conversion of multimedia materials, resulting in poor editing or playback effects, or even loss of detailed content.

Method used

A personalized mapping brightness is determined for each pixel, and a reasonable grayscale value variation is obtained through tone mapping to limit the grayscale value difference within a reasonable range and avoid overexposure.

Benefits of technology

Improves the tonal conversion effect, avoids loss of details in overexposed areas, and improves the editing and playback quality of multimedia materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120856871A_ABST
    Figure CN120856871A_ABST
Patent Text Reader

Abstract

The invention discloses a hue conversion method and device, electronic equipment and a readable medium, and the method comprises the steps: obtaining a first material with a first hue attribute, and the first material comprises a first pixel point and a second pixel point; performing tone mapping on the first material to obtain a second material with a second tone attribute, the second material comprising a third pixel point and a fourth pixel point, the third pixel point being a pixel point obtained by performing tone mapping on the first pixel point according to the first mapping brightness, and the fourth pixel point being a pixel point obtained by performing tone mapping on the first pixel point according to the first mapping brightness; the fourth pixel point is a pixel point obtained by performing tone mapping on the second pixel point according to second mapping brightness, and the first mapping brightness is different from the second mapping brightness. Therefore, the reasonable mapping brightness can be determined for each pixel point of the to-be-converted material according to the gray values of the pixel point before and after conversion, and the pixel point is converted according to the reasonable mapping brightness, so that the tone conversion effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of media processing technology, and more particularly to a tone conversion method, apparatus, electronic device, and readable medium. Background Technology

[0002] During multimedia editing or playback, if a display device only supports one of the multiple media with different color attributes, then in order to ensure the editing or playback effect of the multimedia, it is necessary to convert the media with the color attribute that the display device does not support into the media with the color attribute that the display device supports.

[0003] However, current color conversion methods typically apply to the entire image, meaning the source material is converted using a uniform mapped brightness to obtain the converted material. But within the entire image of the source material, different areas have varying brightness levels. Using current color conversion methods can easily lead to overexposure in some areas, resulting in poor editing or playback quality of the converted material, or even loss of detail in the overexposed areas. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a tone conversion method, apparatus, electronic device, and readable medium, which can determine a corresponding reasonable mapping brightness for each pixel of the material to be converted, and convert the pixel according to the reasonable mapping brightness to obtain material with better editing or playback effects.

[0005] To achieve the above objectives, the technical solution provided in this application is as follows:

[0006] Firstly, this application provides a tone conversion method, including:

[0007] Obtain the first material with the first color tone attribute, the first material including the first pixel and the second pixel;

[0008] A second material with a second hue attribute is obtained by performing hue mapping on the first material. The second material includes a third pixel and a fourth pixel. The third pixel is obtained by hue mapping the first pixel according to a first mapping brightness. The fourth pixel is obtained by hue mapping the second pixel according to a second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is a mapping brightness that makes the gray value of the third pixel satisfy a first condition with the gray value of the first pixel. The second mapping brightness is a mapping brightness that makes the gray value of the fourth pixel satisfy the first condition with the gray value of the second pixel. The first condition is used to limit the change of the gray value of the pixel after hue mapping.

[0009] In one possible implementation, the first condition includes:

[0010] For a single pixel, the difference between the grayscale value after tone mapping and the grayscale value before tone mapping is less than or equal to a preset first grayscale threshold.

[0011] In one possible implementation, the first condition further includes:

[0012] For a single pixel, the difference between the preset second grayscale threshold and the grayscale value after tone mapping is less than or equal to the preset third grayscale threshold, where the second grayscale threshold is the grayscale value of white.

[0013] In one possible implementation, the step of performing tone mapping on the first material to obtain the second color attribute includes:

[0014] The first pixel of the first material is hue-converted according to the third mapping brightness to obtain the fifth pixel;

[0015] If the gray value of the fifth pixel does not meet the first condition with the gray value of the first pixel, then the third mapping brightness is updated, and the first pixel is hue-converted according to the updated third mapping brightness.

[0016] If the grayscale value of the fifth pixel and the grayscale value of the first pixel satisfy the first condition, then the fifth pixel is taken as the third pixel in the second material, and the third mapped brightness corresponding to the third pixel is recorded as the first mapped brightness.

[0017] In one possible implementation, updating the third mapped brightness includes:

[0018] A fourth mapping brightness is obtained based on the number of times the tone mapping of the first pixel is performed and the third mapping brightness, wherein the fourth mapping brightness is less than the third mapping brightness;

[0019] If the fourth mapped brightness satisfies the second condition, then the fourth mapped brightness is recorded as the updated third mapped brightness, and the second condition is used to indicate that the fourth mapped brightness matches the second hue attribute.

[0020] In one possible implementation, the step of performing tone mapping on the first material to obtain the second tone attribute includes:

[0021] For the first pixel of the first material, the electrical signal of the first hue attribute is converted into the light signal of the first hue attribute;

[0022] According to the first mapped brightness, the light signal of the first hue attribute is converted into the first light signal of the second hue attribute;

[0023] The first light signal is converted to a color space to obtain a second light signal with the second hue attribute;

[0024] The second light signal is converted into an electrical signal of the second hue attribute, and the electrical signal of the second hue attribute corresponds to the third pixel in the second material.

[0025] In one possible implementation, obtaining the first material with the first hue attribute includes:

[0026] In response to a tone conversion operation in a multimedia editing or playback task, the first material belonging to the first tone attribute in the multimedia editing or playback task is obtained;

[0027] After performing tone mapping on the first material to obtain a second material with a second tone attribute, the method further includes:

[0028] In the multimedia editing or playback task, the first material is replaced with the second material.

[0029] In one possible implementation, the first tone attribute is High Dynamic Range (HDR), the first material is HDR material, the second tone attribute is Standard Dynamic Range (SDR), and the second material is SDR material.

[0030] Secondly, this application provides a tone conversion device, comprising:

[0031] The acquisition unit is used to acquire a first material with a first tone attribute, wherein the first material includes a first pixel and a second pixel.

[0032] A conversion unit is used to perform tone mapping on the first material to obtain a second material with a second tone attribute. The second material includes a third pixel and a fourth pixel. The third pixel is a pixel obtained by tone mapping the first pixel according to a first mapping brightness. The fourth pixel is a pixel obtained by tone mapping the second pixel according to a second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is a mapping brightness that makes the gray value of the third pixel satisfy a first condition with the gray value of the first pixel. The second mapping brightness is a mapping brightness that makes the gray value of the fourth pixel satisfy the first condition with the gray value of the second pixel. The first condition is used to limit the change of the gray value of the pixel after tone mapping.

[0033] In one possible implementation, the first condition includes:

[0034] For a single pixel, the difference between the grayscale value after tone mapping and the grayscale value before tone mapping is less than or equal to a preset first grayscale threshold.

[0035] In one possible implementation, the first condition further includes:

[0036] For a single pixel, the difference between the preset second grayscale threshold and the grayscale value after tone mapping is less than or equal to the preset third grayscale threshold, where the second grayscale threshold is the grayscale value of white.

[0037] In one possible implementation, the conversion unit includes:

[0038] The first conversion subunit is used to convert the first pixel of the first material according to the third mapping brightness to obtain the fifth pixel;

[0039] An update subunit is configured to update the third mapping brightness and perform hue conversion on the first pixel according to the updated third mapping brightness if the gray value of the fifth pixel does not meet the first condition.

[0040] An output subunit is configured to, if the grayscale value of the fifth pixel and the grayscale value of the first pixel satisfy the first condition, then use the fifth pixel as the third pixel in the second material, and the third mapped brightness corresponding to the third pixel is denoted as the first mapped brightness.

[0041] In one possible implementation, the updating subunit is specifically used for:

[0042] A fourth mapping brightness is obtained based on the number of times the tone mapping of the first pixel is performed and the third mapping brightness, wherein the fourth mapping brightness is less than the third mapping brightness;

[0043] If the fourth mapped brightness satisfies the second condition, then the fourth mapped brightness is recorded as the updated third mapped brightness, and the second condition is used to indicate that the fourth mapped brightness matches the second hue attribute.

[0044] In one possible implementation, the forwarding unit includes:

[0045] The second conversion subunit is used to convert the first pixel of the first material from an electrical signal of the first hue attribute to a light signal of the first hue attribute.

[0046] The third conversion subunit is used to convert the light signal of the first hue attribute into the first light signal of the second hue attribute according to the first mapped brightness.

[0047] The fourth conversion subunit is used to perform color space conversion on the first optical signal to obtain a second optical signal with the second hue attribute;

[0048] The fifth conversion subunit is used to convert the second optical signal into an electrical signal of the second hue attribute, wherein the electrical signal of the second hue attribute corresponds to the third pixel in the second material.

[0049] In one possible implementation, the acquiring unit is specifically used for:

[0050] In response to a tone conversion operation in a multimedia editing or playback task, the first material belonging to the first tone attribute in the multimedia editing or playback task is obtained;

[0051] The device further includes:

[0052] The replacement unit is used to replace the first material with the second material in the multimedia editing or playback task after the first material has been tone-mapped to obtain a second material with a second tone attribute.

[0053] In one possible implementation, the first tone attribute is High Dynamic Range (HDR), the first material is HDR material, the second tone attribute is Standard Dynamic Range (SDR), and the second material is SDR material.

[0054] It should be noted that the specific implementation method of the device and the technical effects achieved can be found in the relevant description of the method provided in the first aspect or any implementation method of the first aspect.

[0055] Thirdly, this application also provides an electronic device, which includes: a processor and a memory;

[0056] The memory is used to store instructions or programs;

[0057] The processor is configured to execute the instructions or programs in the memory to cause the electronic device to perform the method provided by the first aspect or any implementation thereof.

[0058] Fourthly, this application also provides a readable medium storing instructions or programs that, when executed on a processor, cause the processor to perform the method provided in the first aspect or any implementation thereof.

[0059] Compared with the prior art, the embodiments of this application have at least the following advantages:

[0060] The technical solution provided in this application offers a tone conversion method. This method is applied to a tone conversion device, which may be, for example, a functional module on a multimedia editing or playback client of a display device. The method may include, for example, the following steps: First, acquiring a first material with a first tone attribute, the first material including a first pixel and a second pixel; then, performing tone mapping on the first material to obtain a second material with a second tone attribute, the second material including a third pixel and a fourth pixel. The third pixel is obtained by tone mapping the first pixel according to a first mapped brightness, and the fourth pixel is obtained by tone mapping the second pixel according to a second mapped brightness. The first mapped brightness is different from the second mapped brightness. The first mapped brightness is a mapping brightness that satisfies a first condition between the grayscale value of the third pixel and the grayscale value of the first pixel, and the second mapped brightness is a mapping brightness that satisfies a first condition between the grayscale value of the fourth pixel and the grayscale value of the second pixel. The first condition is used to limit the change in the grayscale value of the pixel after tone mapping. In this way, for each pixel in the material to be converted, a reasonable mapping brightness can be determined for that pixel based on its grayscale value in both the material to be converted and the converted material. The pixel is then converted according to this reasonable mapping brightness, ensuring that each pixel in the converted material is converted according to a reasonable mapping brightness for that pixel. This improves the tone conversion effect and overcomes the problem that converting the entire image of the material to be converted according to a uniform mapping brightness can easily lead to overexposure in some areas, resulting in poor editing or playback effects of the converted material, or even loss of details in overexposed areas. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0062] Figure 1 A schematic flowchart illustrating a tone conversion method provided in an embodiment of this application;

[0063] Figure 2 A schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0064] Figure 3 A schematic diagram illustrating another application scenario provided by an embodiment of this application;

[0065] Figure 4 A schematic diagram illustrating an example of a tone conversion method provided in an embodiment of this application;

[0066] Figure 5 This is a schematic diagram of the structure of a tone conversion device 500 provided in an embodiment of this application;

[0067] Figure 6 This is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of this application. Detailed Implementation

[0068] With the development of the internet, the dissemination of multimedia files has enriched people's work and lives. Multimedia materials are usually presented to users through editing or playback, which requires multimedia editing or playback clients. These clients are downloaded and installed on display devices with display capabilities, such as mobile phones, tablets, or laptops.

[0069] Taking video in multimedia materials as an example, there may be many videos with different tonal attributes, such as High Dynamic Range (HDR) videos and Standard Dynamic Range (SDR) videos. However, some display devices only support videos with certain tonal attributes. If the display device directly uses unsupported tonal attributes to edit or play materials, it will cause problems such as overexposure and distortion in the edited or played materials. For example, some display devices do not support HDR display. If HDR videos are played directly on such display devices, it will cause problems such as overexposure and distortion in the played images. Therefore, the multimedia editing or playback client on the display device needs to provide the ability to perform corresponding tonal attribute conversion on the multimedia materials. For example, for display devices that do not support HDR display, the multimedia editing or playback client installed on the display device needs to provide the ability to convert HDR videos to SDR videos, i.e., the tonal conversion device mentioned in the embodiments of this application.

[0070] Currently, several algorithms exist for converting the tone attributes of multimedia materials. However, these algorithms typically do not produce very good results. For example, tone conversion algorithms for converting HDR video to SDR video include Reinhard, Filmic, and Hable. However, these algorithms convert the overall granularity of the HDR video image; that is, they convert the lower brightness of the HDR video to the higher brightness of the SDR video using a uniform mapping brightness. However, because different areas of the HDR video have different brightness levels, areas that are inherently bright in the HDR video may become overexposed in the converted SDR video after being converted to the same mapping brightness as other areas. This results in the user being unable to see the corresponding details in those areas, thus reducing the user's editing or viewing experience of the converted SDR video.

[0071] Based on this, embodiments of this application provide a tone conversion method, which may include, for example,: first, obtaining a first material with a first tone attribute, the first material including a first pixel and a second pixel; then, performing tone mapping on the first material to obtain a second material with a second tone attribute, the second material including a third pixel and a fourth pixel, the third pixel being a pixel obtained by tone mapping the first pixel according to a first mapped brightness, and the fourth pixel being a pixel obtained by tone mapping the second pixel according to a second mapped brightness, wherein the first mapped brightness and the second mapped brightness are different. Wherein, the first mapped brightness is the mapping brightness that makes the grayscale value of the third pixel satisfy a first condition with the grayscale value of the first pixel, and the second mapped brightness is the mapping brightness that makes the grayscale value of the fourth pixel satisfy a first condition with the grayscale value of the second pixel, the first condition being used to limit the change in the grayscale value of the pixel after tone mapping.

[0072] In this way, the tone conversion device can determine the corresponding reasonable mapped brightness for each pixel of the material to be converted, based on the grayscale value of that pixel in both the material to be converted and the converted material. The conversion is then performed on the pixel according to the reasonable mapped brightness, so that each pixel in the converted material is converted according to the reasonable mapped brightness for that pixel. This improves the tone conversion effect and overcomes the problem that converting the entire image of the material to be converted with a uniform mapped brightness can easily lead to overexposure in the corresponding areas of the material that are already bright. This results in poor editing or playback effects of the converted material, or even loss of details in the overexposed areas.

[0073] It should be noted that the entity implementing this tone conversion method can be the tone conversion device provided in the embodiments of this application. This tone conversion device can be housed in an electronic device or a functional module of an electronic device. Specifically, the tone conversion device can be a functional module on a multimedia editing or playback client of a display device that can implement the tone conversion function provided in the embodiments of this application.

[0074] Figure 1 This is a schematic flowchart illustrating a tone conversion method provided in an embodiment of this application. This method can be applied to a tone conversion device, which, for example, can be... Figure 5 The color conversion device 500 shown.

[0075] like Figure 1 As shown, the method may include, for example, the following S101 to S102:

[0076] S101, Obtain the first material with the first tone attribute, which includes the first pixel and the second pixel.

[0077] S102, perform tone mapping on the first material to obtain a second material with a second tone attribute. The second material includes a third pixel and a fourth pixel. The third pixel is a pixel obtained by tone mapping the first pixel according to the first mapping brightness. The fourth pixel is a pixel obtained by tone mapping the second pixel according to the second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is the mapping brightness that makes the gray value of the third pixel satisfy the gray value of the first pixel satisfy the first condition. The second mapping brightness is the mapping brightness that makes the gray value of the fourth pixel satisfy the gray value of the second pixel satisfy the first condition. The first condition is used to limit the change of the gray value of the pixel after tone mapping.

[0078] The first and second materials can be any multimedia materials that can be edited or played, such as videos or pictures.

[0079] Tonal attributes refer to any characteristic of multimedia material that needs to be consistently maintained during editing or playback. The first tonal attribute can be understood as a tonal attribute not supported by the display device, while the second tonal attribute is a tonal attribute supported by the display device. For example, the first tonal attribute could refer to HDR, and the second tonal attribute could refer to SDR.

[0080] In this embodiment, prior to S101, a user can discover a first material belonging to a first hue attribute in a multimedia editing or playback task within the multimedia editing or playback client, and then trigger a hue conversion operation in the client. S101 can then include: in response to the hue conversion operation, the hue conversion device can acquire the first material belonging to the first hue attribute in the multimedia editing or playback task, and execute the method provided in this embodiment to convert the first material into a second material with a second hue attribute. Thus, in the multimedia editing or playback task, the first material is replaced with the second material, ensuring that the multimedia editing or playback task uses the second hue attribute supported by the display device. Furthermore, because the hue conversion effect in this embodiment is better, the multimedia editing or playback task can provide a better multimedia editing or playback experience for the user.

[0081] As an example, see Figure 2 or Figure 3 The multimedia editing page shown may include a title area, a tool area, an editing area, and a player. Within the editing area, a track may include Material 1 and Material 2. Material 1 could be, for example, an SDR video, and Material 2 could be, for example, an HDR video. The title area may display, for example, the name of the multimedia editing tool and / or the name of the multimedia editing task, such as... Figure 1 As shown, the title area can display "Multimedia Editing Tool A: New Multimedia Editing Task 1"; the tool area can include the names of various tools, such as... Figure 1 As shown, the tool names are exemplified by "XXXX", "ZZZZ", "AAAA", and "BBBB". The player is used to display the editing effects of various materials, reflecting the final result after exporting.

[0082] Assuming the draft for multimedia editing task 1 has an SDR color tone attribute, then in one case, such as Figure 2 As shown, when the user inserts material 2 ( Figure 2 After inserting new material (using a bold, gray-filled box to represent it), the multimedia editor page will display a pop-up message indicating a color space inconsistency. Users can trigger the color conversion scheme provided in this embodiment or abandon the conversion by manipulating the controls in the prompt. For example, the pop-up window on the multimedia editor page might be titled "Color Space Inconsistency" and its text might be "Change Material 2 to SDR Video?". This pop-up window could include two buttons: "Color Conversion" and "Abandon." Clicking "Color Conversion" is equivalent to performing a color conversion operation, triggering the conversion. Figure 1 Or below Figure 4 The method shown; if the user clicks "Abandon", the color tone conversion of material 2 will not be performed temporarily.

[0083] In another case, such as Figure 3 As shown, users can view draft parameters on the multimedia editing page, which includes Material 1 and Material 2. The window, such as a drawer, can include a "Modify" button. When a user wants to trigger the color conversion scheme provided in this embodiment, they can click the "Modify" button. A "Draft Settings" window will pop up on the multimedia editing page, where the user can change the color attribute of Material 2 from HDR to SDR and confirm. This is equivalent to the user performing a color conversion operation, triggering the execution of the scheme. Figure 1 Or below Figure 4 The method shown.

[0084] The above Figure 2 and Figure 3 The examples used in this application all illustrate how to trigger the execution of the methods provided in the embodiments of this application in the context of multimedia editing. For multimedia playback scenarios, multimedia playback clients may also have similar ways to trigger the execution of the methods provided in the embodiments of this application, which will not be elaborated upon in this application.

[0085] For the first pixel in the first material, S102 may include, for example: S1021, converting the first pixel to a third mapped brightness to obtain the fifth pixel; S1022, determining whether the grayscale value of the fifth pixel satisfies the first condition with the grayscale value of the first pixel. If not, proceed to S1023; if so, proceed to S1024; S1023, updating the third mapped brightness, and returning to S1021 according to the updated third mapped brightness; S1024, using the fifth pixel as the third pixel in the second material, and recording the third mapped brightness corresponding to the third pixel as the first mapped brightness.

[0086] Similarly, for the second pixel in the first material, S102 may include, for example: S1021', converting the second pixel to a certain tone according to the fourth mapped brightness to obtain the sixth pixel; S1022', determining whether the grayscale value of the sixth pixel and the grayscale value of the second pixel satisfy the first condition. If not, then execute S1023'; if so, then execute S1024'; S1023', updating the fourth mapped brightness, and returning to execute S1021' according to the updated fourth mapped brightness; S1024', using the sixth pixel as the fourth pixel in the second material, and recording the fourth mapped brightness corresponding to the fourth pixel as the second mapped brightness.

[0087] For a single tone mapping in this embodiment, taking a first pixel in the first material as an example, the execution process of S1021 may include: S11, converting the electrical signal of the first pixel from a first tone attribute to a light signal of the first tone attribute; S12, converting the light signal of the first tone attribute to a first light signal of a second tone attribute according to a third mapping brightness; S13, performing color space conversion on the first light signal of the second tone attribute to obtain a second light signal of the second tone attribute; S14, converting the second light signal of the second tone attribute to an electrical signal of the second tone attribute, wherein the electrical signal of the second tone attribute corresponds to a third pixel in the second material. In this way, a single conversion of a pixel from a first tone attribute to a second tone attribute can be achieved.

[0088] If the first color tone attribute can be HDR and the second transmission characteristic can be SDR, then the first material is HDR material and the second material is SDR material. Taking this scene as an example, a conversion process from HDR to SDR can include: S11', converting each pixel of the first material from HDR electrical signal to HDR light signal; S12', converting the HDR light signal to a first SDR light signal according to the brightness mapping of this conversion; S13', performing color space conversion on the first SDR light signal to obtain a second SDR light signal; S14', converting the second SDR light signal to an SDR electrical signal, which corresponds to each pixel of the second material. In this way, a conversion from HDR to SDR can be achieved.

[0089] S11' can be achieved through the Electro-Optical Transfer Function (EOTF) of HDR, that is, the HDR electrical signal (i.e. HDR material) is input into the HDR EOTF, and the HDR EOTF outputs the HDR optical signal.

[0090] For S12', the HDR electrical signal is input to the tone mapping algorithm, which outputs the first SDR light signal. During the first conversion, the first mapped brightness can be understood as the initial mapped brightness, which can be the mapped brightness corresponding to the tone mapping algorithm used. For example, if the tone mapping algorithm used is Method C of the BT.2446 standard, then the first mapped brightness is 75% HLG - 203 nits, where HLG is a specific type of HDR material, and HLG can be understood as the brightness value corresponding to that specific type; 203 is a number defined in this standard; and nit is the unit of brightness value: nits. As another example, if the tone mapping algorithm used is Method A of the BT.2446 standard, then the first mapped brightness is 1000 nits. In subsequent conversions, the first mapped brightness can be an updated first mapped brightness determined based on the first mapped brightness and the number of conversions, as detailed in the section on distance below.

[0091] S13' is used to realize the color space conversion of the SDR optical signal. For example, the first SDR optical signal can be converted from the 2020 color gamut to the 709 color gamut. The converted SDR optical signal is denoted as the second SDR optical signal in S13'.

[0092] For S14', it can be achieved through the Optical-Electrical Transfer Function (OETF) of SDR. That is, the second SDR optical signal is input into the SDR OETF, and the SDR OETF outputs an SDR electrical signal (i.e. SDR material). The SDR electrical signal corresponds to the second material after one conversion. Specifically, the SDR electrical signal corresponds to each pixel of the second material after one conversion.

[0093] It should be noted that during the implementation of S11' to S14', each RGB (red, green, blue) pixel in the HDR material can be converted separately to obtain the corresponding pixel in the SDR material.

[0094] For ease of understanding, mapped brightness can be understood as a scaling factor K. For example, if the brightness of a pixel in the first source material is A, then after the tone mapping of this mapped brightness, the brightness of the corresponding pixel in the second source material can be expressed as B, where B = A * K.

[0095] As can be seen, the intermediate conversion result after one conversion can be obtained through S1021, which provides the prerequisite for the subsequent steps to output the final conversion result.

[0096] The first condition (also known as the constraint condition) can be used to indicate that the mapped brightness of the same pixel is reasonable after the conversion from the first material to the second material. Reasonableness can be understood as a restriction on the grayscale change after tone mapping. For S1022, if it is determined that the grayscale value of the fifth pixel does not meet the first condition with the grayscale value of the first pixel, it is considered that the currently used third mapping brightness needs to be updated, and tone mapping continues according to the updated third mapping brightness (i.e., execute S1023 and return to execute S1021); if it is determined that the grayscale value of the fifth pixel meets the first condition with the grayscale value of the first pixel, it is considered that the currently used third mapping brightness is reasonable, and there is no need to adjust and continue tone mapping. The fifth pixel after the current tone mapping can be output as the third pixel in the second material in S102, as the final conversion result of the first pixel.

[0097] Prior to S1022, the method may further include: calculating a first grayscale value for each pixel in the first material and a second grayscale value for the corresponding pixel in the second material. This provides a basis for determining whether to execute S1022 in this embodiment.

[0098] As an example, the first condition could include: the difference between the second grayscale value and the first grayscale value does not exceed a preset first grayscale threshold (e.g., 10). If the first grayscale value and the second grayscale value of a pixel do not meet the first condition, it means that the difference between the second grayscale value and the first grayscale value of that pixel exceeds the first grayscale threshold. This indicates that the currently used mapping brightness for tone mapping is unreasonable (i.e., the currently used mapping brightness is too high) and needs adjustment. Conversely, if the first grayscale value and the second grayscale value of a pixel meet the first condition, it means that the difference between the second grayscale value and the first grayscale value of that pixel does not exceed the first grayscale threshold. This indicates that the currently used mapping brightness for tone mapping is reasonable (i.e., the currently used mapping brightness ensures that the content of that pixel will not be distorted after conversion), and no adjustment is needed; it can be output directly.

[0099] In this example, for the first pixel of the first material, S1022 may include: determining whether the difference between the second grayscale value of the fifth pixel and the first grayscale value of the first pixel is less than or equal to a first grayscale threshold; if so, the first condition is considered met, and S1024 is executed; otherwise, S1023 is executed. Here, the fifth pixel is the pixel corresponding to the first pixel in the material obtained after a certain tone conversion.

[0100] As another example, the first condition, in addition to including the difference between the second grayscale value and the first grayscale value exceeding a preset first grayscale threshold, may also include: the difference between the second grayscale threshold and the second grayscale value being less than or equal to a preset third grayscale threshold (e.g., 2), where the second grayscale threshold is a white grayscale value (i.e., 255). In other words, it may be whether the second grayscale value is close to 255. Therefore, if the first grayscale value and the second grayscale value of a pixel satisfy the first condition, it means that the difference between the second grayscale value and the first grayscale value of that pixel is less than or equal to the first grayscale threshold, or that the second grayscale value of that pixel is close to 255. This indicates that the currently used mapping brightness is reasonable for tone mapping (i.e., the currently used mapping brightness ensures that the content of the pixel will not be distorted after conversion, or that the pixel itself is close to white and therefore will not have overexposure issues). No adjustment is needed, and it can be directly output. Conversely, if the first gray value and the second gray value of a certain pixel do not meet the first condition, it can mean that the difference between the second gray value and the first gray value of the pixel exceeds the first gray value threshold, or that the second gray value of the pixel is not close to 255. This indicates that the currently used mapping brightness is unreasonable for tone mapping and the mapping brightness needs to be adjusted.

[0101] In this example, for the first pixel of the first material, S1022 may include: determining whether the difference between the second gray value of the fifth pixel and the first gray value of the first pixel is less than or equal to the first gray value threshold, and determining whether the difference between 255 and the second gray value of the fifth pixel is less than or equal to the third gray value threshold. If either determination result is yes, then the first condition is considered to be satisfied, and S1024 is executed; otherwise, if both determination results are no, S1023 is executed.

[0102] S1023 can be used to reduce the third mapping brightness, thereby lowering the brightness of the corresponding pixel after the conversion and preventing overexposure. The method for updating the third mapping brightness can be determined based on the tone conversion algorithm. As an example, S1023 may include: calculating the fourth mapping brightness based on the number of tone mappings to the first pixel and the third mapping brightness, where the fourth mapping brightness is less than the third mapping brightness, and thus recording the fourth mapping brightness as the updated third mapping brightness. For example, if the third mapping brightness is 75%HLG-203nit when S1021 is executed for the first time, then the updated third mapping brightness can be expressed as 75%HLG-(203-i*20)nit, where i is the number of tone mappings to the first pixel. In the first update of the third mapping brightness, i=1, and the updated third mapping brightness is 75%HLG-183nit; in the second update of the third mapping brightness, i=2, and the updated third mapping brightness is 75%HLG-163nit. For example, if the third mapping brightness is 1000 nits when S1023 is executed for the first time, then the updated third mapping brightness can be expressed as 1000-(i*200) nits, where i is the number of tone mappings to the first pixel. When the third mapping brightness is updated for the first time, i=1, and the updated third mapping brightness is 800 nits; when the third mapping brightness is updated for the second time, i=2, and the updated third mapping brightness is 600 nits.

[0103] It should be noted that, in order to ensure that the updated third mapped brightness matches the converted second tone attribute (for example, if the second tone attribute is SDR, and the brightness range of the SDR electrical signal of the updated third mapped brightness is required to be between 0 and 100 nits), after updating the third mapped brightness to the fourth mapped brightness, it can be determined whether the fourth mapped brightness meets the second condition. If it does, it indicates that the update of the third mapped brightness can make the converted fourth mapped brightness match the second tone attribute (e.g., the brightness range of the SDR electrical signal is between 0 and 100 nits), so the fourth mapped brightness can be recorded as the updated third mapped brightness. Otherwise, it is considered that the update of the third mapped brightness makes the converted fourth mapped brightness not match the second tone attribute, so the fourth mapped brightness is not recorded as the updated third mapped brightness, and the pixel after tone mapping under the currently used mapped brightness can be directly output to the second material. The second condition can be flexibly determined based on the method of updating the third mapping brightness. For example, when the updated third mapping brightness is expressed as 75% HLG - (203 - i * 20) nits, the second condition can be expressed as (203 - i * 20) greater than 100. Therefore, the numbers "20" and "200" in the updated third mapping brightness can be flexibly set based on the maximum allowed number of tone mappings to the first pixel and the second condition. The above-described method of updating the third mapping brightness is merely exemplary and does not constitute a specific limitation on the updating of the third mapping brightness in the embodiments of this application.

[0104] For S1024, it can be considered that a certain pixel meets the first condition after a certain transformation, and there is no need to perform the next tone mapping. The pixel obtained by the current tone mapping can be directly output to the second material. That is, the second material obtained by the final transformation includes the pixel obtained by the current transformation.

[0105] For example, if the first material includes a first pixel and a second pixel, and the mapped brightness 1 is 75% HLG-203 nit during the first conversion, the tone conversion process for the first pixel may include: S21, converting the first pixel based on mapped brightness 1 to obtain a third pixel 1; S22, determining that the second grayscale value of the third pixel 1 does not satisfy the first condition with the first grayscale value of the first pixel, and updating the mapped brightness to mapped brightness 2, represented as 75% HLG-183 nit; S23, converting the first pixel based on mapped brightness 2... The process involves several steps: S21, converting the first pixel to obtain the third pixel 2; S24, determining that the second grayscale value of the third pixel 2 does not satisfy the first condition with the first grayscale value of the first pixel, updating the mapped brightness to mapped brightness 3, represented as 75% HLG-163nit; S25, converting the first pixel based on mapped brightness 3 to obtain the third pixel 3; S26, determining that the second grayscale value of the third pixel 3 satisfies the first condition with the first grayscale value of the first pixel, and outputting the third pixel 3 to the second material, i.e., the pixel in the second material corresponding to the first pixel is the third pixel 3. The tone conversion process for the second pixel may include: S31, converting the second pixel based on mapped brightness 1 to obtain the fourth pixel 1; S32, determining that the second grayscale value of the fourth pixel 1 satisfies the first condition with the first grayscale value of the second pixel, and outputting the fourth pixel 1 to the second material, i.e., the pixel in the second material corresponding to the second pixel is the fourth pixel 1. Therefore, the conversion result after converting the first material to the second tone attribute—the second material—can include both the third pixel 3 and the fourth pixel 1.

[0106] It should be noted that the grayscale value in the embodiments of this application can be calculated by calculating the grayscale value of RGB pixels. The embodiments of this application do not limit the method of calculating the grayscale value of RGB pixels.

[0107] As can be seen, through this method, the tone conversion device can determine a reasonable mapped brightness for each pixel in the material to be converted, based on the grayscale value of that pixel in both the material to be converted and the converted material. The device then converts the pixel according to this reasonable mapped brightness, ensuring that each pixel in the converted material is converted according to a reasonable mapped brightness for that pixel. This improves the tone conversion effect and overcomes the problem that converting the entire image of the material to be converted with a uniform mapped brightness can easily lead to overexposure in areas of already high brightness in the material, resulting in poor editing or playback effects, or even loss of details in overexposed areas.

[0108] To make the method provided in this application's embodiments clearer and more complete, taking an example where the first tone attribute is HDR, the first material is HDR material, the second tone attribute is SDR, and the second material is SDR material, combined with... Figure 4 An exemplary embodiment of the process for converting HDR footage to SDR footage is described.

[0109] like Figure 4 As shown, the method may include, for example:

[0110] S201, Obtain HDR video 1 to be converted.

[0111] S202, calculate the grayscale value G1 of the RGB pixels in the HDR video 1 to be converted (also known as HDR electrical signal 1).

[0112] S203, perform HDR EOTF on the RGB pixels of HDR video 1 to obtain HDR light signal 1.

[0113] S204, use the Method C algorithm under the BT.2446 standard to perform tone mapping on HDR light signal 1 according to the first mapped brightness to obtain SDR light signal 1.

[0114] The first mapped brightness during the first execution of S204 is 75% of the standard HLG-203 nit.

[0115] S205 performs color space conversion on SDR optical signal 1, converting it from the 2020 color gamut to the 709 color gamut, to obtain SDR optical signal 2.

[0116] S206, SDR optical signal 2 is converted using SDR OETF to obtain SDR electrical signal 1 (also known as SDR video 1).

[0117] S207, calculate the grayscale value G2 of the RGB pixel under SDR electrical signal 1.

[0118] S208: Determine if G2 is close to 255 and if G2-G1 is less than or equal to the threshold T. If not, update the first mapped brightness and return to execute S204 and subsequent steps. If yes, output the RGB value of the current pixel as the RGB value of the corresponding pixel in the final converted SDR video 2.

[0119] If yes, it can mean that G2 is close to 255, or that G2-G1 is less than or equal to the threshold T; if no, it can mean that G2 is not close to 255 and G2-G1 is greater than the threshold T.

[0120] The updated first mapped brightness is 75% HLG - (203 - i * 20) nits, where i is the number of times the first pixel is mapped. When updating the first mapped brightness for the first time, i = 1; when updating it for the second time, i = 2, and so on. It is necessary to ensure that (203 - i * 20) > 100 to avoid abnormalities in the edited or played image after conversion, and to prevent excessive conversions from affecting the performance of the tone conversion.

[0121] It should be noted that there is no order restriction on the execution of S202 and S203 to S207. S202 can be executed first and then S203 to S207, or S203 to S207 can be executed first and then S202, or S202 and S203 to S207 can be executed simultaneously.

[0122] As can be seen, by using this method, which is a pixel-by-pixel conversion and uses a corresponding reasonable first mapped brightness for each pixel, HDR video 1 can be converted into SDR video 2. There will be no overexposure problem in SDR video 2, so that the editing or playback effect of HDR video 1 can be guaranteed on display devices that do not support HDR.

[0123] Accordingly, embodiments of this application also provide a tone conversion device 500, such as... Figure 5 As shown. The device 500 may include:

[0124] The acquisition unit 501 is used to acquire a first material with a first tone attribute, wherein the first material includes a first pixel and a second pixel.

[0125] The conversion unit 502 is used to perform tone mapping on the first material to obtain a second material with a second tone attribute. The second material includes a third pixel and a fourth pixel. The third pixel is a pixel obtained by tone mapping the first pixel according to a first mapping brightness. The fourth pixel is a pixel obtained by tone mapping the second pixel according to a second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is a mapping brightness that makes the gray value of the third pixel satisfy a first condition with the gray value of the first pixel. The second mapping brightness is a mapping brightness that makes the gray value of the fourth pixel satisfy the first condition with the gray value of the second pixel. The first condition is used to limit the change of the gray value of the pixel after tone mapping.

[0126] In one possible implementation, the first condition includes:

[0127] For a single pixel, the difference between the grayscale value after tone mapping and the grayscale value before tone mapping is less than or equal to a preset first grayscale threshold.

[0128] In one possible implementation, the first condition further includes:

[0129] For a single pixel, the difference between the preset second grayscale threshold and the grayscale value after tone mapping is less than or equal to the preset third grayscale threshold, where the second grayscale threshold is the grayscale value of white.

[0130] In one possible implementation, the conversion unit 502 includes:

[0131] The first conversion subunit is used to convert the first pixel of the first material according to the third mapping brightness to obtain the fifth pixel;

[0132] An update subunit is configured to update the third mapping brightness and perform hue conversion on the first pixel according to the updated third mapping brightness if the gray value of the fifth pixel does not meet the first condition.

[0133] An output subunit is configured to, if the grayscale value of the fifth pixel and the grayscale value of the first pixel satisfy the first condition, then use the fifth pixel as the third pixel in the second material, and the third mapped brightness corresponding to the third pixel is denoted as the first mapped brightness.

[0134] In one possible implementation, the updating subunit is specifically used for:

[0135] A fourth mapping brightness is obtained based on the number of times the tone mapping of the first pixel is performed and the third mapping brightness, wherein the fourth mapping brightness is less than the third mapping brightness;

[0136] If the fourth mapped brightness satisfies the second condition, then the fourth mapped brightness is recorded as the updated third mapped brightness, and the second condition is used to indicate that the fourth mapped brightness matches the second hue attribute.

[0137] In one possible implementation, the forwarding unit 502 includes:

[0138] The second conversion subunit is used to convert the first pixel of the first material from an electrical signal of the first hue attribute to a light signal of the first hue attribute.

[0139] The third conversion subunit is used to convert the light signal of the first hue attribute into the first light signal of the second hue attribute according to the first mapped brightness.

[0140] The fourth conversion subunit is used to perform color space conversion on the first optical signal to obtain a second optical signal with the second hue attribute;

[0141] The fifth conversion subunit is used to convert the second optical signal into an electrical signal of the second hue attribute, wherein the electrical signal of the second hue attribute corresponds to the third pixel in the second material.

[0142] In one possible implementation, the acquisition unit 501 is specifically used for:

[0143] In response to a tone conversion operation in a multimedia editing or playback task, the first material belonging to the first tone attribute in the multimedia editing or playback task is obtained;

[0144] The device 500 further includes:

[0145] The replacement unit is used to replace the first material with the second material in the multimedia editing or playback task after the first material has been tone-mapped to obtain a second material with a second tone attribute.

[0146] In one possible implementation, the first tone attribute is High Dynamic Range (HDR), the first material is HDR material, the second tone attribute is Standard Dynamic Range (SDR), and the second material is SDR material.

[0147] It should be noted that the specific implementation method and technical effects achieved by the device 500 can be found in [reference needed]. Figure 1 The method shown is described in detail.

[0148] In addition, this application also provides an electronic device, the device including a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory so that the electronic device performs any implementation of the method provided in this application.

[0149] See Figure 6 This document illustrates a structural schematic diagram of an electronic device 600 suitable for implementing embodiments of the present disclosure. The terminal devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0150] like Figure 6As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0151] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0152] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.

[0153] The electronic device provided in this embodiment belongs to the same inventive concept as the method provided in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0154] This application also provides a computer-readable medium storing instructions or a computer program that, when executed on a device, causes the device to perform any implementation of the method provided in this application.

[0155] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0156] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0157] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0158] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to perform the aforementioned methods.

[0159] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0161] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units / modules do not necessarily limit the specific unit itself.

[0162] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0164] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0165] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0166] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0167] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0168] It should be noted that this application embodiment does not involve sensitive user information; all user-related information is obtained, used, and determined only after user authorization. In one example, before obtaining user-related information, the corresponding interface displays a prompt regarding authorization for data acquisition and use. This prompt informs the user, in accordance with relevant laws and regulations, of the type, scope of use, and usage scenarios of the personal information involved in this disclosure through an appropriate means, so that the user can determine whether to agree to the authorization based on the prompt. It is understood that the above notification and user authorization acquisition process is merely illustrative and does not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations can also be applied to the implementation of this disclosure.

[0169] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A color tone conversion method, characterized in that, include: Obtain the first material with the first color tone attribute, the first material including the first pixel and the second pixel; A second material with a second hue attribute is obtained by performing hue mapping on the first material. The second material includes a third pixel and a fourth pixel. The third pixel is obtained by hue mapping the first pixel according to a first mapping brightness. The fourth pixel is obtained by hue mapping the second pixel according to a second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is a mapping brightness that makes the gray value of the third pixel satisfy a first condition with the gray value of the first pixel. The second mapping brightness is a mapping brightness that makes the gray value of the fourth pixel satisfy the first condition with the gray value of the second pixel. The first condition is used to limit the change of the gray value of the pixel after hue mapping.

2. The method according to claim 1, characterized in that, The first condition includes: For a single pixel, the difference between the grayscale value after tone mapping and the grayscale value before tone mapping is less than or equal to a preset first grayscale threshold.

3. The method according to claim 2, characterized in that, The first condition also includes: For a single pixel, the difference between the preset second grayscale threshold and the grayscale value after tone mapping is less than or equal to the preset third grayscale threshold, where the second grayscale threshold is the grayscale value of white.

4. The method according to any one of claims 1-3, characterized in that, The second material obtained by performing tone mapping on the first material to obtain the second color attribute includes: The first pixel of the first material is hue-converted according to the third mapping brightness to obtain the fifth pixel; If the gray value of the fifth pixel does not meet the first condition with the gray value of the first pixel, then the third mapping brightness is updated, and the first pixel is hue-converted according to the updated third mapping brightness. If the grayscale value of the fifth pixel and the grayscale value of the first pixel satisfy the first condition, then the fifth pixel is used as the third pixel in the second material, and the third mapped brightness corresponding to the third pixel is recorded as the first mapped brightness.

5. The method according to claim 4, characterized in that, The update of the third mapped brightness includes: A fourth mapping brightness is obtained based on the number of times the tone mapping of the first pixel is performed and the third mapping brightness, wherein the fourth mapping brightness is less than the third mapping brightness; If the fourth mapped brightness satisfies the second condition, then the fourth mapped brightness is recorded as the updated third mapped brightness, and the second condition is used to indicate that the fourth mapped brightness matches the second hue attribute.

6. The method according to any one of claims 1-5, characterized in that, The second material obtained by performing tone mapping on the first material to obtain the second tone attribute includes: For the first pixel of the first material, the electrical signal of the first hue attribute is converted into the light signal of the first hue attribute; According to the first mapped brightness, the light signal of the first hue attribute is converted into the first light signal of the second hue attribute; The first light signal is converted to a color space to obtain a second light signal with the second hue attribute; The second light signal is converted into an electrical signal of the second hue attribute, and the electrical signal of the second hue attribute corresponds to the third pixel in the second material.

7. The method according to any one of claims 1-6, characterized in that, The first material for obtaining the first color tone attribute includes: In response to a tone conversion operation in a multimedia editing or playback task, the first material belonging to the first tone attribute in the multimedia editing or playback task is obtained; After performing tone mapping on the first material to obtain a second material with a second tone attribute, the method further includes: In the multimedia editing or playback task, the first material is replaced with the second material.

8. The method according to any one of claims 1-7, characterized in that, The first tone attribute is High Dynamic Range (HDR), and the first material is HDR material. The second tone attribute is Standard Dynamic Range (SDR), and the second material is SDR material.

9. A color tone conversion device, characterized in that, include: The acquisition unit is used to acquire a first material with a first tone attribute, wherein the first material includes a first pixel and a second pixel. A conversion unit is used to perform tone mapping on the first material to obtain a second material with a second tone attribute. The second material includes a third pixel and a fourth pixel. The third pixel is a pixel obtained by tone mapping the first pixel according to a first mapping brightness. The fourth pixel is a pixel obtained by tone mapping the second pixel according to a second mapping brightness. The first mapping brightness is different from the second mapping brightness. The first mapping brightness is a mapping brightness that makes the gray value of the third pixel satisfy a first condition with the gray value of the first pixel. The second mapping brightness is a mapping brightness that makes the gray value of the fourth pixel satisfy the first condition with the gray value of the second pixel. The first condition is used to limit the change of the gray value of the pixel after tone mapping.

10. An electronic device, characterized in that, The electronic device includes: a processor and a memory; The memory is used to store instructions or programs; The processor is configured to execute the instructions or program in the memory to cause the electronic device to perform the method according to any one of claims 1-8.

11. A readable medium, characterized in that, The readable medium stores instructions or programs that, when executed on a processor, cause the processor to perform the method according to any one of claims 1-8.