Image editing method and device, and storage medium

By adjusting the image in a dual color space, the problem of not being able to simultaneously balance color, brightness, and saturation in existing technologies is solved, achieving higher quality image adjustment results.

WO2024245440A9PCT designated stage expired Publication Date: 2025-12-11BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096914
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-01
Filing Date
2024-06-01
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously balance color, brightness, and saturation during curve adjustment, resulting in poor image adjustment quality that fails to meet user needs.

Method used

By converting the image to a first color space that includes the luminance channel for brightness adjustment, and then converting it to a second color space for color and saturation adjustment, a dual-color-space approach is adopted to balance color, brightness, and saturation.

Benefits of technology

It improves the image adjustment effect, resulting in higher quality images and meeting user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096914_11122025_PF_FP_ABST
    Figure CN2024096914_11122025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide an image editing method and device, and a storage medium. The method comprises: in response to an editing instruction for an image to be edited, converting said image to a first color space to obtain a first image, the first color space comprising a brightness channel; adjusting the first image in the brightness channel according to a first adjustment curve to obtain a second image; converting the second image to a second color space to obtain a third image; and adjusting the third image according to a second adjustment curve to obtain a target image. By performing image adjustment in two color spaces, factors such as color, brightness, and saturation are simultaneously taken into consideration, thus improving image adjustment effect and obtaining a higher-quality image.
Need to check novelty before this filing date? Find Prior Art

Description

Image editing method, device and storage medium

[0001] The present application claims priority to the Chinese patent application No. 202310645329.2, filed on June 1, 2023, entitled "Image editing method, device and storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The embodiments of the present disclosure relate to the technical field of computer and network communication, in particular to an image editing method, device and storage medium. BACKGROUND

[0003] In the image editing scene, curve adjustment is a common color adjustment method, and a curve adjustment function is usually provided in various image / video color grading software for users to adjust the color of an image.

[0004] In the curve adjustment, a one-dimensional color mapping table with a length of 256 is usually used to map the original image color to a new color value, so as to achieve the purpose of color adjustment. However, the factors such as color, brightness and saturation are usually not considered at the same time in the curve adjustment process, resulting in low quality of color adjustment and failing to meet the user demand.

[0005] SUMMARY

[0006] The embodiments of the present disclosure provide an image editing method, device and storage medium, so that the factors such as color, brightness and saturation can be considered at the same time in image adjustment, and the effect of image adjustment is improved.

[0007] In a first aspect, the embodiments of the present disclosure provide an image editing method, comprising: converting a to-be-edited image to a first color space to obtain a first image in response to an editing instruction for the to-be-edited image; wherein the first color space comprises a brightness channel; adjusting the first image in the brightness channel according to a first adjustment curve to obtain a second image; converting the second image to a second color space to obtain a third image; and adjusting the third image according to a second adjustment curve to obtain a target image.

[0008] In a second aspect, the embodiments of the present disclosure provide an image editing device, comprising: a conversion unit configured to convert a to-be-edited image to a first color space to obtain a first image in response to an editing instruction for the to-be-edited image; wherein the first color space comprises a brightness channel; a first adjustment unit configured to adjust the first image in the brightness channel according to a first adjustment curve to obtain a second image; the conversion unit is further configured to convert the second image to a second color space to obtain a third image; and a second adjustment unit configured to adjust the third image according to a second adjustment curve to obtain a target image.

[0009] In a third aspect, an electronic device is provided, including at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image editing method according to the first aspect and various possible designs of the first aspect.

[0010] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the image editing method according to the first aspect and various possible designs of the first aspect is implemented.

[0011] In a fifth aspect, a computer program product is provided, and the computer program product includes computer-executable instructions. When a processor executes the computer-executable instructions, the image editing method according to the first aspect and various possible designs of the first aspect is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.

[0013] FIG. 1 is an example diagram of a curve adjustment in the prior art;

[0014] FIG. 2 is a flowchart of an image editing method according to an embodiment of the present disclosure;

[0015] FIG. 3 is a flowchart of an image editing method according to another embodiment of the present disclosure;

[0016] FIG. 4 is an interface diagram for selecting a target adjustment gear according to an embodiment of the present disclosure;

[0017] FIG. 5 is a flowchart of an image editing method according to another embodiment of the present disclosure;

[0018] FIG. 6 is a structural block diagram of an image editing device according to an embodiment of the present disclosure;

[0019] FIG. 7 is a hardware structure diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] In order to make the purposes, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present disclosure.

[0021] In the curve adjustment, a one-dimensional color mapping table (which can be represented as an adjustment curve) with a length of 256 is usually used to map the original image colors to new color values, so as to achieve the color adjustment purpose. For example, as shown in FIG. 1, the left side is an original image without adjustment (the adjustment curve 1 thereof is y=x, x is the original color value, and y is the new color value after adjustment), and the right side is the original image subjected to curve adjustment by using the adjustment curve 2, in which the horizontal coordinate is the original color value, and the vertical coordinate is the new color value after adjustment.

[0022] However, the curve adjustment is usually performed in a single color space, especially in the RGB color space. During the curve adjustment, the color, brightness, saturation and other factors are usually not taken into account at the same time, and the curve adjustment of the color is easy to cause relatively sharp changes in brightness and / or saturation, which are not easy to control, resulting in low image quality and failing to meet the user demand.

[0023] In order to solve the above technical problems, the present disclosure provides an image editing method, which converts a to-be-edited image to a first color space to obtain a first image in response to an editing instruction of the to-be-edited image; wherein the first color space comprises a brightness channel; adjusts the first image in the brightness channel according to a first adjustment curve to obtain a second image; converts the second image to a second color space to obtain a third image; and adjusts the third image according to a second adjustment curve to obtain a target image. By performing image adjustment in double color spaces, the color, brightness, saturation and other factors can be taken into account at the same time, the effect of image adjustment is improved, and a higher-quality image is obtained.

[0024] The image editing method of the present disclosure is applied in an image editing scene, and can be applied in any electronic device that can be used for image editing, such as a terminal device or a server. The terminal device is not limited to a smart phone, a tablet computer, a notebook computer, a wearable device, etc.

[0025] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0026] The image editing method of the present disclosure will be described in detail below in combination with specific embodiments.

[0027] Referring to FIG. 2, FIG. 2 is a flowchart of an image editing method provided by an embodiment of the present disclosure. The method of the present embodiment can be applied in a terminal device or a server, and the image editing method comprises:

[0028] S201, in response to an editing instruction for a to-be-edited image, converting the to-be-edited image to a first color space to obtain a first image; wherein the first color space comprises a luminance channel.

[0029] In the present embodiment, when a user edits a to-be-edited image, the to-be-edited image can be first converted to a first color space to obtain a corresponding first image, wherein the first color space comprises a luminance channel (or a lightness channel) so as to facilitate luminance adjustment of the image on the luminance channel. The first color space includes but is not limited to HSV (Hue, Saturation, Value, hue, saturation and lightness) color space, HSL (Hue, Saturation, Lightness, hue, saturation and brightness) color space, HSI (Hue, Saturation, Intensity, hue, saturation and brightness) color space, Lab (Lab color space, color-opponent space) color space, etc.

[0030] In some embodiments, since a general display device displays an image in RGB color space, the to-be-edited image can be an image captured by a user or obtained through other means and displayed, and therefore the to-be-edited image can be an image in RGB color space, and of course the color space of the to-be-edited image is not limited in the present embodiment. In addition, any feasible color space conversion method can be used to convert the to-be-edited image to the first color space, which is not limited in the present embodiment.

[0031] S202, adjusting the first image on the luminance channel according to a first adjustment curve to obtain a second image.

[0032] In the embodiment, after the image to be edited is converted into a first image in a first color space, the first image can be curve-adjusted in a luminance channel of the first color space to obtain a second image, and the curve is a preset first adjustment curve, so that the image luminance adjustment can be better realized.

[0033] Specifically, luminance channel data of the first image can be extracted, the luminance channel data can be curve-adjusted through the first adjustment curve to obtain adjusted luminance channel data, and the adjusted luminance channel data can replace original luminance channel data of the first image.

[0034] S203, convert the second image to a second color space to obtain a third image.

[0035] In the embodiment, in order to make the image editing process take into account factors such as luminance, color, and saturation, after the luminance adjustment in the first color space, the obtained second image can be converted to a second color space for color and saturation adjustment, where the second color space can be an RGB color space. Since the display device can display images in the RGB space, the adjustment in the RGB color space can directly display the changes of the images before and after the adjustment, which is convenient for the user to watch the adjustment effect. Of course, the second color space can also be other color spaces. In addition, the second image after the luminance adjustment in the first color space will have a certain undersaturation, and the color and saturation can be adjusted in the second color space to achieve the expected color adjustment effect and saturation adjustment effect, so that the color and saturation are also taken into account.

[0036] In the embodiment, the conversion of the second image to the second color space can use any feasible color space conversion method, which is not limited in the embodiment.

[0037] S204, adjust the third image according to a second adjustment curve to obtain a target image.

[0038] In the embodiment, the third image can be curve-adjusted in the second color space according to the second adjustment curve to finally obtain the target image, so that the image editing process takes into account factors such as luminance, color, and saturation.

[0039] Specifically, one second adjustment curve can be used to simultaneously adjust multiple channels of the third image in the second color space, or different adjustment curves can be used to adjust any one or more channels.

[0040] Further, the target image can be output, for example, displayed on a display device. In some embodiments, if the second color space is not an RGB color space, the target image can be converted to an RGB color space before being displayed.

[0041] The image editing method provided in the embodiment can convert a to-be-edited image to a first color space in response to an editing instruction for the to-be-edited image, to obtain a first image; wherein the first color space comprises a luminance channel; adjust the first image in the luminance channel according to a first adjustment curve, to obtain a second image; convert the second image to a second color space, to obtain a third image; and adjust the third image according to a second adjustment curve, to obtain a target image. By adjusting the image in the dual color spaces, the color, luminance, saturation and other factors can be taken into account at the same time, the effect of image adjustment is improved, and a higher-quality image is obtained.

[0042] On the basis of any embodiment, as shown in FIG. 3, S202 comprises:

[0043] S301, obtaining a dark region of the first image.

[0044] S302, adjusting the dark region of the first image in the luminance channel according to the first adjustment curve.

[0045] In the embodiment, considering that the darker region of the image has a greater impact on the visual effect, the first image can be divided into a dark region and a bright region, and only the dark region of the first image is adjusted in the luminance channel according to the first adjustment curve in the luminance adjustment process, which can effectively improve the visual effect of the image. At the same time, since the bright region is prone to color band problems during adjustment, for example, the bright region with relatively pure color or color gradient (for example, the sky, the sun halo and the like) is prone to color band problems during adjustment, the embodiment does not adjust the luminance of the bright region, and the color band problem of the bright region is also effectively avoided.

[0046] In some embodiments, any feasible division method can be used for the division of the dark region and the bright region, for example, a preset dark mask is used to obtain the dark region.

[0047] On the basis of the above embodiment, S302 can specifically comprise: if the editing instruction is a positive adjustment instruction, determining a first adjustment curve for positive adjustment; increasing the luminance of the dark region of the first image in the luminance channel according to the first adjustment curve; or if the editing instruction is a negative adjustment instruction, determining a first adjustment curve for negative adjustment; and decreasing the luminance of the dark region of the first image in the luminance channel according to the first adjustment curve.

[0048] In the embodiment, the adjustment of the luminance is divided into increasing the luminance and decreasing the luminance on the basis of the initial luminance, the increasing of the luminance is the positive adjustment of the luminance, and the decreasing of the luminance is the negative adjustment of the luminance. Different first adjustment curves are used for different adjustment directions, that is, the first adjustment curve can be divided into the first adjustment curve for the positive adjustment and the first adjustment curve for the negative adjustment. It can be determined whether the positive adjustment or the negative adjustment according to the editing instruction. If it is determined that the positive adjustment, the first adjustment curve for the positive adjustment is used to increase the luminance of the dark region of the first image in the luminance channel. If it is determined that the negative adjustment, the first adjustment curve for the negative adjustment is used to decrease the luminance of the dark region of the first image in the luminance channel.

[0049] Similarly, the adjustment of the third image according to the second adjustment curve in S204 is also divided into the positive adjustment and the negative adjustment. Different second adjustment curves are used for different adjustment directions, that is, the second adjustment curve can also be divided into the second adjustment curve for the positive adjustment and the second adjustment curve for the negative adjustment. Similarly, it can be determined whether the positive adjustment or the negative adjustment according to the editing instruction. If it is determined that the positive adjustment, the second adjustment curve for the positive adjustment is used to adjust the third image. If it is determined that the negative adjustment, the second adjustment curve for the negative adjustment is used to adjust the third image.

[0050] On the basis of any of the above embodiments, since the bright region is prone to color banding problem during the adjustment, when the third image is adjusted according to the second adjustment curve, the bright region of the third image can also be adjusted with small amplitude or not adjusted as much as possible. In order to realize the small amplitude adjustment or no adjustment of the bright region of the third image, the curve shape of the second adjustment curve can be pre-configured to realize the small amplitude adjustment or no adjustment of the bright region of the third image. The part with a larger horizontal coordinate value (greater than a certain preset threshold) in the second adjustment curve decreases the adjustment amplitude or the adjustment amplitude is 0.

[0051] On the basis of the above embodiments, in order to achieve different degrees of adjustment effect of image adjustment, different adjustment curves can be generally used. For example, different first adjustment curves are used when adjusting the first image in the luminance channel according to the first adjustment curve, which can achieve different degrees of luminance adjustment effect, and different second adjustment curves are used when adjusting the third image according to the second adjustment curve, which can also achieve different degrees of adjustment effect. The setting of different adjustment curves has a high degree of freedom, and if the adjustment curve is set by the user, the adjustment effect is strongly dependent on the user's experience. For users with insufficient experience, it is difficult to set the adjustment curve well. Therefore, in the present embodiment, different preset adjustment gears can be configured, and different first adjustment curves and second adjustment curves are configured for each preset adjustment gear. More specifically, preset adjustment gears can be configured for positive adjustment and negative adjustment, respectively. For example, the positive adjustment is divided into 100 gears, and the negative adjustment is divided into 100 gears, and different first adjustment curves and second adjustment curves are configured for each preset adjustment gear. As shown in FIG. 4, a sliding control (or other control) can be provided for the user to select a target adjustment gear from the preset adjustment gears, and then the first adjustment curve and the second adjustment curve corresponding to the target adjustment gear can be automatically selected.

