CN113286136B - Picture color adjusting method and device, computer equipment and storage medium - Google Patents
Picture color adjusting method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113286136B CN113286136B CN202110834047.8A CN202110834047A CN113286136B CN 113286136 B CN113286136 B CN 113286136B CN 202110834047 A CN202110834047 A CN 202110834047A CN 113286136 B CN113286136 B CN 113286136B
- Authority
- CN
- China
- Prior art keywords
- color
- adjustment
- adjusting
- color component
- component
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000008859 change Effects 0.000 claims description 53
- 230000014509 gene expression Effects 0.000 claims description 21
- 238000006243 chemical reaction Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 13
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 7
- 230000001105 regulatory effect Effects 0.000 claims description 4
- 238000012512 characterization method Methods 0.000 claims description 3
- 230000000007 visual effect Effects 0.000 abstract description 4
- 230000002441 reversible effect Effects 0.000 abstract description 3
- 235000019557 luminance Nutrition 0.000 description 30
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 5
- 230000007704 transition Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G5/00—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
- G09G5/02—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/77—Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2320/00—Control of display operating conditions
- G09G2320/08—Arrangements within a display terminal for setting, manually or automatically, display parameters of the display terminal
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Color Image Communication Systems (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
The application relates to a picture color adjusting method, a picture color adjusting device, computer equipment and a storage medium. The method comprises the following steps: acquiring an original color component value and an original brightness value of RGB of a picture to be adjusted; if an adjusting instruction aiming at any color component of the picture to be adjusted is received, acquiring the color adjusting variable quantity of the color component, adjusting the original color component value of the color based on the color adjusting variable quantity, and carrying out reverse adjusting operation on the original color component values of the other two color components; if an adjusting instruction aiming at the image brightness of the image to be adjusted is received, a brightness adjusting variable quantity used for adjusting the original brightness value to the target brightness value is obtained, and the original brightness value of the image to be adjusted is adjusted based on the brightness adjusting variable quantity. By adopting the method, the accurate adjustment of the picture color can be realized, and the visual effect of the picture is ensured.
Description
Technical Field
The present application relates to the field of display image color correction technologies, and in particular, to an image color adjustment method, an apparatus, a computer device, and a storage medium.
Background
With the development of science and technology, people have higher and higher requirements on the color effect of video pictures, and the adjustment or correction of the colors of the video pictures becomes an important step of picture processing.
In the conventional method, the adjustment method for the color of the video picture generally adjusts four component curves of R (red), G (green), B (blue) and W (white) in the adjustment software to adjust the RGB values representing the color. However, in the existing adjusting software, the four R, G, B, W component curves often directly affect the RGB values of the color without interfering with each other, which may cause the brightness of the color to change significantly when only one component of R, G, B, W is adjusted, and it is difficult to accurately adjust the color of the picture, thereby affecting the visual effect of the picture.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a picture color adjusting method, device, computer device and storage medium for solving the above-mentioned technical problem of picture color adjustment.
A picture color adjustment method, the method comprising:
acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
if an adjustment instruction for any one color component of the picture to be adjusted is received, acquiring a color adjustment variable quantity used for adjusting the original color component value of the color component to the target color component value, adjusting the original color component value of the color based on the color adjustment variable quantity of the color component, and performing opposite adjustment operation on the original color component values of the other two color components.
If an adjustment instruction for the image brightness of the image to be adjusted is received, acquiring a brightness adjustment variable quantity used for adjusting an original brightness value to a target brightness value, and adjusting the original brightness value of the image to be adjusted based on the brightness adjustment variable quantity.
In one embodiment, before adjusting the original color component value of the color based on the color adjustment variation of the color component, the method further includes:
generating color adjustment curves corresponding to the color components; the color adjusting curve is obtained by splicing a plurality of sections of curves; the color adjusting curve comprises a red adjusting curve, a green adjusting curve and a blue adjusting curve;
respectively determining numerical value points corresponding to the original color component values of various color components from the red adjustment curve, the green adjustment curve and the blue adjustment curve;
the adjusting the original color component value of the color based on the color adjustment variation of the color component and performing the opposite adjustment operation on the original color component values of the other two color components includes:
and adjusting the numerical points corresponding to the color components based on the color adjustment variable quantity of the color components, and carrying out opposite adjustment operation on the numerical points corresponding to the other two color components.
In one embodiment, the adjusting the amount of change based on the color of the color component, adjusting the corresponding numerical point of the color component, and performing the opposite adjustment operation on the corresponding numerical points of the other two color components includes:
acquiring a change identifier of the color adjustment variable quantity of the color component, and determining the adjustment direction of the numerical value point corresponding to the color component according to the change identifier;
moving the corresponding numerical point of the color component by a first distance in the adjusting direction, and moving the corresponding numerical point of the other two color components by a second distance in the direction opposite to the adjusting direction; the first distance and the second distance are both determined based on the adjustment variation of the color component.
In one embodiment, before adjusting the original brightness value of the picture to be adjusted based on the brightness adjustment variation, the method further includes:
generating a brightness adjusting curve, wherein the brightness adjusting curve is obtained by splicing a plurality of sections of curves;
determining a numerical point corresponding to the original brightness value from the brightness adjustment curve;
the adjusting the original brightness value of the picture to be adjusted based on the brightness adjustment variation comprises:
and adjusting the numerical value point corresponding to the original brightness value based on the brightness adjustment variable quantity.
In one embodiment, the adjusting the original brightness value of the picture to be adjusted based on the brightness adjustment variation includes:
acquiring a change identifier of the brightness adjusting variable, and determining the adjusting direction of a numerical value point corresponding to the original brightness value according to the change identifier;
and moving the numerical value point corresponding to the original brightness value to the adjusting direction by the distance corresponding to the brightness adjusting variable.
In one embodiment, after adjusting both the color component and the brightness of the RGB of the picture to be adjusted, the determining process of the adjusted color component values of the RGB includes:
respectively obtaining R, G, B the proportionality coefficients Mr, Mg and Mb of the color components; the scale factor represents the ratio of the color component values to the luminance values of the various color components in a standard color space;
for any of the color components, the raw color component values for the various color components are: r, G, B, the scaling factor for each color component: mr, Mg, Mb, adjustment variation amounts of the respective color components: substituting the delta R, the delta G, the delta B and the brightness adjustment variation delta Y into the calculation relation of the color component value after adjustment of the color component to obtain the color component value after adjustment of the color component and the color component values after adjustment of the other two color components.
In one embodiment, the determination of the computational relationship of the adjusted color component values of the various color components comprises:
according to the original color component values of the various color components: r, G, B, the proportionality coefficient: mr, Mg, Mb, the adjustment variation: Δ R, Δ G, Δ B, the adjustment variation Δ Y of the luminance, and the relationship between the color component values representing the luminance value and RGB: y = Mr + Mg + G + Mb, giving the relation of the adjusted brightness value Y':;
according to the relation of the adjusted brightness value Y', the relation of the characterization brightness value and the color component values of RGB, and the relation for keeping the brightness unchanged:obtaining:;
according to the adjustment variation of each color component: Δ R, Δ G, Δ B, and correspondingly adjusting the red component, the green component, and the blue component, respectively, to obtain a relationship of the adjusted color component values of each color component as follows:(ii) a Wherein, Delta T1Showing the corresponding variation of the other two color components after the red component is adjusted; delta T2Showing the corresponding variation of the other two color components after the green component is adjusted; delta T3Showing the corresponding variation of the other two color components after the red component is adjusted; wherein,,,;
according to the brightness adjustment variation delta Y, after the brightness of the picture to be adjusted is adjusted, the relation of the color component values of the color components is as follows:;
according to the relation of the adjusted color component value of each color component, the relation of each color component after brightness adjustment, and delta T1、ΔT2And Δ T3The calculated relation of the adjusted color component values of the various color components is obtained as:
in one embodiment, the Δ T1、ΔT2And Δ T3The determination process of the expression (c) includes:
when the red component is adjusted, the green component and the blue component have the same change Δ G and Δ B based on the relationship: Δ G = Δ B, by Δ T1Instead of Δ G and Δ B, Δ T1Substituting the relation:in (1), get Δ T1Expression (c):;
after the green component is adjusted, the red component and the blue component have the same change amounts Δ R and Δ B based on the relation that after the green component is adjusted: Δ R = Δ B, with Δ T2Instead of Δ R and Δ B, Δ T2Substituting the relation:in (1), get Δ T2Expression (c):;
after the blue component is adjusted, based on the relation that the red component and the green component have equal variation Δ R and Δ G after the blue component is adjusted: Δ R = Δ G, with Δ T3Instead of Δ R and Δ G, Δ T3Substituting the relation:in (1), get Δ T3Expression (c):。
in one embodiment, the relationship based on the adjusted color component values for each of the color components, the relationship based on the adjusted brightness for each of the color components, and Δ T1、ΔT2And Δ T3The computational relation of the adjusted color component values of the various color components is obtained by the expression of (a), comprising:
according to the relation of the adjusted color component value of each color component, the relation of each color component after brightness adjustment, and delta T1、ΔT2And Δ T3Obtaining adjusted color componentsInitial relationship of color component values:;
obtaining a transformation relation Δ R Nr =Δr, Δ N ag, Δ B Nb =Δb of adjustment variance, where Nr =1-Mr, N ag =1-M ag, Nb = 1-Mb; the transformation relation is used for representing the transformation relation between the actual adjustment variation of the original color component value and the adjustment variation of the original color component value on the image;
replacing Δ R, Δ G, and Δ B in the initial relationship with Δ R Nr, Δ N, and Δ B, respectively, in the switching relationship in combination with the relationship: nr =1-Mr, nbag =1-M, Nb =1-Mb, and the calculated relation of the adjusted color component values for the various color components is obtained:
a picture color adjustment apparatus, the apparatus comprising:
the information acquisition module is used for acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
the color adjusting module is used for acquiring a color adjusting variable quantity used for adjusting the original color component value of the color component to a target color component value if an adjusting instruction aiming at any color component of the picture to be adjusted is received, adjusting the original color component value of the color based on the color adjusting variable quantity of the color component, and carrying out opposite adjusting operation on the original color component values of the other two color components;
and the brightness adjusting module is used for acquiring a brightness adjusting variable quantity used for adjusting an original brightness value to a target brightness value if an adjusting instruction aiming at the image brightness of the image to be adjusted is received, and adjusting the original brightness value of the image to be adjusted based on the brightness adjusting variable quantity.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
if an adjustment instruction for any one color component of the picture to be adjusted is received, acquiring a color adjustment variable quantity used for adjusting the original color component value of the color component to the target color component value, adjusting the original color component value of the color based on the color adjustment variable quantity of the color component, and performing opposite adjustment operation on the original color component values of the other two color components.
If an adjustment instruction for the image brightness of the image to be adjusted is received, acquiring a brightness adjustment variable quantity used for adjusting an original brightness value to a target brightness value, and adjusting the original brightness value of the image to be adjusted based on the brightness adjustment variable quantity.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
if an adjustment instruction for any one color component of the picture to be adjusted is received, acquiring a color adjustment variable quantity used for adjusting the original color component value of the color component to the target color component value, adjusting the original color component value of the color based on the color adjustment variable quantity of the color component, and performing opposite adjustment operation on the original color component values of the other two color components.
If an adjustment instruction for the image brightness of the image to be adjusted is received, acquiring a brightness adjustment variable quantity used for adjusting an original brightness value to a target brightness value, and adjusting the original brightness value of the image to be adjusted based on the brightness adjustment variable quantity.
The image color adjusting method, the device, the computer equipment and the storage medium acquire the original brightness value of the image to be adjusted and the original color component values of the red component, the green component and the blue component before the image to be adjusted is subjected to color adjustment, then acquire the color adjustment variable quantity of any color component when an adjusting instruction aiming at the color component is received, on the basis of the color adjustment variable quantity of the color component, on one hand, adjust the original color component value of the color, on the other hand, perform reverse adjusting operation on the original color component values of the other two color components, thereby keeping the color brightness of the image to be adjusted unchanged, and on the basis of the brightness adjustment variable quantity, acquiring the RGB brightness adjustment variable quantity when the brightness of the image to be adjusted is required, directly adjusting the brightness of the image to be adjusted based on the brightness adjustment variable quantity, thereby realizing that when the color component of the image is adjusted, the brightness is kept unchanged, and the brightness is directly adjusted when the brightness of the picture is adjusted, so that the accurate adjustment of the color of the picture can be realized, and the visual effect of the picture is ensured.
Drawings
FIG. 1 is a flowchart illustrating a method for adjusting color of a display in an embodiment;
FIG. 2 is a diagram illustrating a color adjustment curve and a brightness adjustment curve in one embodiment;
FIG. 3 is a flow diagram illustrating the determination of color component values after various color component adjustments in one embodiment;
FIG. 4 is a diagram illustrating an exemplary amount of color adjustment variation for a red color component;
FIG. 5 is a diagram illustrating brightness adjustment variation according to an embodiment;
FIG. 6 is a block diagram of an exemplary embodiment of a device for adjusting color of a picture;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an embodiment, as shown in fig. 1, a picture color adjustment method is provided, and this embodiment is illustrated by applying the method to a terminal, and it is to be understood that the method may also be applied to a server, and may also be applied to a system including the terminal and the server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step S102, obtaining original color information of a picture to be adjusted; the original color information includes original color component values of RGB and original luminance values, and the original color component values include an original color component value of a red component, an original color component value of a green component, and an original color component value of a blue component.
The picture to be adjusted may be a video picture or an image.
The original brightness value may represent an initial brightness value of the to-be-adjusted picture before color adjustment.
The original color component value may represent an initial color component value of the to-be-adjusted picture before color adjustment, including color component values of the red component R, the green component G, and the blue component B).
In the specific implementation, after receiving video stream data, the terminal takes each frame of video picture in the video stream data as a picture to be adjusted, and sequentially acquires an original brightness value and an original color component value of RGB of each frame of video picture, that is, acquires an original color component value of a red component, an original color component value of a green component, and an original color component value of a blue component.
Step S104, if receiving the adjustment instruction for any color component of the picture to be adjusted, acquiring the color adjustment variation for adjusting the original color component value of the color component to the target color component value, adjusting the original color component value of the color based on the color adjustment variation of the color component, and performing reverse adjustment operation on the original color component values of the other two color components.
The color toning delta of this step may represent a toning delta of an original color component value used to tune the original color component value of a color component to a target color component value.
In a specific implementation, the original color component values of the color components can be adjusted by the color adjustment curves corresponding to the color components. In the existing method for adjusting color, when any one of the four component curves of R (red), G (green), B (blue) and W (white) is adjusted, the brightness of the picture is affected, therefore, after the terminal in this step receives an adjustment instruction for any one color component of the picture to be adjusted, the terminal in this step responds to the adjustment instruction to obtain the preset color adjustment variation of the color component, and based on the color adjustment variation of the color component, the original color component value of the color component is adjusted to the target color component value, and simultaneously, the original color component values of the other two color components are subjected to opposite adjustment operations to keep the color brightness of the picture to be adjusted unchanged, thereby improving the accuracy of color adjustment of the picture to be adjusted. Wherein the other two color components have equal amounts of change.
For example, if an adjustment instruction for a red component is received, a color adjustment change amount Δ R for adjusting an original color component value of the red component to a target color component value is acquired, the original color component value of the red component is adjusted by the change amount of Δ R, and the original color component values of the green and blue components are inversely adjusted by Nr Δ R, where Nr represents a conversion coefficient between an actual adjustment change amount of the R component and an adjustment change amount of the R component on an image.
Step S106, if an adjustment instruction for the image brightness of the image to be adjusted is received, acquiring a brightness adjustment variation for adjusting the original brightness value to the target brightness value, and adjusting the brightness of the image to be adjusted based on the brightness adjustment variation.
The brightness adjustment variation of this step may represent an adjustment variation of the original brightness value, and is used to adjust the original brightness value of the picture to be adjusted to the target brightness value.
In the specific implementation, the brightness of the picture to be adjusted can be independently controlled through the brightness adjustment curve, when the terminal receives an adjustment instruction for the picture brightness of the picture to be adjusted, the brightness adjustment variable quantity of the picture to be adjusted can be obtained, and the original brightness value of the picture to be adjusted is adjusted to the target brightness value based on the brightness adjustment variable quantity.
In the picture color adjusting method, before the picture to be adjusted is subjected to color adjustment, the original brightness value of the picture to be adjusted and the original color component values of the red component, the green component and the blue component are acquired, then when an adjusting instruction aiming at any color component is received, the color adjusting variable quantity of the color component is acquired, on the basis of the color adjusting variable quantity of the color component, on one hand, the original color component value of the color is adjusted, on the other hand, opposite adjusting operations are carried out on the original color component values of the other two color components, so that the color brightness of the picture to be adjusted is kept unchanged, and when the brightness of the picture to be adjusted needs to be adjusted, the brightness adjusting variable quantity is acquired, the brightness of the picture to be adjusted is directly adjusted on the basis of the brightness adjusting variable quantity, so that the brightness is kept unchanged when the color of the picture is adjusted, when the brightness of the picture is adjusted, the brightness is directly adjusted, so that the color of the picture can be accurately adjusted, and the visual effect of the picture is ensured.
In one embodiment, before the step of adjusting the original color component value of the color based on the color adjustment variation of the color component in step S104, the method further includes: generating color adjusting curves corresponding to the color components; the color adjusting curve is obtained by splicing a plurality of sections of curves; the color adjustment curve comprises a red adjustment curve, a green adjustment curve and a blue adjustment curve; respectively determining numerical value points corresponding to the original color component values of the various color components from the red adjustment curve, the green adjustment curve and the blue adjustment curve;
the step S104 further includes: and adjusting the numerical points corresponding to the color components based on the color adjustment variable quantity of the color components, and carrying out opposite adjustment operation on the numerical points corresponding to the other two color components.
The color adjustment curve is used for adjusting color component values of the picture to be adjusted. Specifically, the red adjustment curve is used for adjusting a red component value of the picture to be adjusted, the green adjustment curve is used for adjusting a green component value of the picture to be adjusted, and the blue adjustment curve is used for adjusting a blue component value of the picture to be adjusted.
Wherein, each color adjustment curve can be formed by splicing segmented Bezier curves, and the connecting point of the two line segments is subjected to smoothing treatment, so that the color transition is more natural.
It should be noted that, the bezier curve has two endpoints at the beginning, namely a black point and a white point, the black point and the white point can move on the frame, an adjusting point (anchor point) can be added on the connecting line of the black point and the white point, the moving of the adjusting point can correspond to the moving curve, so that the curve changes, the shape of the curve can be changed correspondingly according to the number and the position of the adjusting points, and the curve is kept smooth and continuous all the time.
In a specific implementation, before the color of the picture to be adjusted is adjusted, bezier curves corresponding to various color components may be generated in the color adjustment application as the color adjustment curves. After the original color component values of various color components of the picture to be adjusted are obtained, a numerical point corresponding to the original color component value of the red component is determined from the red adjustment curve, and an adjustment point is added at the numerical point. And determining a numerical value point corresponding to the original color component value of the green component from the green adjustment curve, and adding an adjustment point at the numerical value point. And determining a numerical point corresponding to the original color component value of the blue component from the blue color adjustment curve, and adding an adjusting point at the numerical point. Then, after the color adjustment variation of any one color component is obtained, based on the color adjustment variation of the color component, a first distance which needs to be adjusted for the color component is determined, and a second distance which needs to be adjusted for the other two color components is determined. And correspondingly moving the adjusting points added on the color adjusting curves corresponding to the color components by a first distance, and moving the adjusting points added on the color adjusting curves corresponding to the other two color components by a second distance in the opposite direction, thereby realizing the adjustment of the RGB color components of the picture to be adjusted.
In one embodiment, before the step of adjusting the original luminance value of the picture to be adjusted based on the luminance adjustment variation in step S106, the method further includes: generating a brightness adjusting curve, wherein the brightness adjusting curve is obtained by splicing a plurality of sections of curves; determining a numerical point corresponding to the original brightness value from the brightness adjustment curve;
the step S106 further includes: and adjusting the numerical point corresponding to the original brightness value based on the brightness adjustment variable quantity.
The brightness adjusting curve can be formed by splicing segmented Bezier curves, and the connecting point of the two line segments is subjected to smoothing treatment so that color transition is more natural.
In a specific implementation, before the color of the picture to be adjusted is adjusted, a bezier curve for adjusting the brightness may be generated in the color adjustment application program, and the bezier curve is used as a brightness adjustment curve. After the brightness adjustment variation is obtained, an adjustment distance is determined based on the brightness adjustment variation, and adjustment points added on the brightness adjustment curve are correspondingly moved by the adjustment distance.
Referring to fig. 2, the color adjustment curve and the brightness adjustment curve are schematically illustrated, the four curves shown in the diagram can respectively represent a red adjustment curve (R curve), a green adjustment curve (G curve), a blue adjustment curve (B curve), and a brightness adjustment curve (Y curve), the horizontal axis can represent a value range of an original color value, and the vertical axis can represent an adjustable range of a target color value. When the adjustment curve is a color adjustment curve, the horizontal axis represents the value range of the original color component value of any color component, and the vertical axis represents the adjustable range of the target color value of any color component; when the adjustment curve is a brightness adjustment curve, the horizontal axis may represent a value range of the original brightness value, and the vertical axis may represent an adjustable range of the target brightness value. The value ranges of the original color component values and the original brightness values represented by the horizontal axis can be 0-255 or 0-1023, and when the vertical axis represents different adjustment curves, the corresponding value ranges are respectively as follows:
brightness adjustment curve (Y-curve) -range is: 0 to Max Ny, and a plurality of groups,
red adjustment curve (R-curve) -range is: 0 to Max Nr, in which,
green adjustment curve (G-curve) -range is: 0 to Max × Ng, in the above-mentioned order,
blue adjustment curve (B curve) -range is: 0 to Max x Nb, in the range of,
max represents the maximum value of each component curve, and may be generally set to 255 or 1023. Ny, Nr, Ng, Nb denote conversion coefficients between actual adjustment variation amounts of the Y component curve, R component curve, G component curve, and B component curve and adjustment variation amounts in an image, respectively. Wherein, the adjustment of each curve can adjust a single curve or adjust a plurality of curves simultaneously.
In the above embodiment, the generated color adjustment curve and the luminance adjustment curve are formed by splicing segmented bezier curves, and the connection point of the line is smoothed, so that after RGB color component adjustment and luminance adjustment are performed based on the color adjustment curve and the luminance adjustment curve, color transition is more natural, and an adjustment effect can be improved.
In one embodiment, the step S104 further includes: acquiring a change identifier of the color adjustment variable quantity of the color component, and determining the adjustment direction of the numerical value point corresponding to the color component according to the change identifier; moving the corresponding numerical point of the color component by a first distance in the adjusting direction, and moving the corresponding numerical point of the other two color components by a second distance in the direction opposite to the adjusting direction; the first distance and the second distance are both determined based on the adjustment variation of the color component.
Wherein, the change mark can comprise an increase mark and a decrease mark, which can be marked by symbols "+", "-". For example, "+ Δ R" indicates an increase Δ R in the original color component value of the red component, and "— Δ R" indicates a decrease Δ R in the original color component value of the red component.
And the first distance is an adjusting distance corresponding to the color component receiving the adjusting instruction.
And the second distance is the adjusting distance of the other two color components which do not receive the adjusting instruction and have the function of keeping the brightness of the picture unchanged.
In a specific implementation, since the adjustment of the color component value of the picture to be adjusted may be to increase the color component value or to decrease the color component value, before the color component is adjusted, a change identifier of the color adjustment variation of the adjusted color component needs to be obtained, and the adjustment direction of the value point of the color component is determined according to the change identifier. And determining a first distance to be adjusted for the adjusted color component and a second distance to be adjusted for the other two color components.
More specifically, if it is determined that the change flag is an increase flag, the value point corresponding to the color component for which the adjustment instruction is received is moved by a first distance in a direction in which the value increases, and the value points corresponding to the other two color components are moved by second distances in a direction in which the values decrease. If the change identifier is determined to be a decrease identifier, moving the numerical point corresponding to the color component by a first distance in a direction of decreasing the numerical value, and moving the numerical point corresponding to each of the other two color components by a second distance in a direction of increasing the numerical value, so that the brightness of the picture is not changed after the RGB color components of the picture to be adjusted are adjusted.
In one embodiment, the step S106 further includes: acquiring a change identifier of a brightness adjusting variable, and determining the adjusting direction of a numerical value point corresponding to an original brightness value according to the change identifier; and moving the numerical value point corresponding to the original brightness value to the adjusting direction by the distance corresponding to the brightness adjusting variable.
In a specific implementation, similar to the brightness adjustment of each color component, the adjustment of the brightness value of the picture to be adjusted may be to increase the brightness value or to decrease the brightness value, so before the brightness adjustment, a change flag of the brightness adjustment variation needs to be obtained, and the adjustment direction of the numerical value point corresponding to the original brightness value is determined according to the change flag. More specifically, if the change identifier of the brightness adjustment variation is an increase identifier, moving the numerical point corresponding to the original brightness value by a distance corresponding to the brightness adjustment variation in a direction in which the numerical value increases; and if the change mark of the brightness adjustment variation is a reduction mark, moving the numerical point corresponding to the original brightness value by a distance corresponding to the brightness adjustment variation in the direction of reducing the numerical value.
In the above embodiment, the adjustment directions corresponding to the color components are determined by obtaining the change identifier of the color adjustment variation, the numerical points corresponding to the original color component values on the color adjustment curves are respectively adjusted according to the adjustment directions corresponding to the color components, the adjustment direction of the original brightness value is determined by obtaining the change identifier of the brightness adjustment variation, and the numerical points corresponding to the original brightness value on the brightness adjustment curves are adjusted based on the adjustment direction of the original brightness value, so that the color and brightness of the picture to be adjusted are adjusted by the color adjustment curves and the brightness adjustment curves with the characteristics of the bezier curves, and the adjustment curves are smooth and continuous by the characteristics of the bezier curves, and the color transition is more natural, thereby improving the adjustment effect.
In one embodiment, as shown in fig. 3, after the color components and the luminances of the RGB of the picture to be adjusted are adjusted, the determining process of the adjusted color component values of the respective color components includes:
step S302, respectively obtaining R, G, B the proportionality coefficients Mr, Mg and Mb of color components; the proportionality coefficient represents the ratio of the color component value and the brightness value of each color component in the standard color space;
step S304, for any one color component, the original color component values of the various color components are: r, G, B, scaling factor of each color component: mr, Mg, Mb, adjustment variation amount of each color component: substituting the delta R, the delta G, the delta B and the brightness adjustment variation delta Y into the calculation relation of the adjusted color component values of the color components to obtain the adjusted color component values of the color components and the adjusted color component values of the other two color components.
Wherein the sum of the scale factor of the red component, the scale factor of the green component and the scale factor of the blue component is 1.
In a specific implementation, the scale factor in the standard color space SRGB may be determined in advance through experiments, and if the scale factor for the red component is Mr, the scale factor for the green component is Mg, and the scale factor for the blue component is Mb, then Mr + Mg + Mb = 1. Where Mr =0.212671, Mg =0.715160, Mb =0.072169, Mr, Mg, Mb are understood as the scaling factors of RGB color component values and luminance values, where the relationship between RGB values, scaling factors of the respective color components and luminance Y can be expressed as:
Y=Mr*R+Mg*G+Mb*B (1)
the relational expression (1) can be used to determine the luminance value Y corresponding to a color.
For the adjustment of the color brightness, the influence of the Y curve is dominant, and therefore, each component of the color finally obtained by the color curve is a result of the combined action of Δ R, Δ G, Δ B, and Δ Y. After obtaining the original color component values of the various color components: r, G and B, the scale factor of each color component: mr, Mg, and Mb, color adjustment variation amounts of the respective color components: after Δ R, Δ G, and Δ B, and the luminance adjustment variation Δ Y, the respective values may be substituted into the calculation relation of the adjusted color component values to obtain the color component values of the adjusted color components.
In one embodiment, the determination of the computational relationship of the color component values for the various color component adjustments comprises: from the raw color component values of the various color components: r, G, B, proportionality coefficient: mr, Mg, Mb, regulated change: Δ R, Δ G, Δ B, the adjustment variation Δ Y of the luminance, and the relationship between the color component values representing the luminance value and RGB: y = Mr + Mg + G + Mb, giving the relation of the adjusted brightness value Y':(ii) a According to the relation formula of the regulated brightness value Y', the relation between the color component values for representing the brightness value and RGBThe relationship of systems, and the relationship for keeping luminance constant:obtaining:(ii) a Adjusting the variation according to each color component: and Δ R, Δ G, and Δ B, respectively adjusting the red component, the green component, and the blue component to obtain the relationship of the adjusted color component values of each color component as follows:(ii) a Wherein, Delta T1Showing the corresponding variation of the other two color components after the red component is adjusted; delta T2Showing the corresponding variation of the other two color components after the green component is adjusted; delta T3Showing the corresponding variation of the other two color components after the red component is adjusted; wherein,,,(ii) a According to the brightness adjustment variation delta Y, after the brightness of the picture to be adjusted is adjusted, the relation of the color component values of each color component is obtained as follows:(ii) a According to the relation of the adjusted color component values of the color components, the relation of the adjusted brightness components, and the delta T1、ΔT2And Δ T3The calculated relation of the adjusted color component values of the various color components is obtained as:。
in one embodiment, Δ T1、ΔT2And Δ T3The determination process of the expression (c) includes: when the red component is adjusted, the green component and the blue component have the same change Δ G and Δ B based on the relationship: Δ G = Δ B, by Δ T1Instead of Δ G and Δ B, Δ T1Substituting the relation:in (1), get Δ T1Expression (c):(ii) a After the green component is adjusted, the red component and the blue component have the same change amounts Δ R and Δ B based on the relation that after the green component is adjusted: Δ R = Δ B, with Δ T2Instead of Δ R and Δ B, Δ T2Substituting the relation:in (1), get Δ T2Expression (c):(ii) a After the blue component is adjusted, based on the relation that the red component and the green component have equal variation Δ R and Δ G after the blue component is adjusted: Δ R = Δ G, with Δ T3Instead of Δ R and Δ G, Δ T3Substituting the relation:in (1), get Δ T3Expression (c):。
in an embodiment, the step S410 specifically includes: according to the relation of the adjusted color component values of the color components, the relation of the adjusted brightness components, and the delta T1、ΔT2And Δ T3The initial relation of the adjusted color component values for the various color components is obtained:(ii) a Obtaining a conversion relation Δ R Nr =Δr, Δ 0 ag, Δ B Nb =Δb of adjustment variation, where Nr =1-Mr, N ag =1-M ag, Nb = 1-Mb; the conversion relation is used for representing the conversion relation between the actual adjustment variation of the original color component value and the adjustment variation of the original color component value on the image; replacing Δ R, Δ G, and Δ B in the initial relationship with Δ R Nr, Δ N, and Δ B, respectively, in the transformed relationship, in combination with the relationship: nr =1-Mr, nbag =1-M, Nb =1-Mb, and the calculated relation of the adjusted color component values for the various color components is obtained:。
in a specific implementation, first, the original color component value of the red component is adjusted as a primary adjustment, referring to fig. 4, which is a schematic diagram of a color adjustment variation of the red component, where the color adjustment variation of the red component obtained from the diagram is Δ R, and the color component value of the red component after the change is: r' = R + Δ R, and to keep the luminance Y constant, it is necessary to adjust the original color component values of the green component and the blue component as well, and if the color adjustment change amount of the green component is Δ G and the color adjustment change amount of the blue component is Δ B, the color component value of the green component after the change is: g' = G + Δ G, and the color component values of the changed blue component are: b' = B + Δ B. In combination with the above relation (1), it is possible to obtain:
unfolding to obtain:
by substituting the above relational expression (1) for the formula (2), it is possible to obtain:
since the brightness needs to be kept unchanged, Y' = Y, instead of formula (3), further we can obtain:
and because when the original color component value of any one color component is adjusted, the change amounts of the other two color components are the same, namely the adjustment change amount of the green color component and the adjustment change amount of the blue color component are equal, namely: Δ G = Δ B, Δ T may be introduced1Let Δ T1= Δ G = Δ B, Δ T will be1Formula (4) is substituted by = Δ G = Δ B and Mr + Mg + Mb =1, and this can be obtained
After converting the formula (5), the Delta T can be obtained1The expression of (a) is:
thus, using Δ T1After replacing Δ G and Δ B, it can be obtained that after receiving the adjustment instruction for the red color component, and in order to keep the brightness unchanged, the color component values of the red color component are sequentially adjusted for the first time, and the obtained color component values of the red color component, the green color component, and the blue color component after being respectively changed are respectively:
as with the principle of adjusting the red component described above, when adjusting the original color component value of the green componentLet Δ T be used for both the change Δ R of the red component and the change Δ B of the blue component2Instead, i.e. Δ T2= Δ R = Δ B, Δ T can be obtained2The expression of (a) is:
binding of Delta T2And equation (6), after receiving the adjustment commands for the red component and the green component, and in order to keep the brightness unchanged, sequentially performing a second adjustment on the color component values of the color components, the obtained color component values of the red component, the green component and the blue component after being respectively changed are respectively:
further, when adjusting the original color component value of the blue color component, let Δ R of the change amount of the red color component and Δ G of the change amount of the green color component both use Δ T3Alternatively, let: delta T3If = Δ R = Δ G, Δ T can be obtained3The expression of (a) is:
finally, binding of Δ T2、ΔT3And equation (6), obtaining the color component values after the color component values of the color components are adjusted three times in sequence to keep the brightness unchanged after receiving the adjustment instructions for the red component, the green component and the blue component, and obtaining the color component values after the red component, the green component and the blue component are respectively changed as follows:
adding a constraint on the values of the color component values of the color components: r ' is more than or equal to 0 and less than or equal to 255, G ' is more than or equal to 0 and less than or equal to 255, and after B ' is more than or equal to 0 and less than or equal to 255, the formula (1) can be used: y = Mr + Mg + G + Mb, and Y' is determined again.
After receiving the adjustment instruction for the original luminance value, referring to fig. 5, it is a schematic diagram of the luminance adjustment variation, from which the luminance adjustment variation is Δ Y, and when the luminance is changed by Δ Y, the RGB components corresponding to the Y value will also be changed accordingly, that is, it can be obtained:
by combining equations (7) and (8), when the adjustment commands for the red, green and blue components are received and the adjustment command for the luminance is received, the red, green and blue components are adjusted four times, and the changed color component values of the red, green and blue components are respectively:
will be Delta T1、ΔT2And Δ T3After the expression of (a) is substituted into the above expression, the initial relational expression of the color component values after the adjustment of various color components can be obtained as follows:
when the obtained values of R ', G ' and B ' are greater than Max, they are made equal to Max, when the values of R ', G ' and B ' are less than 0, they are made equal to 0, i.e. R ' is greater than or equal to 0 and less than or equal to Max, G ' is greater than or equal to 0 and less than or equal to Max, B ' is greater than or equal to 0 and less than or equal to Max, based on the relation (1), they can be obtained: y ' = Mr ' + Mg G ' + Mb ', after all four component curves of RYGB are adjusted, the corresponding delta R, delta G, delta B and delta Y are found out on the coordinate system of the Y, RGB values of the pixel points in the original image, and are substituted into the relational expression (10), the adjusted values of R ', G ' and B ' are calculated and normalized, namely, the R ', G ' and B ' are met [0, Max ], and finally, the adjusted brightness value Y ' is obtained according to the relational expression Y ' = Mr ' + Mg G ' + Mb '.
Since the size of the picture to be adjusted shown in the color adjustment application program may not be the same as the actual size of the picture to be adjusted, the adjustment variation for adjusting the RGB color components and the brightness in the color adjustment application program may not be the same as the actual adjustment variation, and therefore, after obtaining the initial relational expression of the color component values after the adjustment of the various color components, it is further necessary to obtain a conversion relational expression between the actual adjustment variation of the original color component value and the adjustment variation of the original color component value in the application program, and obtain a final calculation relational expression based on the conversion relational expression and the initial relational expression of the color component values after the adjustment of the various color components.
Specifically, converting the relationship may include: Δ R Nr =Δr, Δ N ag, Δ B =Δb, where Δ R, Δ ag, and Δ B represent adjustment changes in the image for R, G, B components, respectively, and Δ R, Δ G, and Δ B represent adjustment changes that R, G, B components actually need to be adjusted, respectively, where Nr and 1-Mr are determined to be approximately equal by experiment, i.e., Nr =1-Mr, similarly there are nberg = 1-mbit, Nb = 1-Mb; substituting Nr =1-Mr, nbag =1-M, Nb =1-Mb into R, G, B component conversion equations, respectively, yields: Δ R (1-Mr) =Δr, Δ B (1-Mb) =Δg, Δ B, and Δ R (1-Mb) of these three relationships are used to replace Δ R, Δ G, and Δ B in the initial relationship (9) for the color component values obtained after the adjustment of the color components, respectively, and the relationship of the color component values obtained after the adjustment of the color components is:
in this embodiment, through the original color component values of the various color components, the scaling factor, and the adjustment variation, and the brightness adjustment variable quantity, firstly, the initial relational expression of the color component values of the adjusted color components is obtained, after obtaining the conversion relation, replacing the adjustment variation in the initial relation with the conversion relation to obtain a calculation relation of the adjusted color component values of the color components, further, combining the original color component values of the color components, the scale coefficients of the color components, and the adjustment variation of the color components, and the adjustment variation of the brightness is substituted into the calculation relation of the adjusted color component values of the color components to obtain the color component values of the color components after adjustment, therefore, the calculation of the color component values of the adjusted color components of various color components can be realized after the adjustment is carried out on any color component.
It should be understood that although the steps in the flowcharts of fig. 1 and 3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1 and 3 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 6, there is provided a picture color adjusting apparatus including: an information obtaining module 602, a color adjusting module 604, and a brightness adjusting module 606, wherein:
an information obtaining module 602, configured to obtain original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
a color adjustment module 604, configured to, if an adjustment instruction for any color component of the picture to be adjusted is received, obtain a color adjustment variation used for adjusting the original color component value of the color component to the target color component value, adjust the original color component value of the color based on the color adjustment variation of the color component, and perform an opposite adjustment operation on the original color component values of the other two color components;
the brightness adjusting module 606 is configured to, if an adjustment instruction for the image brightness of the image to be adjusted is received, obtain a brightness adjustment variation used for adjusting the original brightness value to the target brightness value, and adjust the original brightness value of the image to be adjusted based on the brightness adjustment variation.
In one embodiment, the apparatus further includes a curve generating module, configured to generate a color adjustment curve corresponding to each color component; the color adjusting curve is obtained by splicing a plurality of sections of curves; the color adjustment curve comprises a red adjustment curve, a green adjustment curve and a blue adjustment curve; respectively determining numerical value points corresponding to the original color component values of the various color components from the red adjustment curve, the green adjustment curve and the blue adjustment curve; the color adjusting module 604 is further configured to adjust the numerical point corresponding to the color component based on the color adjustment variation of the color component, and perform an opposite adjustment operation on the numerical points corresponding to the other two color components.
In an embodiment, the color adjusting module 604 is further configured to obtain a change identifier of the color adjustment variation of the color component, and determine an adjustment direction of a numerical point corresponding to the color component according to the change identifier; moving the corresponding numerical point of the color component by a first distance in the adjusting direction, and moving the corresponding numerical point of the other two color components by a second distance in the direction opposite to the adjusting direction; the first distance and the second distance are both determined based on the adjustment variation of the color component.
In an embodiment, the curve generating module is further configured to generate a brightness adjustment curve, where the brightness adjustment curve is obtained by splicing multiple segments of curves; determining a numerical point corresponding to the original brightness value from the brightness adjustment curve; the brightness adjusting module 606 is further configured to adjust a numerical point corresponding to the original brightness value based on the brightness adjustment variation.
In an embodiment, the brightness adjusting module 606 is further configured to obtain a change identifier of the brightness adjusting variable, and determine an adjusting direction of a numerical point corresponding to the original brightness value according to the change identifier; and moving the numerical value point corresponding to the original brightness value to the adjusting direction by the distance corresponding to the brightness adjusting variable.
In one embodiment, the apparatus further includes a color component value determining module, configured to obtain the scaling coefficients Mr, Mg, and Mb of the red, green, and blue color components, respectively; the proportionality coefficient represents the ratio of the color component value and the brightness value of each color component in the standard color space; for any color component, substituting the original color component value R, G, B of each color component, the proportionality coefficients Mr, Mg, Mb of each color component, the adjustment variation Δ R, Δ G, Δ B of each color component, and the adjustment variation Δ Y of brightness into the calculation relation of the adjusted color component value of the color component to obtain the adjusted color component value of the color component and the adjusted color component values of the other two color components.
In one embodiment, the apparatus further comprises a relationship determination module for determining, based on the original color component values of the various color components: r, G, B, the proportionality coefficient: mr, Mg, Mb, the adjustment variation: Δ R, Δ G, Δ B, the adjustment variation Δ Y of the luminance, and the relationship between the color component values representing the luminance value and RGB: y = Mr + Mg + G + Mb, giving the relation of the adjusted brightness value Y':(ii) a According to the relation of the adjusted brightness value Y', the relation of the characterization brightness value and the color component values of RGB, and the relation for keeping the brightness unchanged: y' = Y, yielding:(ii) a According to the adjustment variation of each color component: Δ R, Δ G, Δ B, and correspondingly adjusting the red component, the green component, and the blue component, respectively, to obtain a relationship of the adjusted color component values of each color component as follows:(ii) a Wherein, Delta T1Showing the corresponding variation of the other two color components after the red component is adjusted; delta T2Showing the corresponding variation of the other two color components after the green component is adjusted; delta T3Showing the corresponding variation of the other two color components after the red component is adjusted; wherein,,,(ii) a According to the brightness adjustment variation delta Y, after the brightness of the picture to be adjusted is adjusted, the relation of the color component values of the color components is as follows:(ii) a According to the relation of the adjusted color component value of each color component, the relation of each color component after brightness adjustment, and delta T1、ΔT2And Δ T3The calculated relation of the adjusted color component values of the various color components is obtained as:。
in one embodiment, the relationship determining module is further configured to, after the red component is adjusted, based on a relationship that the green component and the blue component have equal changes Δ G and Δ B after the red component is adjusted: Δ G = Δ B, by Δ T1Instead of Δ G and Δ B, Δ T1Substituting the relation:in (1), get Δ T1Expression (c):(ii) a After the green component is adjusted, the red component and the blue component have the same change amounts Δ R and Δ B based on the relation that after the green component is adjusted: Δ R = Δ B, with Δ T2Instead of Δ R and Δ B, Δ T2Substituting the relation:in (1), get Δ T2Expression (c):(ii) a After the blue component is adjusted, based on the relation that the red component and the green component have equal variation Δ R and Δ G after the blue component is adjusted: Δ R = Δ G, with Δ T3Instead of Δ R and Δ G, Δ T3Substituting the relation:in (1), get Δ T3Expression (c):。
in an embodiment, the above-mentioned relation determining module is further configured to adjust the brightness of each post-cursor according to the relation of the adjusted color component values of each color componentThe relation of the color components, and Δ T1、ΔT2And Δ T3The initial relation of the adjusted color component values for the various color components is obtained:(ii) a Obtaining a conversion relation Δ R Nr =Δr, Δ 0 ag, Δ B Nb =Δb of adjustment variation, where Nr =1-Mr, N ag =1-M ag, Nb = 1-Mb; the transformation relation is used for representing the transformation relation between the actual adjustment variation of the original color component value and the adjustment variation of the original color component value on the image; replacing Δ R, Δ G, and Δ B in the initial relationship with Δ R Nr, Δ N, and Δ B, respectively, in the switching relationship in combination with the relationship: nr =1-Mr, nbag =1-M, Nb =1-Mb, and the calculated relation of the adjusted color component values for the various color components is obtained:
it should be noted that, the image color adjusting apparatus of the present application corresponds to the image color adjusting method of the present application one to one, and the technical features and the advantages thereof described in the above embodiments of the image color adjusting method are all applicable to the embodiments of the image color adjusting apparatus, and specific contents thereof can be referred to the description in the embodiments of the method of the present application, which is not repeated herein, and thus is stated herein. Further, each module in the above-described screen color adjusting apparatus may be entirely or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a picture color adjustment method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (11)
1. A picture color adjusting method is characterized by comprising the following steps:
acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
if an adjusting instruction aiming at any color component of the picture to be adjusted is received, acquiring a color adjusting variable quantity used for adjusting the original color component value of the color component to a target color component value, adjusting the original color component value of the color based on the color adjusting variable quantity of the color component, and carrying out opposite adjusting operation on the original color component values of the other two color components;
if an adjusting instruction aiming at the image brightness of the image to be adjusted is received, acquiring a brightness adjusting variable quantity used for adjusting an original brightness value to a target brightness value, and adjusting the original brightness value of the image to be adjusted based on the brightness adjusting variable quantity;
after adjusting all the color components and brightness of the picture to be adjusted, based on the original color component values of all the color components, the proportionality coefficients of all the color components, the color adjustment variable quantities of all the color components, the brightness adjustment variable quantities, and the relational expressions of the color component values for representing the brightness values and the RGB: y = Mr*R+ Mɡ*G+MbB, relation for keeping the brightness unchanged: y' = Y, and a conversion relation representing a relationship between an adjustment variation of the original color component value and an adjustment variation of the original color component value on an image: Δ R Nr =Δr, Δ B Δ Nb =Δg, and the calculated relation of the adjusted color component values for each color component is obtained:
wherein Nr =1-Mr,Nɡ=1-Mɡ,Nb=1-MbNr, N ag, Nb denote conversion coefficients between actual adjustment variation amounts of the red, green, and blue components and adjustment variation amounts in an image, respectively; r ', G ' and B ' respectively represent the regulated color component values of the red component, the green component and the blue component; r, G, B represent the original color component values of the red, green, and blue components, respectively; mr、Mɡ、MbScale coefficients representing the red, green and blue components, respectively; Δ R, Δ G, Δ B represent color adjustment variation amounts of the red, green, and blue components, respectively; Δ r, Δ Ag, and Δ b denote red components, respectivelyA color adjustment variation amount of the green component and the blue component in the image; Δ Y represents the luminance adjustment variation amount.
2. The method of claim 1, further comprising, before adjusting the original color component values of the color based on the color adjustment variance of the color component:
generating color adjustment curves corresponding to the color components; the color adjusting curve comprises a red adjusting curve, a green adjusting curve and a blue adjusting curve;
respectively determining numerical value points corresponding to the original color component values of various color components from the red adjustment curve, the green adjustment curve and the blue adjustment curve;
the adjusting the original color component value of the color based on the color adjustment variation of the color component and performing the opposite adjustment operation on the original color component values of the other two color components includes:
and adjusting the numerical points corresponding to the color components based on the color adjustment variable quantity of the color components, and carrying out opposite adjustment operation on the numerical points corresponding to the other two color components.
3. The method according to claim 2, wherein the adjusting the value points corresponding to the color components based on the color adjustment variation of the color components and performing the opposite adjustment operation on the value points corresponding to the other two color components comprises:
acquiring a change identifier of the color adjustment variable quantity of the color component, and determining the adjustment direction of the numerical value point corresponding to the color component according to the change identifier;
moving the corresponding numerical point of the color component by a first distance in the adjusting direction, and moving the corresponding numerical point of the other two color components by a second distance in the direction opposite to the adjusting direction; the first distance and the second distance are both determined based on the adjustment variation of the color component.
4. The method according to claim 1, wherein before adjusting the original luminance value of the picture to be adjusted based on the luminance adjustment variation, further comprising:
generating a brightness adjustment curve;
determining a numerical point corresponding to the original brightness value from the brightness adjustment curve;
the adjusting the original brightness value of the picture to be adjusted based on the brightness adjustment variation comprises:
and adjusting the numerical value point corresponding to the original brightness value based on the brightness adjustment variable quantity.
5. The method according to claim 4, wherein the adjusting the original brightness value of the picture to be adjusted based on the brightness adjustment variation comprises:
acquiring a change identifier of the brightness adjustment variation, and determining the adjustment direction of the numerical value point corresponding to the original brightness value according to the change identifier;
and moving the numerical value point corresponding to the original brightness value to the adjusting direction by the distance corresponding to the brightness adjusting variable quantity.
6. The method according to claim 1, wherein the determining of the adjusted color component values of RGB after adjusting both the color components and the brightness of RGB of the picture to be adjusted comprises:
the scale factors of the color components are respectively obtained R, G, B: mr、MɡAnd Mb(ii) a The scale factor represents the ratio of the color component values to the luminance values of the various color components in a standard color space;
for any of the color components, the raw color component values for the various color components are: r, G, B, the scaling factor for each color component: mr、Mɡ、MbThe adjustment variation of each color component: Δ R, Δ G, Δ B, and theSubstituting the brightness adjustment variation delta Y into the calculation relation of the color component value after the adjustment of the color component to obtain the color component value after the adjustment of the color component and the color component values after the adjustment of the other two color components.
7. The method according to claim 1, wherein the determining of the computational relation of the adjusted color component values of the respective color components comprises:
according to the original color component values of the various color components: r, G, B, the proportionality coefficient: mr、Mɡ、MbAnd the adjustment variable quantity is as follows: Δ R, Δ G, Δ B, the adjustment variation Δ Y of the luminance, and the relationship between the color component values representing the luminance value and RGB: y = Mr*R+Mɡ*G+MbB, obtaining a relation of the adjusted brightness value Y':;
according to the relation of the adjusted brightness value Y', the relation of the characterization brightness value and the color component values of RGB, and the relation for keeping the brightness unchanged: y' = Y, yielding:;
according to the adjustment variation of each color component: Δ R, Δ G, Δ B, and correspondingly adjusting the red component, the green component, and the blue component, respectively, to obtain a relationship of the adjusted color component values of each color component as follows:(ii) a Wherein, Delta T1Showing the corresponding variation of the other two color components after the red component is adjusted; delta T2Showing the corresponding variation of the other two color components after the green component is adjusted; delta T3Indicating adjustment of the red componentThen, the corresponding variation of the other two color components; wherein,,,;
according to the brightness adjustment variation delta Y, after the brightness of the picture to be adjusted is adjusted, the relation of the color component values of the color components is as follows:;
according to the relation of the adjusted color component value of each color component, the relation of each color component after brightness adjustment, and delta T1、ΔT2And Δ T3The initial relation of the adjusted color component values for the various color components is obtained:;
obtaining a conversion relation Δ R Nr =Δr, Δ N ag, Δ B =Δb of adjustment variation, where Nr =1-Mr,Nɡ=1-Mɡ,Nb=1-Mb(ii) a The transformation relation is used for representing the transformation relation between the actual adjustment variation of the original color component value and the adjustment variation of the original color component value on the image;
replacing Δ R, Δ G, and Δ B in the initial relationship with Δ R Nr, Δ N, and Δ B, respectively, in the switching relationship in combination with the relationship: nr =1-Mr,Nɡ=1-Mɡ,Nb=1-MbThe calculated relation to obtain the adjusted color component values for the various color components is:
8. the method of claim 7, wherein Δ T is measured by a time scale factor1、ΔT2And Δ T3The determination process of the expression (c) includes:
when the red component is adjusted, the green component and the blue component have the same change Δ G and Δ B based on the relationship: Δ G = Δ B, by Δ T1Instead of Δ G and Δ B, Δ T1Substituting the relation:in (1), get Δ T1Expression (c):;
after the green component is adjusted, the red component and the blue component have the same change amounts Δ R and Δ B based on the relation that after the green component is adjusted: Δ R = Δ B, with Δ T2Instead of Δ R and Δ B, Δ T2Substituting the relation:in (1), get Δ T2Expression (c):;
9. an apparatus for adjusting a color of a picture, the apparatus comprising:
the information acquisition module is used for acquiring original color information of a picture to be adjusted; the original color information includes original color component values and original luminance values of RGB;
the color adjusting module is used for acquiring a color adjusting variable quantity used for adjusting the original color component value of the color component to a target color component value if an adjusting instruction aiming at any color component of the picture to be adjusted is received, adjusting the original color component value of the color based on the color adjusting variable quantity of the color component, and carrying out opposite adjusting operation on the original color component values of the other two color components;
the brightness adjusting module is used for acquiring a brightness adjusting variable quantity used for adjusting an original brightness value to a target brightness value if an adjusting instruction aiming at the image brightness of the image to be adjusted is received, and adjusting the original brightness value of the image to be adjusted based on the brightness adjusting variable quantity;
a component value determining module, configured to, after adjusting each of the color components and the brightness of the picture to be adjusted, based on a relation between an original color component value of each of the color components, a scaling coefficient of each of the color components, a color adjustment variation of each of the color components, the brightness adjustment variation, and a color component value used for representing a relationship between a brightness value and RGB: y = Mr*R+Mɡ*G+MbB, relation for keeping the brightness unchanged: y' = Y, and a conversion relation representing a relationship between an adjustment variation of the original color component value and an adjustment variation of the original color component value on an image: Δ R Nr =Δr, Δ B Δ Nb =Δg, and the calculated relation of the adjusted color component values for each color component is obtained:
wherein Nr =1-Mr,Nɡ=1-Mɡ,Nb=1-MbNr, N ag, Nb denote conversion coefficients between actual adjustment variation amounts of the red, green, and blue components and adjustment variation amounts in an image, respectively; r ', G ' and B ' respectively represent the regulated color component values of the red component, the green component and the blue component; r, G, B represent the original color component values of the red, green, and blue components, respectively; mr、Mɡ、MbScale coefficients representing the red, green and blue components, respectively; Δ R, Δ G, Δ B represent color adjustment variation amounts of the red, green, and blue components, respectively; Δ r, Δ Ag, and Δ b represent the color adjustment variation amounts of the red, green, and blue components in the image, respectively; Δ Y represents the luminance adjustment variation amount.
10. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110834047.8A CN113286136B (en) | 2021-07-23 | 2021-07-23 | Picture color adjusting method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110834047.8A CN113286136B (en) | 2021-07-23 | 2021-07-23 | Picture color adjusting method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113286136A CN113286136A (en) | 2021-08-20 |
CN113286136B true CN113286136B (en) | 2021-12-17 |
Family
ID=77287083
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110834047.8A Active CN113286136B (en) | 2021-07-23 | 2021-07-23 | Picture color adjusting method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113286136B (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104282284B (en) * | 2014-10-24 | 2016-08-24 | 武汉精测电子技术股份有限公司 | A kind of white balance adjusting method of liquid crystal display |
CN108171646B (en) * | 2016-12-07 | 2021-07-23 | 展讯通信(上海)有限公司 | Image tone adjusting method and device based on brightness maintenance |
CN107068114B (en) * | 2017-04-24 | 2019-04-30 | 北京小米移动软件有限公司 | Screen color method of adjustment, device, equipment and storage medium |
CN108200420B (en) * | 2018-01-16 | 2020-05-19 | 奇酷互联网络科技(深圳)有限公司 | Image adjusting method and device, readable storage medium and terminal |
CN108376539B (en) * | 2018-04-09 | 2019-12-10 | 青岛海信电器股份有限公司 | Image color compensation method and device |
CN112948029B (en) * | 2019-11-26 | 2023-12-29 | 上海哔哩哔哩科技有限公司 | Page adjustment method, page adjustment device, computer equipment and computer readable storage medium |
CN111968590B (en) * | 2020-08-12 | 2021-10-08 | Tcl华星光电技术有限公司 | Picture display adjusting method and device, storage medium and display equipment |
-
2021
- 2021-07-23 CN CN202110834047.8A patent/CN113286136B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113286136A (en) | 2021-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113284456B (en) | Method and device for determining correction coefficient of display screen lamp point and computer equipment | |
CN111243550B (en) | Adjusting device, adjusting method and medium for gamma voltage and white balance of display screen | |
KR100886099B1 (en) | Apparatus for automatically computing image correction curve and Method thereof | |
US8497872B2 (en) | White balance correction method | |
US20090153745A1 (en) | Multi-view camera color calibration method using color checker chart | |
JP6793281B2 (en) | Color gamut mapping method and color gamut mapping device | |
CN111161691A (en) | Compensation method and compensation device for display screen and display device | |
CN103325351B (en) | Image processing apparatus and image processing method | |
CN101901474B (en) | Change the method for at least one in the density of image and contrast | |
DE102010055454A1 (en) | Techniques for adjusting a color gamut | |
JP2005354711A (en) | Color gamut mapping apparatus using vector stretching and method therefor | |
EP3566430B1 (en) | Color saturation adjustment in non-uniform color space | |
WO2019071737A1 (en) | Image processing method, electronic apparatus, and device having storage function | |
CN113994420A (en) | Metameric stabilization via custom viewer color matching functions | |
CN110580693A (en) | Image processing method, image processing device, computer equipment and storage medium | |
JP4609674B2 (en) | Image processing system, display device, program, and information storage medium | |
WO1999056088A1 (en) | Method to estimate the white point on a display device | |
US8121405B2 (en) | Systems and methods for skin-color-cognizant color mapping | |
CN113286136B (en) | Picture color adjusting method and device, computer equipment and storage medium | |
JPH05300375A (en) | Sharpness processing unit | |
CN113674711B (en) | Low gray scale color temperature regulation and control method, device, equipment and storage medium | |
CN112929625A (en) | Display material rendering method and device | |
CN109119046B (en) | Adjusting system and adjusting method for gray scale brightness and memory | |
CN110047415B (en) | Color gamut mapping method, electronic device and storage medium | |
JP2003051953A (en) | Device, method and program for generating monochromatic image data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |