Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

beautify: fix contrast adjustment tool.

  • Loading branch information...
commit e90a244b0cff5d3a92e74827aff8f18bc0df0603 1 parent 2c52eb2
Jian He authored
Showing with 13 additions and 6 deletions.
  1. +3 −0  README
  2. +10 −6 beautify.c
3  README
View
@@ -47,6 +47,9 @@ GIMP Chat: http://www.gimpchat.com/viewtopic.php?f=9&t=4811
CHANGELOG
===================
+2012-08-06
+beautify: fix contrast adjustment tool.
+
2012-08-05
beautify: fix the Black And White effect.
16 beautify.c
View
@@ -707,20 +707,24 @@ adjustment () {
gint high_input = 255;
gint low_output = 0;
gint high_output = 255;
+
if (bvals.brightness > 0) {
high_input -= bvals.brightness;
}
if (bvals.brightness < 0) {
high_output += bvals.brightness;
}
- if (bvals.contrast > 0) {
- low_input += bvals.contrast;
- high_input -= bvals.contrast;
+
+ gint value = 62 * (bvals.contrast / 50);
+ if (value > 0) {
+ low_input += value;
+ high_input -= value;
}
- if (bvals.contrast < 0) {
- low_output -= bvals.contrast;
- high_output += bvals.contrast;
+ if (value < 0) {
+ low_output -= value;
+ high_output += value;
}
+
gimp_levels (layer, GIMP_HISTOGRAM_VALUE,
low_input, high_input,
1,
Please sign in to comment.
Something went wrong with that request. Please try again.