Editing method, device, equipment, storage medium and program product of media content
Patent Information
- Application Number
- CN202510361735.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2026-09-29
AI Technical Summary
这不仅增加了图像编辑的交互次数,也非常依赖操作者的调色经验,否则往往难以选出较好的颜色参数范围
[0018]本实施例提供的媒体内容的编辑方法、装置、设备、存储介质及程序产品,该方法包括:获取调色操作对应的第一颜色参数,调色操作用于对初始媒体内容中属于第一颜色参数对应的颜色参数范围内的像素点进行调色处理;从颜色参数大于第一颜色参数的第一颜色参数范围中确定第一目标颜色参数,以及,从颜色参数小于第一颜色参数的第二颜色参数范围中确定第二目标颜色参数;其中,第一目标颜色参数与第一颜色参数的色差为第一预设色差,第二目标颜色参数与第一颜色参数的色差为第二预设色差;根据第一目标颜色参数和第二目标颜色参数,确定第一颜色参数对应的目标颜色参数范围,对初始媒体内容中属于目标颜色参数范围内的目标像素点进行调色处理,生成目标媒体内容。该技术方案中,由于针对待调色处理的初始媒体内容,以第一颜色参数为中心,在第一颜色参数左右两个方向的颜色参数范围,根据与第一颜色参数的色差大小,确定色差大小为第一预设色差的第一目标颜色参数和色差大小为第二预设色差第二目标颜色参数,这样,针对不同调色操作对应的第一颜色参数,可以确定与该第一颜色参数相匹配的目标颜色参数范围,与因此提高了确定的目标色相范围的准确性,进而提高对媒体内容进行调色处理的效果。
Smart Images