[0052] Further, before adjusting the first image in the luminance channel according to the first adjustment curve, S202 further includes: in response to an adjustment gear selection instruction, determining a target adjustment gear from a plurality of preset adjustment gears, and then selecting a corresponding first adjustment curve and a second adjustment curve according to the target adjustment gear, for subsequent adjustment processes according to the first adjustment curve and the second adjustment curve corresponding to the target adjustment gear, respectively.

[0053] On the basis of the above embodiments, different first adjustment curves and second adjustment curves corresponding to different preset adjustment gears can be obtained first.

[0054] Optionally, the method for obtaining the first adjustment curve and the second adjustment curve corresponding to different preset adjustment gears can be the same, which includes the method for obtaining the first adjustment curve for positive adjustment, the first adjustment curve for negative adjustment, the second adjustment curve for positive adjustment, and the second adjustment curve for negative adjustment corresponding to different preset adjustment gears. For any kind of adjustment curve in different preset adjustment gears, the method is shown in FIG. 5, which can include:

[0055] S401, for any kind of adjustment curve in the first adjustment curve and the second adjustment curve, obtaining a plurality of preset key points of the adjustment curve corresponding to the highest preset adjustment gear in the adjustment curve, and generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points.

[0056] S402, determining a plurality of target key points of the adjustment curve corresponding to any preset adjustment gear of the adjustment curve according to the plurality of preset key points and the total number of preset adjustment gears of the adjustment curve, and generating the adjustment curve corresponding to any preset adjustment gear according to the plurality of target key points.

[0057] In the embodiment, the plurality of preset key points of the adjustment curve corresponding to the highest preset adjustment gear can be determined in advance for any adjustment curve, and the number of preset key points can be set according to actual conditions. For example, as shown in Table 1:

[0058] Table 1

[0059] In the embodiment, the horizontal coordinate is the value before adjustment, and the vertical coordinate is the value after adjustment. Since the horizontal coordinate and the vertical coordinate are equal in the case of no adjustment of the image, in the various adjustment curves in the embodiment, in addition to (0, 0) and (255, 255), in positive adjustment, the value of the vertical coordinate of each preset key point is generally not less than the value of the horizontal coordinate. In negative adjustment, the value of the vertical coordinate of each preset key point is generally not greater than the value of the horizontal coordinate. Of course, the horizontal coordinate and the vertical coordinate of each preset key point can be set according to actual conditions, and can not be limited to the above rules.

[0060] Further, for the plurality of preset key points of the adjustment curve corresponding to the highest preset adjustment gear in any adjustment curve, the adjustment curve corresponding to the highest preset adjustment gear can be generated by curve fitting according to the plurality of preset key points.

[0061] And for the adjustment curve corresponding to the remaining preset adjustment gears of the adjustment curve, the plurality of target key points of the adjustment curve corresponding to any preset adjustment gear of the adjustment curve can be determined based on the plurality of preset key points of the adjustment curve corresponding to the highest preset adjustment gear and the total number of preset adjustment gears of the adjustment curve. Then, the adjustment curve corresponding to any preset adjustment gear is generated by curve fitting according to the target key points.

[0062] Optionally, when determining the plurality of target key points of the adjustment curve corresponding to any preset adjustment gear of the adjustment curve, for any preset key point, the target key point of the adjustment curve corresponding to any preset adjustment gear of the adjustment curve can be determined by linear interpolation between the preset key point and the corresponding reference point according to the total number of preset adjustment gears. In some embodiments, the corresponding reference point of the preset key point is a point on the reference curve in the case of no adjustment of the image, which has the same horizontal coordinate as the preset key point.

[0063] In the embodiment, the reference curve (y=x, that is, the vertical coordinate is equal to the horizontal coordinate) in the case of no adjustment of the image is taken as the basis, and a point on the reference curve having the same horizontal coordinate as any preset key point (x j ,yj ) having the same abscissa (x j ,x j ) as its reference point. Linear interpolation is performed between the preset key point (x j ,y j ) and the reference point (x j ,x j ) according to the total number of preset adjustment gears to obtain the target key point of the adjustment curve corresponding to each preset adjustment gear, that is, the abscissa is still x j , and the ordinate is divided equally between x j and y j according to the total number of preset adjustment gears. Specifically, if the total number of preset adjustment gears is n, for the i-th preset adjustment gear, the target key point corresponding to the preset key point (x j ,y j ) is (x j ,y i ), and the ordinate y i is calculated by the following formula: y i = x j + (i / n)*(y j -x j )

[0064] According to the above process, the target key point corresponding to each preset key point in each preset adjustment gear can be calculated, and then the adjustment curve corresponding to each preset adjustment gear is generated through curve fitting.

[0065] On the basis of the above embodiment, since the number of given preset key points is limited, the curve fitting effect is poor, therefore, when generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points in S401, curve interpolation (for example, spline interpolation) can be performed between the plurality of preset key points, and the adjustment curve corresponding to the highest preset adjustment gear is generated according to the interpolation points and the plurality of preset key points, to improve the curve fitting effect.

[0066] Similarly, since the number of calculated target key points is also limited, the curve fitting effect is poor, therefore, when generating the adjustment curve corresponding to any preset adjustment gear according to the plurality of target key points in S402, curve interpolation (for example, spline interpolation) can also be performed between the plurality of target key points. The adjustment curve corresponding to any preset adjustment gear is generated according to the interpolation points and the plurality of target key points.

[0067] On the basis of the above embodiment, the total number of preset adjustment gears can be determined by the user. That is, in response to the total number of preset adjustment gears input by the user, the process of obtaining different first adjustment curves and second adjustment curves corresponding to different preset adjustment gears in the above embodiment is performed.

[0068] The image editing method, device and storage medium provided by the embodiments of the present disclosure can convert a to-be-edited image to a first color space to obtain a first image in response to an editing instruction for the to-be-edited image, adjust the first image in a luminance channel according to a first adjustment curve to obtain a second image, convert the second image to a second color space to obtain a third image, and adjust the third image according to a second adjustment curve to obtain a target image. By adjusting the image in two color spaces, the color, luminance, saturation and other factors can be considered at the same time, the effect of image adjustment can be improved, and a higher-quality image can be obtained.

[0069] Corresponding to the image editing method of the above embodiments, FIG. 6 is a structural block diagram of an image editing device provided by the embodiments of the present disclosure. For ease of illustration, only parts related to the embodiments of the present disclosure are shown. Referring to FIG. 6, the image editing device 600 includes a conversion unit 601, a first adjustment unit 602, and a second adjustment unit 603.

[0070] The conversion unit 601 is configured to convert a to-be-edited image to a first color space to obtain a first image in response to an editing instruction for the to-be-edited image, wherein the first color space includes a luminance channel.

[0071] The first adjustment unit 602 is configured to adjust the first image in the luminance channel according to a first adjustment curve to obtain a second image.

[0072] The conversion unit 601 is further configured to convert the second image to a second color space to obtain a third image.

[0073] The second adjustment unit 603 is configured to adjust the third image according to a second adjustment curve to obtain a target image.

[0074] In one or more embodiments of the present disclosure, when adjusting the first image in the luminance channel according to the first adjustment curve, the first adjustment unit 602 is configured to: acquire a dark area of the first image; and adjust the dark area of the first image in the luminance channel according to the first adjustment curve.

[0075] In one or more embodiments of the present disclosure, when adjusting the dark area of the first image in the luminance channel according to the first adjustment curve, the first adjustment unit 602 is configured to: if the editing instruction is a positive adjustment instruction, determine a first adjustment curve for positive adjustment; and increase the luminance of the dark area of the first image in the luminance channel according to the first adjustment curve; or if the editing instruction is a negative adjustment instruction, determine a first adjustment curve for negative adjustment; and decrease the luminance of the dark area of the first image in the luminance channel according to the first adjustment curve.

[0076] In one or more embodiments of the present disclosure, the first adjusting unit 602 is further configured to, before adjusting the first image in the luminance channel according to the first adjusting curve, determine a target adjusting level from a plurality of preset adjusting levels in response to an adjusting level selection instruction, wherein different preset adjusting levels correspond to different first adjusting curves and second adjusting curves; and determine the corresponding first adjusting curve according to the target adjusting level. The second adjusting unit 603 is further configured to determine the corresponding second adjusting curve according to the target adjusting level.

[0077] In one or more embodiments of the present disclosure, the device further comprises an adjusting curve acquisition unit 604 configured to acquire different first adjusting curves and second adjusting curves corresponding to different preset adjusting levels.

[0078] In one or more embodiments of the present disclosure, the adjusting curve acquisition unit 604, when acquiring different first adjusting curves and second adjusting curves corresponding to different preset adjusting levels, is configured to, for any one of the first adjusting curve and the second adjusting curve, acquire a plurality of preset key points of the adjusting curve corresponding to a highest preset adjusting level in the adjusting curve, and generate the adjusting curve corresponding to the highest preset adjusting level according to the plurality of preset key points; and determine a plurality of target key points of the adjusting curve corresponding to any preset adjusting level in the adjusting curve according to the plurality of preset key points and a total number of preset adjusting levels in the adjusting curve, and generate the adjusting curve corresponding to the any preset adjusting level according to the plurality of target key points.

[0079] In one or more embodiments of the present disclosure, the adjusting curve acquisition unit 604, when determining a plurality of target key points of the adjusting curve corresponding to any preset adjusting level in the adjusting curve according to the plurality of preset key points and a total number of preset adjusting levels in the adjusting curve, is configured to, for any preset key point, determine a target key point of the adjusting curve corresponding to any preset adjusting level in the adjusting curve by performing linear interpolation between the preset key point and a corresponding reference point according to the total number of preset adjusting levels, wherein the corresponding reference point of the preset key point is a point on a reference curve in the case of no adjustment of the image and having the same horizontal coordinate as the preset key point.