Figure CN122845778A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of media editing technology, and in particular to a method, apparatus, device, storage medium, and program product for editing media content. Background Technology
[0002] Currently, HSL (Hue Saturation Lightness) color correction is a widely used method. This method allows adjustment of pixels within a specific range of color parameters in an image. In other words, pixels whose color parameters fall within this range are selected and participate in subsequent color correction. Therefore, improving the accuracy of the selected color parameter range is crucial for achieving the desired color correction effect.
[0003] In related technologies, pixels within a certain range of color parameters in an image are typically selected through manual adjustments. This not only increases the number of interactions in image editing but also heavily relies on the operator's color adjustment experience; otherwise, it is often difficult to select a good range of color parameters. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, storage medium, and program product for editing media content, which can improve the accuracy of the selected color parameter range, thereby improving the effect of color correction processing of media content.
[0005] In a first aspect, embodiments of this disclosure provide a method for editing media content, including:
[0006] Obtain the first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter;
[0007] A first target color parameter is determined from a first color parameter range where the color parameter is greater than the first color parameter, and a second target color parameter is determined from a second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference;
[0008] Based on the first target color parameter and the second target color parameter, the target color parameter range corresponding to the first color parameter is determined, and the target pixels in the initial media content that belong to the target color parameter range are color-adjusted to generate the target media content.
[0009] Secondly, embodiments of this disclosure provide a media content editing apparatus, comprising:
[0010] The acquisition unit is used to acquire the first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on the pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter;
[0011] The determining unit is configured to determine a first target color parameter from a first color parameter range in which the color parameter is greater than the first color parameter, and to determine a second target color parameter from a second color parameter range in which the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference;
[0012] The color adjustment unit is used to determine the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, and to perform color adjustment processing on the target pixels in the initial media content that belong to the target color parameter range to generate target media content.
[0013] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0014] The memory stores computer-executed instructions;
[0015] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the media content editing method as described in the first aspect and various possible designs of the first aspect.
[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the media content editing method described in the first aspect and various possible designs of the first aspect.
[0017] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the media content editing method described in the first aspect and various possible designs of the first aspect.
[0018] This embodiment provides a method, apparatus, device, storage medium, and program product for editing media content. The method includes: obtaining a first color parameter corresponding to a color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter; determining a first target color parameter from a first color parameter range where the color parameter is greater than the first color parameter, and determining a second target color parameter from a second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference; determining a target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, performing color adjustment processing on target pixels in the initial media content that belong to the target color parameter range, and generating target media content. In this technical solution, for the initial media content to be color-corrected, with the first color parameter as the center, the color parameter ranges in the two directions to the left and right of the first color parameter are determined according to the size of the color difference with the first color parameter. The first target color parameter with the size of the color difference is the first preset color difference, and the second target color parameter with the size of the color difference is the second preset color difference. In this way, for the first color parameter corresponding to different color correction operations, the target color parameter range that matches the first color parameter can be determined, thereby improving the accuracy of the determined target hue range and thus improving the effect of color correction processing on the media content. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic diagram illustrating a prior art method for editing media content, provided as an embodiment of this disclosure;
[0021] Figure 2 Flowchart of the media content editing method provided in the embodiments of this disclosure Figure 1 ;
[0022] Figure 3 A schematic diagram of a media content editing method provided in the embodiments of this disclosure. Figure 1 ;
[0023] Figure 4 Flowchart of the media content editing method provided in the embodiments of this disclosure Figure 2 ;
[0024] Figure 5 A schematic diagram of a media content editing method provided in the embodiments of this disclosure. Figure 2 ;
[0025] Figure 6 A schematic diagram of the structure of a media content editing device provided in an embodiment of this disclosure;
[0026] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0029] Currently, HSL (Hue Saturation Lightness) color correction is a widely used method. This method allows adjustment of pixels within a specific range of color parameters in an image. In other words, pixels whose color parameters fall within this range are selected and participate in subsequent color correction. Therefore, improving the accuracy of the selected color parameter range is crucial for achieving the desired color correction effect.
[0030] In related technologies, different colors correspond to color parameter ranges of the same size, and color correction using color parameter ranges of the same size yields poor results. In such cases, pixels within a specific color parameter range in the image can be manually adjusted. However, manual adjustment not only increases the number of interactions in image editing but also heavily relies on the operator's color correction experience; otherwise, it is often difficult to select a suitable color parameter range.
[0031] For example, such as Figure 1As shown, the color parameter ranges for yellow, green, and blue are the same. In this case, the color correction effect can be improved by manually adjusting the color parameter ranges for each color. However, manually adjusting the color parameter ranges for each color not only increases the number of interactions in image editing but also heavily relies on the operator's color correction experience, therefore the accuracy of the color parameter ranges after each manual adjustment cannot be guaranteed.
[0032] To address the technical problems in existing technologies, the inventor's technical concept is as follows: For a given color parameter, taking it as the center, find two color parameters on the left and right sides that are greater than a given color difference (denoted as p). The range covered by these two color parameters is the desired color parameter range. In other words, by using color difference theory as the selection criterion, the color parameter range is determined, reducing reliance on human experience and thus improving the accuracy of the desired color parameter range.
[0033] Accordingly, the specific steps may include: obtaining a first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter; determining a first target color parameter from the first color parameter range where the color parameter is greater than the first color parameter, and determining a second target color parameter from the second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference; determining the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, performing color adjustment processing on target pixels in the initial media content that belong to the target color parameter range, and generating target media content.
[0034] In this technical solution, for the initial media content to be color-corrected, with the first color parameter as the center, the color parameter ranges in the two directions to the left and right of the first color parameter are determined according to the size of the color difference with the first color parameter. The first target color parameter with the size of the color difference is the first preset color difference, and the second target color parameter with the size of the color difference is the second preset color difference. In this way, for the first color parameter corresponding to different color correction operations, the target color parameter range that matches the first color parameter can be determined, thereby improving the accuracy of the determined target hue range and thus improving the effect of color correction processing on the media content.
[0035] The following is a detailed implementation process of the media content editing method according to the embodiments of this disclosure. Some examples are merely illustrative and not intended to limit the scope. The executing entity of the media content editing method according to the embodiments of this disclosure is an electronic device, such as a terminal or server.
[0036] Figure 2 Flowchart of the media content editing method provided in the embodiments of this disclosure Figure 1 ,like Figure 2 As shown, the methods for editing this media content may include:
[0037] S201. Obtain the first color parameter corresponding to the color adjustment operation. The color adjustment operation is used to perform color adjustment processing on the pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter.
[0038] In this embodiment of the disclosure, the first color parameter can be an RGB color parameter or an HSL color parameter. The first color parameter can be a user-specified color. That is, the user can specify color adjustment for pixels of a certain color in the media content. The media content can be video or an image.
[0039] In some embodiments, when the first color parameter is an RGB color parameter, the RGB color parameter can be converted to an HSL color parameter to determine the color parameter range corresponding to the first color parameter. Accordingly, this step may include: obtaining the RGB color parameter corresponding to the target color selected in the color adjustment operation; converting the RGB color parameter to an HSL color parameter to obtain the first color parameter corresponding to the color adjustment operation; wherein, the first color parameter includes a first hue parameter, a first brightness parameter, and a first saturation parameter.
[0040] In other embodiments, the first color parameter is an HSL color parameter. In this case, an HSL color parameter input box can be displayed on the media content editing interface. Before triggering the color adjustment operation, the user can input the HSL color parameter in the HSL color parameter input box. Accordingly, this step may include: when triggering the color adjustment operation, the electronic device obtains the HSL color parameter input in the HSL color parameter input box to obtain the first color parameter corresponding to the color adjustment operation.
[0041] In this embodiment, the color parameter range can be the range of HSL color parameters. HSL color parameters better align with users' intuitive understanding of color, describing color from three dimensions: hue, saturation, and brightness. Hue refers to the basic attribute of color, such as red, blue, and green. The distribution of hues forms a circle, so in the HSL model, the unit of hue is "degree," for example, 0 degrees represents red, 120 degrees represents green, etc. Saturation refers to the vividness of a color. Low-saturation colors appear grayish, down to pure gray; high-saturation colors are vivid, such as pure red and pure green. Brightness refers to the lightness or darkness of a color. Colors can range from black to white. For example, when we say "dark green, light purple," "green" and "purple" are descriptions of hue, while "dark" and "light" are combined descriptions of saturation and brightness.
[0042] S202. Determine a first target color parameter from a first color parameter range where the color parameter is greater than the first color parameter, and determine a second target color parameter from a second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference.
[0043] In this embodiment of the disclosure, for ease of calculation, the saturation parameter in each first candidate color parameter can be set to be the same as the first saturation parameter in the first color parameter, and the brightness parameter in each first candidate color parameter can be set to be the same as the first brightness parameter in the first color parameter. This embodiment of the disclosure does not impose specific limitations on the values of the saturation parameter and the brightness parameter; they can be set and changed as needed.
[0044] For example, such as Figure 3 As shown, the first color parameter includes a first hue parameter, a first brightness parameter, and a first saturation parameter. The first saturation parameter S can be set to 1, and the first brightness parameter L to 0.5. The first hue parameter can be denoted as H0. In this case, the first color parameter can be denoted as C0 = (H0, 1, 0.5).
[0045] In some embodiments, a first target color parameter is determined from a range of first color parameters based on the color difference between a first candidate color parameter and the first color parameter, using a first color parameter as the central color parameter. Correspondingly, determining the first target color parameter from a range of first color parameters where the color parameter is greater than the first color parameter includes: using the first color parameter as the initial color parameter, selecting first candidate color parameters from the range of first color parameters in ascending order of color parameters, wherein the color difference interval between two adjacent first candidate color parameters is a preset color difference interval; determining the color difference between the first candidate color parameter and the first color parameter; if the color difference is less than a first preset color difference, then selecting the next first candidate color parameter; if the color difference is equal to the first preset color difference, then determining the first candidate color parameter as the first target color parameter. In this embodiment, the value of the preset color difference interval is not specifically limited and can be set and changed as needed. For example, the preset color difference interval is 1 degree.
[0046] For example, such as Figure 3 As shown, using the first color parameter as the initial color parameter, and selecting the first candidate color parameter from the range of the first color parameter in ascending order of color parameters, the first candidate color parameter is recorded as C. R = (H, 1, 0.5). The color difference between the first candidate color parameter and the first color parameter can be expressed as delta E(C). RThe first preset color difference can be represented as p1. When delta E(C0). R When C0) is less than the first preset color difference p1, continue to select the next first candidate color parameter; when delta E(C) is less than the first preset color difference p1, continue to select the next first candidate color parameter; R When C0) equals the first preset color difference p1, the first candidate color parameter at this time is determined as the first target color parameter, and H at this time (that is, the first target hue parameter in the first target color parameter) is denoted as H. R .
[0047] In some embodiments, a first color parameter is used as the central color parameter, and a second target color parameter is determined from the range of second color parameters based on the color difference between the second candidate color parameter and the first color parameter. Correspondingly, determining the second target color parameter from the range of second color parameters whose color parameters are smaller than the first color parameter includes: using the first color parameter as the initial color parameter, selecting second candidate color parameters from the range of second color parameters in descending order of color parameters, wherein the color difference interval between two adjacent second candidate color parameters is a preset color difference interval; determining the color difference between the second candidate color parameter and the first color parameter; if the color difference is less than a second preset color difference, then selecting the next second candidate color parameter; if the color difference is equal to the second preset color difference, then determining the second candidate color parameter as the second target color parameter. In this embodiment, the value of the preset color difference interval is not specifically limited and can be set and changed as needed. For example, the preset color difference interval is 1 degree.
[0048] It should be noted that the color difference interval between the two second candidate color parameters can be the same as or different from the color difference interval between the two first candidate color parameters.
[0049] For example, such as Figure 3 As shown, using the first color parameter as the initial color parameter, and selecting the second candidate color parameter from the range of the second color parameter in descending order of color parameter, the second candidate color parameter is recorded as C. L = (H, 1, 0.5). The color difference between the second candidate color parameter and the first color parameter can be expressed as delta E(C). L The second preset color difference can be represented as p2. When delta E(C L When C0) is less than the second preset color difference p2, continue to select the next first candidate color parameter; when delta E(C L When C0) equals the second preset color difference p2, the second candidate color parameter at this time is determined as the second target color parameter, and H at this time (that is, the second target hue parameter in the second target color parameter) is denoted as H. L .
[0050] In this embodiment of the disclosure, the values of the first preset color difference and the second preset color difference are not specifically limited. The first preset color difference and the second preset color difference can be set to be the same, or the first preset color difference and the second preset color difference can be set to be different.
[0051] It should be noted that color difference is used to measure the difference between two colors. Generally, this difference refers to a person's subjective perception of color difference. Color difference theory, on the other hand, uses certain mathematical theories (formulas) to fit a person's subjective perception of color difference. In this disclosure, the method for determining color difference is not specifically limited. For example, such as... Figure 3 As shown, delta E can be used to refer to the color difference calculated theoretically.
[0052] S203. Based on the first target color parameter and the second target color parameter, determine the target color parameter range corresponding to the first color parameter, and perform color adjustment on the target pixels in the initial media content that belong to the target color parameter range to generate the target media content.
[0053] In some embodiments, target pixels in the initial media content that fall within the target color parameter range, that is, the color parameters corresponding to the target pixels are located within the target color parameter range. In this case, this application adaptively selects the target color parameter range corresponding to the target color, with the target color center as the target color.
[0054] In other embodiments, the brightness and saturation parameters of each pixel in the initial media content are the same or similar, so the brightness and saturation parameters in the color parameters can be set to fixed values. For example, the saturation parameter S = 1 and the brightness parameter L = 0.5 can be set. In this case, the target pixels in the initial media content that belong to the target color parameter range can be determined by using the hue parameter corresponding to each pixel in the initial media content.
[0055] Optionally, this step includes: determining the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter; determining the target hue parameter range corresponding to the target color parameter range; and performing color adjustment processing on the target pixels in the initial media content that belong to the target hue parameter range to generate the target media content.
[0056] For example, such as Figure 3 As shown, the first target color parameter is C. L =(H L The second target color parameter is C (1, 0.5). R =(H R The target color parameter range is [C, 1, 0.5). L C R The corresponding target hue parameter range is [H].L H R At this point, the initial media content can be selected from the target hue parameter range [H]. L H R The target pixels within the range are color-corrected to generate the target media content.
[0057] In this embodiment of the disclosure, the first target color parameter includes a first target hue parameter, and the second target color parameter includes the first target hue parameter. The first target hue parameter and the second target hue parameter belong to the hue parameter range on a hue wheel from 0 degrees to 360 degrees.
[0058] Optionally, if the first target hue parameter is greater than or equal to 0 degrees and less than 360 degrees, and the second target hue parameter is greater than or equal to 0 degrees and less than 360 degrees, then no adjustment is needed for the first and second target hue parameters when determining the target color parameter range. If the first target hue parameter is less than 0 degrees or greater than 360 degrees, then a remainder operation of 360 degrees needs to be performed on the first target hue parameter when determining the target color parameter range to ensure that the first target hue parameter belongs to the hue parameter range on the hue wheel from 0 degrees to 360 degrees. Similarly, if the second target hue parameter is less than 0 degrees or greater than 360 degrees, then a remainder operation of 360 degrees needs to be performed on the second target hue parameter when determining the target color parameter range to ensure that the second target hue parameter belongs to the hue parameter range on the hue wheel from 0 degrees to 360 degrees.
[0059] For example, the first target hue parameter is 370 degrees, which becomes 10 degrees after modulo operation. The second target hue parameter is -100 degrees, which becomes 260 degrees after modulo operation. The determined target color parameter range is: [(10,1,0.5),(260,1,0.5)].
[0060] This disclosure provides a method for editing media content: obtaining a first color parameter corresponding to a color adjustment operation, the color adjustment operation being used to adjust the color of pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter; determining a first target color parameter from the first color parameter range where the color parameter is greater than the first color parameter, and determining a second target color parameter from the second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference; determining the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, and performing color adjustment on target pixels in the initial media content that belong to the target color parameter range to generate target media content. In this technical solution, for the initial media content to be color-corrected, with the first color parameter as the center, the color parameter ranges in the two directions to the left and right of the first color parameter are determined according to the size of the color difference with the first color parameter. The first target color parameter with the size of the color difference is the first preset color difference, and the second target color parameter with the size of the color difference is the second preset color difference. In this way, for the first color parameter corresponding to different color correction operations, the target color parameter range matching the first color parameter can be determined, thereby improving the accuracy of the determined target hue range and thus improving the effect of color correction processing on the media content.
[0061] In this embodiment of the disclosure, to improve the effect of color correction processing of media content, the edge regions of the target color parameter range can be feathered. Furthermore, different feathering ranges can be provided for the target color parameter ranges corresponding to different colors.
[0062] In some embodiments, the target color parameter range includes the range of HSL color parameters. The HSL color parameters include hue, saturation, and brightness. Saturation and brightness can be set to fixed values. In this case, feathering can be applied to the edge regions of the target color parameter range; that is, feathering is applied to the edge regions of the hue parameters within the target color parameter range.
[0063] Optionally, the first color parameter includes a first hue parameter, the first target color parameter includes a first target hue parameter, and the second target color parameter includes a first target hue parameter. Correspondingly, as... Figure 4 As shown, the above feathering method may include the following steps:
[0064] S401. Based on the first target hue parameter and the first hue parameter, determine the first hue feathering parameter corresponding to the first target hue parameter; and based on the second target hue parameter and the first hue parameter, determine the second hue feathering parameter corresponding to the second target hue parameter.
[0065] Optionally, determining the first hue feathering parameter corresponding to the first target hue parameter based on the first target hue parameter and the first hue parameter includes: determining the difference between the first hue parameter and the first hue parameter; determining the first product between the difference between the first hue parameter and the preset feathering ratio; and determining the first hue feathering parameter corresponding to the first target hue parameter based on the difference between the first target hue parameter and the first product.
[0066] For example, such as Figure 3 As shown, the preset feathering ratio is r, and the first hue feathering parameter HRS = H R -(H R -H0)*r. Where H R H0 represents the first target hue parameter.
[0067] Optionally, based on the second target hue parameter and the first hue parameter, the second hue feathering parameter corresponding to the second target hue parameter is determined, including: determining the difference between the first hue parameter and the second target hue parameter; determining the second product between the difference between the second hue parameters and the preset feathering ratio; and determining the second hue feathering parameter corresponding to the second target hue parameter based on the sum of the second target hue parameter and the second product.
[0068] For example, such as Figure 3 As shown, the preset feathering ratio is r, and the second hue feathering parameter HLS = H L +(H0-H L )*r. Where, H L H represents the second target hue parameter, and H0 represents the first hue parameter.
[0069] S402. Determine the first hue feathering range between the first target hue parameter and the first hue feathering parameter, and determine the second hue feathering range between the second target hue parameter and the second hue feathering parameter.
[0070] For example, such as Figure 3 and Figure 5 As shown, the feathering range of the first hue is (HRS, H). R ), indicating the feathering range on the right. The feathering range for the first hue is (H). L , HLS), indicates the feathering range on the left.
[0071] S403. Feather the target pixels in the initial media content that fall within the first hue feathering range and the second hue feathering range.
[0072] In this embodiment of the disclosure, by feathering the edge regions of the target color parameter range using a first hue feathering range and a second hue feathering range during the color adjustment process, the display smoothness of pixels located in the edge regions of the target color parameter range can be improved, thereby enhancing the display effect of the target media content obtained after color adjustment. Furthermore, different feathering ranges can be provided for different target color parameter ranges, thus increasing the flexibility of the feathering process and further improving the display effect of the target media content.
[0073] Figure 6 A schematic diagram of the structure of the media content editing device provided in the embodiments of this disclosure, as shown below. Figure 6 As shown, the media content editing device includes:
[0074] Acquisition unit 601 is used to acquire the first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter.
[0075] The determining unit is configured to determine a first target color parameter 602 from a first color parameter range in which the color parameter is greater than the first color parameter, and to determine a second target color parameter from a second color parameter range in which the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference;
[0076] The color adjustment unit 603 is used to determine the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, and to perform color adjustment processing on the target pixels in the initial media content that belong to the target color parameter range to generate target media content.
[0077] According to one or more embodiments of this disclosure, the acquisition unit 601 acquires a first color parameter to be adjusted in the media content, specifically including: acquiring RGB color parameters corresponding to the color to be adjusted in the media content; converting the RGB color parameters into HSL color parameters; and determining that the color parameter in the HSL color parameters is the first color parameter corresponding to the color to be adjusted.
[0078] According to one or more embodiments of this disclosure, the determining unit 602 determines a first target color parameter from a first color parameter range whose color parameter is greater than the first color parameter, specifically including: selecting a plurality of first candidate color parameters from the first color parameter range in ascending order of color parameter, wherein the color difference between two adjacent first candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each first candidate color parameter and the color corresponding to the first color parameter; and selecting a first target color parameter from the plurality of first candidate color parameters whose color difference is the first preset color difference.
[0079] According to one or more embodiments of this disclosure, the determining unit 602 determines a second target color parameter from a second color parameter range whose color parameter is less than the first color parameter, specifically including: selecting a plurality of second candidate color parameters from the second color parameter range in descending order of color parameter, wherein the color difference between two adjacent second candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each second candidate color parameter and the color corresponding to the first color parameter; and selecting a second target color parameter from the plurality of second candidate color parameters whose color difference is the second preset color difference.
[0080] According to one or more embodiments of this disclosure, the editing apparatus further includes: a feathering processing unit, the feathering processing unit being configured to: determine a first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter; and determine a second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter; determine a first hue feathering range between the first target color parameter and the first hue feathering parameter; determine a second hue feathering range between the second target color parameter and the second hue feathering parameter; and perform feathering processing on target pixels in the media content that belong to the first hue feathering range and the second hue feathering range.
[0081] According to one or more embodiments of this disclosure, the feathering processing unit determines a first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter, specifically including: determining a first color difference between the first target color parameter and the first color parameter; determining a first product between the first color difference and a preset feathering ratio; and determining the first hue feathering parameter corresponding to the first target color parameter based on the difference between the first target color parameter and the first product.
[0082] According to one or more embodiments of this disclosure, the feathering processing unit determines a second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter, specifically including: determining a second color difference between the first color parameter and the second target color parameter; determining a second product between the second color difference and a preset feathering ratio; and determining the second hue feathering parameter corresponding to the second target color parameter based on the sum of the second target color parameter and the second product.
[0083] refer to Figure 7 The diagram illustrates a structural schematic of an electronic device 700 suitable for implementing embodiments of the present disclosure. The electronic device 700 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0084] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0085] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 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.
[0086] 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 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 communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0087] 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.
[0088] 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.
[0089] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0090] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and 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).
[0091] 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.
[0092] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0093] 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.
[0094] In a first aspect, according to one or more embodiments of this disclosure, a method for editing media content is provided, comprising:
[0095] Obtain the first color parameter corresponding to the color to be adjusted in the media content;
[0096] A first target color parameter is determined from a first color parameter range where the color parameter is greater than the first color parameter, and a second target color parameter is determined from a second color parameter range where the color parameter is less than the first color parameter; wherein, the color difference between the first target color corresponding to the first target color parameter and the color corresponding to the first color parameter is a first preset color difference, and the color difference between the second target color corresponding to the second target color parameter and the color corresponding to the first color parameter is a second preset color difference;
[0097] Based on the first target color parameter and the second target color parameter, the range of target color parameters that need to be adjusted in the media content is determined, and the target pixels in the media content that fall within the range of target color parameters are color-adjusted.
[0098] According to one or more embodiments of this disclosure, obtaining the first color parameter to be adjusted in the media content includes: obtaining the RGB color parameter corresponding to the color to be adjusted in the media content; converting the RGB color parameter into an HSL color parameter; and determining the color parameter in the HSL color parameter as the first color parameter corresponding to the color to be adjusted.
[0099] According to one or more embodiments of this disclosure, determining a first target color parameter from a first color parameter range whose color parameter is greater than the first color parameter includes: selecting a plurality of first candidate color parameters from the first color parameter range in ascending order of color parameter, wherein the color difference between two adjacent first candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each first candidate color parameter and the color corresponding to the first color parameter; and selecting a first target color parameter from the plurality of first candidate color parameters whose color difference is the first preset color difference.
[0100] According to one or more embodiments of this disclosure, determining a second target color parameter from a second color parameter range whose color parameter is less than the first color parameter includes: selecting a plurality of second candidate color parameters from the second color parameter range in descending order of color parameter, wherein the color difference between two adjacent second candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each second candidate color parameter and the color corresponding to the first color parameter; and selecting a second target color parameter from the plurality of second candidate color parameters whose color difference is the second preset color difference.
[0101] According to one or more embodiments of this disclosure, the method further includes: determining a first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter; and determining a second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter; determining a first hue feathering range between the first target color parameter and the first hue feathering parameter, and determining a second hue feathering range between the second target color parameter and the second hue feathering parameter; and performing feathering processing on target pixels in the media content that belong to the first hue feathering range and the second hue feathering range.
[0102] According to one or more embodiments of this disclosure, determining the first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter includes: determining a first color difference between the first target color parameter and the first color parameter; determining a first product between the first color difference and a preset feathering ratio; and determining the first hue feathering parameter corresponding to the first target color parameter based on the difference between the first target color parameter and the first product.
[0103] According to one or more embodiments of this disclosure, determining the second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter includes: determining a second color difference between the first color parameter and the second target color parameter; determining a second product between the second color difference and a preset feathering ratio; and determining the second hue feathering parameter corresponding to the second target color parameter based on the sum of the second target color parameter and the second product.
[0104] Secondly, according to one or more embodiments of this disclosure, a media content editing apparatus is provided, comprising:
[0105] The acquisition unit is used to acquire the first color parameter to be adjusted in the media content;
[0106] The determining unit is configured to determine a first target color parameter from a first color parameter range in which the color parameter is greater than the first color parameter, and to determine a second target color parameter from a second color parameter range in which the color parameter is less than the first color parameter; wherein the color difference between the first target color corresponding to the first target color parameter and the color corresponding to the first color parameter is a first preset color difference, and the color difference between the second target color parameter corresponding to the second target color parameter and the color corresponding to the first color parameter is a second preset color difference;
[0107] The color adjustment unit is used to determine the range of target color parameters that need to be adjusted in the media content based on the first target color parameter and the second target color parameter, and to perform color adjustment processing on the target pixels in the media content that belong to the range of target color parameters.
[0108] According to one or more embodiments of this disclosure, the acquisition unit acquires a first color parameter to be adjusted in the media content, specifically including: acquiring RGB color parameters corresponding to the color to be adjusted in the media content; converting the RGB color parameters into HSL color parameters; and determining that the color parameter in the HSL color parameters is the first color parameter corresponding to the color to be adjusted.
[0109] According to one or more embodiments of this disclosure, the determining unit determines a first target color parameter from a first color parameter range whose color parameter is greater than the first color parameter, specifically including: selecting a plurality of first candidate color parameters from the first color parameter range in ascending order of color parameter, wherein the color difference between two adjacent first candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each first candidate color parameter and the color corresponding to the first color parameter; and selecting a first target color parameter from the plurality of first candidate color parameters whose color difference is the first preset color difference.
[0110] According to one or more embodiments of this disclosure, the determining unit determines a second target color parameter from a second color parameter range whose color parameter is less than the first color parameter, specifically including: selecting a plurality of second candidate color parameters from the second color parameter range in descending order of color parameter, wherein the color difference between two adjacent second candidate color parameters is a preset color difference; determining the color difference between the color corresponding to each second candidate color parameter and the color corresponding to the first color parameter; and selecting a second target color parameter from the plurality of second candidate color parameters whose color difference is the second preset color difference.
[0111] According to one or more embodiments of this disclosure, the editing apparatus further includes: a feathering processing unit, the feathering processing unit being configured to: determine a first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter; and determine a second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter; determine a first hue feathering range between the first target color parameter and the first hue feathering parameter; determine a second hue feathering range between the second target color parameter and the second hue feathering parameter; and perform feathering processing on target pixels in the media content that belong to the first hue feathering range and the second hue feathering range.
[0112] According to one or more embodiments of this disclosure, the feathering processing unit determines a first hue feathering parameter corresponding to the first target color parameter based on the first target color parameter and the first color parameter, specifically including: determining a first color difference between the first target color parameter and the first color parameter; determining a first product between the first color difference and a preset feathering ratio; and determining the first hue feathering parameter corresponding to the first target color parameter based on the difference between the first target color parameter and the first product.
[0113] According to one or more embodiments of this disclosure, the feathering processing unit determines a second hue feathering parameter corresponding to the second target color parameter based on the second target color parameter and the first color parameter, specifically including: determining a second color difference between the first color parameter and the second target color parameter; determining a second product between the second color difference and a preset feathering ratio; and determining the second hue feathering parameter corresponding to the second target color parameter based on the sum of the second target color parameter and the second product.
[0114] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0115] The memory stores computer-executed instructions;
[0116] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the media content editing method as described in the first aspect and various possible designs of the first aspect.
[0117] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the method for editing media content as described in the first aspect and various possible designs of the first aspect is implemented.
[0118] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method for editing media content as described in the first aspect and various possible designs of the first aspect.
[0119] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0120] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0121] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for editing media content, characterized in that, include: Obtain the first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter; A first target color parameter is determined from a first color parameter range where the color parameter is greater than the first color parameter, and a second target color parameter is determined from a second color parameter range where the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference; Based on the first target color parameter and the second target color parameter, the target color parameter range corresponding to the first color parameter is determined, and the target pixels in the initial media content that belong to the target color parameter range are color-adjusted to generate the target media content.
2. The method according to claim 1, characterized in that, The acquisition of the first color parameter corresponding to the color adjustment operation includes: Get the RGB color parameters corresponding to the target color selected in the color adjustment operation; The RGB color parameters are converted into HSL color parameters to obtain the first color parameters corresponding to the color adjustment operation; wherein, the first color parameters include a first hue parameter, a first brightness parameter, and a first saturation parameter.
3. The method according to claim 1, characterized in that, Determining the first target color parameter from a first color parameter range where the color parameter is greater than the first color parameter includes: Using the first color parameter as the initial color parameter, first candidate color parameters are selected from the range of the first color parameter in ascending order of color parameters, wherein the color difference interval between two adjacent first candidate color parameters is a preset color difference interval; Determine the color difference between the first candidate color parameter and the first color parameter. If the color difference is less than the first preset color difference, then continue to select the next first candidate color parameter. If the color difference is equal to the first preset color difference, then the first candidate color parameter is determined as the first target color parameter.
4. The method according to claim 1, characterized in that, Determining the second target color parameter from a second color parameter range whose color parameter is less than the first color parameter includes: Using the first color parameter as the initial color parameter, second candidate color parameters are selected from the range of the second color parameter in descending order of color parameters, wherein the color difference interval between two adjacent second candidate color parameters is a preset color difference interval; Determine the color difference between the second candidate color parameter and the first color parameter. If the color difference is less than the second preset color difference, then continue to select the next second candidate color parameter. If the color difference is equal to the second preset color difference, then the second candidate color parameter is determined as the second target color parameter.
5. The method according to claim 1, characterized in that, The first color parameter includes a first hue parameter, the first target color parameter includes a first target hue parameter, and the second target color parameter includes a first target hue parameter; the method further includes: Based on the first target hue parameter and the first hue parameter, determine the first hue feathering parameter corresponding to the first target hue parameter; and based on the second target hue parameter and the first hue parameter, determine the second hue feathering parameter corresponding to the second target hue parameter. Determine the first hue feathering range between the first target hue parameter and the first hue feathering parameter, and determine the second hue feathering range between the second target hue parameter and the second hue feathering parameter; Feathering is performed on target pixels in the initial media content that fall within the first hue feathering range and the second hue feathering range.
6. The method according to claim 5, characterized in that, The step of determining the first hue feathering parameter corresponding to the first target hue parameter based on the first target hue parameter and the first hue parameter includes: Determine the difference between the first target hue parameter and the first hue parameter; Determine the first product between the first hue parameter difference and the preset feathering ratio; The first hue feathering parameter corresponding to the first target hue parameter is determined based on the difference between the first target hue parameter and the first product.
7. The method according to claim 5, characterized in that, The step of determining the second hue feathering parameter corresponding to the second target hue parameter based on the second target hue parameter and the first hue parameter includes: Determine the difference in the second hue parameter between the first hue parameter and the second target hue parameter; Determine the second product between the second hue parameter difference and the preset feathering ratio; The second hue feathering parameter corresponding to the second target hue parameter is determined based on the sum of the second target hue parameter and the second product.
8. A media content editing device, characterized in that, include: The acquisition unit is used to acquire the first color parameter corresponding to the color adjustment operation, wherein the color adjustment operation is used to perform color adjustment processing on the pixels in the initial media content that belong to the color parameter range corresponding to the first color parameter; The determining unit is configured to determine a first target color parameter from a first color parameter range in which the color parameter is greater than the first color parameter, and to determine a second target color parameter from a second color parameter range in which the color parameter is less than the first color parameter; wherein the color difference between the first target color parameter and the first color parameter is a first preset color difference, and the color difference between the second target color parameter and the first color parameter is a second preset color difference; The color adjustment unit is used to determine the target color parameter range corresponding to the first color parameter based on the first target color parameter and the second target color parameter, and to perform color adjustment processing on the target pixels in the initial media content that belong to the target color parameter range to generate target media content.
9. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the media content editing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the media content editing method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for editing media content as described in any one of claims 1 to 7.