[0080] In one or more embodiments of the present disclosure, the adjustment curve acquisition unit 604, when generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points, is configured to: perform curve interpolation between the plurality of preset key points, and generate the adjustment curve corresponding to the highest preset adjustment gear according to the interpolation points and the plurality of preset key points; and the generating the adjustment curve corresponding to any preset adjustment gear according to the plurality of target key points comprises: performing curve interpolation between the plurality of target key points, and generating the adjustment curve corresponding to any preset adjustment gear according to the interpolation points and the plurality of target key points.

[0081] In one or more embodiments of the present disclosure, the first color space comprises an HSV color space, an HSL color space, an HSI color space, or a Lab color space; and the second color space is an RGB color space.

[0082] The device provided by the embodiment can be used to execute the technical solutions of the method embodiments, and has similar implementation principles and technical effects. Details are not described herein again.

[0083] Referring to FIG. 7, a structural schematic diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure is shown. The electronic device 700 can be a terminal device or a server. The terminal device can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable media player (PMP), a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in FIG. 7 is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0084] As shown in FIG. 7, the electronic device 700 can include a processing device (such as a central processor, a graphics processor, and the like) 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 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0085] Generally, the following devices can be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 708 including, for example, a tape, a hard disk, and the like; and communication devices 709. The communication devices 709 can allow the electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although FIG. 7 shows the electronic device 700 with various devices, it is understood that all of the illustrated devices are not required to implement or have. More or less devices can alternatively be implemented or have.

[0086] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 709, or installed from the storage devices 708, or installed from the ROM 702. When the computer program is executed by the processing devices 701, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.

[0087] It should be noted that the computer-readable medium in the above disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.

[0088] The computer-readable medium described above can be contained in the electronic device described above; or can exist separately and not be assembled into the electronic device.

[0089] The computer-readable medium described above 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 carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0091] The flow diagrams and the block diagrams in the drawings are meant as possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0092] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself. For example, the first obtaining unit can also be described as a unit for obtaining at least two Internet protocol addresses.

[0093] The functions described above in the specification of the present disclosure can be performed by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0094] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, 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 can include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0095] In a first aspect, according to one or more embodiments of the present disclosure, an image editing method is provided, including: in response to an editing instruction for an image to be edited, converting the image to be edited to a first color space to obtain a first image; wherein the first color space includes a luminance channel; adjusting the first image in the luminance channel according to a first adjustment curve to obtain a second image; converting the second image to a second color space to obtain a third image; and adjusting the third image according to a second adjustment curve to obtain a target image.

[0096] According to one or more embodiments of the present disclosure, the adjusting the first image in the luminance channel according to the first adjustment curve includes: obtaining a dark region of the first image; and adjusting the dark region of the first image in the luminance channel according to the first adjustment curve.

[0097] According to one or more embodiments of the present disclosure, the adjusting the dark region of the first image in the luminance channel according to the first adjustment curve includes: if the editing instruction is a positive adjustment instruction, determining a first adjustment curve for positive adjustment; and increasing luminance of the dark region of the first image in the luminance channel according to the first adjustment curve; or if the editing instruction is a negative adjustment instruction, determining a first adjustment curve for negative adjustment; and decreasing luminance of the dark region of the first image in the luminance channel according to the first adjustment curve.

[0098] According to one or more embodiments of the present disclosure, before the adjusting the first image in the luminance channel according to the first adjustment curve, the method further includes: in response to an adjustment gear selection instruction, determining a target adjustment gear from a plurality of preset adjustment gears, wherein different preset adjustment gears correspond to different first adjustment curves and second adjustment curves; and selecting the corresponding first adjustment curve and second adjustment curve according to the target adjustment gear.

[0099] According to one or more embodiments of the present disclosure, the method further comprises: obtaining different preset adjustment gears corresponding to different first adjustment curves and second adjustment curves.

[0100] According to one or more embodiments of the present disclosure, the obtaining of the different preset adjustment gears corresponding to the different first adjustment curves and second adjustment curves comprises: for any one of the first adjustment curves and the second adjustment curves, obtaining a plurality of preset key points of an adjustment curve corresponding to a highest preset adjustment gear in the one of the first adjustment curves and the second adjustment curves, and generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points; and determining a plurality of target key points of an adjustment curve corresponding to any one of preset adjustment gears in the one of the first adjustment curves and the second adjustment curves according to the plurality of preset key points and a total number of preset adjustment gears of the one of the first adjustment curves and the second adjustment curves, and generating the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points.

[0101] According to one or more embodiments of the present disclosure, the determining of the plurality of target key points of the adjustment curve corresponding to the any one of preset adjustment gears in the one of the first adjustment curves and the second adjustment curves according to the plurality of preset key points and the total number of preset adjustment gears comprises: for any one of preset key points, performing linear interpolation between the preset key point and a corresponding reference point according to the total number of preset adjustment gears to determine a target key point of the adjustment curve corresponding to the any one of preset adjustment gears in the one of the first adjustment curves and the second adjustment curves, wherein the corresponding reference point of the preset key point is a point on a reference curve without adjustment of an image and having a same horizontal coordinate as the preset key point.

[0102] According to one or more embodiments of the present disclosure, the generating of the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points comprises: performing curve interpolation between the plurality of preset key points, and generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points and interpolation points; and the generating of the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points comprises: performing curve interpolation between the plurality of target key points, and generating the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points and interpolation points.

[0103] According to one or more embodiments of the present disclosure, the first color space comprises HSV color space, HSL color space, HSI color space, or Lab color space; and the second color space is RGB color space.

[0104] In a second aspect, according to one or more embodiments of the present disclosure, an image editing device is provided, comprising: a conversion unit configured to convert a to-be-edited image to a first color space to obtain a first image in response to an editing instruction for the to-be-edited image; wherein the first color space comprises a luminance channel; a first adjustment unit configured to adjust the first image in the luminance channel according to a first adjustment curve to obtain a second image; the conversion unit is further configured to convert the second image to a second color space to obtain a third image; and a second adjustment unit configured to adjust the third image according to a second adjustment curve to obtain a target image.

[0105] According to one or more embodiments of the present disclosure, when adjusting the first image in the luminance channel according to the first adjustment curve, the first adjustment unit is configured to: obtain a dark region of the first image; and adjust the dark region of the first image in the luminance channel according to the first adjustment curve.

[0106] According to one or more embodiments of the present disclosure, when adjusting the dark region of the first image in the luminance channel according to the first adjustment curve, the first adjustment unit is configured to: if the editing instruction is a positive adjustment instruction, determine a first adjustment curve for positive adjustment; and increase luminance of the dark region of the first image in the luminance channel according to the first adjustment curve; or if the editing instruction is a negative adjustment instruction, determine a first adjustment curve for negative adjustment; and decrease luminance of the dark region of the first image in the luminance channel according to the first adjustment curve.

[0107] According to one or more embodiments of the present disclosure, before adjusting the first image in the luminance channel according to the first adjustment curve, the first adjustment unit is further configured to: in response to an adjustment gear selection instruction, determine a target adjustment gear from a plurality of preset adjustment gears, wherein different preset adjustment gears correspond to different first adjustment curves and second adjustment curves; and select a corresponding first adjustment curve according to the target adjustment gear; and the second adjustment unit is further configured to select a corresponding second adjustment curve according to the target adjustment gear.

[0108] According to one or more embodiments of the present disclosure, the device further comprises: an adjustment curve acquisition unit configured to acquire different first adjustment curves and second adjustment curves corresponding to different preset adjustment gears.

[0109] According to one or more embodiments of the present disclosure, the adjustment curve acquisition unit, when acquiring different first adjustment curves and second adjustment curves corresponding to different preset adjustment gears, is configured to: for any one of the first adjustment curve and the second adjustment curve, acquire a plurality of preset key points of an adjustment curve corresponding to a highest preset adjustment gear in the one of the first adjustment curve and the second adjustment curve, and generate the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points; and determine a plurality of target key points of an adjustment curve corresponding to any one of preset adjustment gears in the one of the first adjustment curve and the second adjustment curve according to the plurality of preset key points and a total number of preset adjustment gears of the one of the first adjustment curve and the second adjustment curve, and generate the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points.

[0110] According to one or more embodiments of the present disclosure, when determining the plurality of target key points of the adjustment curve corresponding to any one of preset adjustment gears in the one of the first adjustment curve and the second adjustment curve according to the plurality of preset key points and the total number of preset adjustment gears of the one of the first adjustment curve and the second adjustment curve, the adjustment curve acquisition unit is configured to: for any one of the preset key points, determine a target key point of the adjustment curve corresponding to any one of preset adjustment gears in the one of the first adjustment curve and the second adjustment curve according to a linear interpolation between the preset key point and a corresponding reference point according to the total number of preset adjustment gears, where the preset key point and the corresponding reference point are points on a reference curve in a case of no adjustment of the image and have the same horizontal coordinate as the preset key point.

[0111] According to one or more embodiments of the present disclosure, when generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points, the adjustment curve acquisition unit is configured to: perform curve interpolation between the plurality of preset key points, and generate the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points and interpolation points; and when generating the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points, the adjustment curve acquisition unit is configured to: perform curve interpolation between the plurality of target key points, and generate the adjustment curve corresponding to the any one of preset adjustment gears according to the plurality of target key points and interpolation points.

[0112] According to one or more embodiments of the present disclosure, the first color space includes an HSV color space, an HSL color space, an HSI color space, or a Lab color space; and the second color space is an RGB color space.

[0113] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including at least one processor and a memory; the memory stores computer-executable instructions; and the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image editing method according to the first aspect and various possible designs of the first aspect.

[0114] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer readable storage medium is provided, and the computer readable storage medium has stored therein computer executing instructions which, when executed by a processor, implement the image editing method according to the first aspect and various possible designs of the first aspect.

[0115] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, and the computer program product includes computer executing instructions which, when executed by a processor, implement the image editing method according to the first aspect and various possible designs of the first aspect.

[0116] The above description merely illustrates the preferred embodiments of the present disclosure and the principles of the applied technologies. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by the combinations of the above technical features or equivalent features without departing from the above disclosed concept. For example, the technical solutions formed by the mutual replacement of the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions.

[0117] In addition, although each operation is depicted in a particular order, this should not be understood as requiring the operations to be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, although specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be combined in a single embodiment. Conversely, various features described in the context of a single embodiment can also be separated and implemented in multiple embodiments.

[0118] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely exemplary forms of implementing the claims.

Claims

1. An image editing method comprising: in response to an editing instruction for an image to be edited, converting the image to be edited to a first color space to obtain a first image; wherein the first color space comprises a luminance channel; adjusting the first image in the luminance channel according to a first adjustment curve to obtain a second image; converting the second image to a second color space to obtain a third image; adjusting the third image according to a second adjustment curve to obtain a target image.

2. The method of claim 1, wherein, the adjusting the first image in the luminance channel according to the first adjustment curve comprises: obtaining a dark region of the first image; adjusting the dark region of the first image in the luminance channel according to the first adjustment curve.

3. The method of claim 2, wherein, the adjusting the dark region of the first image in the luminance channel according to the first adjustment curve comprises: if the editing instruction is a positive adjustment instruction, determining a first adjustment curve for positive adjustment; increasing luminance of the dark region of the first image in the luminance channel according to the first adjustment curve; or if the editing instruction is a negative adjustment instruction, determining a first adjustment curve for negative adjustment; decreasing luminance of the dark region of the first image in the luminance channel according to the first adjustment curve.

4. The method according to any one of claims 1 to 3, wherein, before the adjusting the first image in the luminance channel according to the first adjustment curve, the method further comprises: in response to an adjustment gear selection instruction, determining a target adjustment gear from a plurality of preset adjustment gears, wherein different preset adjustment gears correspond to different first adjustment curves and second adjustment curves; selecting the corresponding first adjustment curve and second adjustment curve according to the target adjustment gear.

5. The method of claim 4, wherein, the method further comprises: obtaining that different preset adjustment gears correspond to different first adjustment curves and second adjustment curves.

6. The method of claim 5, wherein, the obtaining that different preset adjustment gears correspond to different first adjustment curves and second adjustment curves comprises: for any one of the first adjustment curve and the second adjustment curve, obtaining a plurality of preset key points of an adjustment curve corresponding to a highest preset adjustment gear in the one adjustment curve, and generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points; determining a plurality of target key points of the adjustment curve corresponding to any one of the preset adjustment gears in the one adjustment curve according to the plurality of preset key points and a total number of preset adjustment gears of the one adjustment curve, and generating the adjustment curve corresponding to the any one of the preset adjustment gears according to the plurality of target key points.

7. The method of claim 6, wherein, the determining the plurality of target key points of the adjustment curve corresponding to the any one of the preset adjustment gears in the one adjustment curve according to the plurality of preset key points and the total number of preset adjustment gears of the one adjustment curve comprises: for any one of the preset key points, performing linear interpolation between the preset key point and a corresponding reference point according to the total number of preset adjustment gears to determine a target key point of the adjustment curve corresponding to the any one of the preset adjustment gears, wherein the corresponding reference point of the preset key point is a point on a reference curve without adjustment of the image and having the same horizontal coordinate as the preset key point.

8. The method of claim 6, wherein, the generating the adjustment curve corresponding to the highest preset adjustment gear according to the plurality of preset key points comprises: The curve interpolation is performed between the plurality of preset key points, and the adjustment curve corresponding to the highest preset adjustment gear is generated according to the interpolation points and the plurality of preset key points. The adjustment curve corresponding to any preset adjustment gear is generated according to the plurality of target key points, including: The curve interpolation is performed between the plurality of target key points, and the adjustment curve corresponding to any preset adjustment gear is generated according to the interpolation points and the plurality of target key points.

9. The method of claim 1, wherein, The first color space includes HSV color space, HSL color space, HSI color space, or Lab color space; and the second color space is RGB color space. 10.An image editing device, comprising: a conversion unit configured to convert a to-be-edited image to a first color space to obtain a first image in response to an editing instruction of the to-be-edited image; wherein the first color space includes a luminance channel; a first adjustment unit configured to adjust the first image in the luminance channel according to a first adjustment curve to obtain a second image; the conversion unit is further configured to convert the second image to a second color space to obtain a third image; a second adjustment unit configured to adjust the third image according to a second adjustment curve to obtain a target image.

11. An electronic device comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method of any one of claims 1-9. 12.A computer-readable storage medium, the computer-readable storage medium storing computer-executable instructions, when a processor executes the computer-executable instructions, the method of any one of claims 1-9 is implemented. 13.A computer program product, comprising computer-executable instructions, when a processor executes the computer-executable instructions, the method of any one of claims 1-9 is implemented.