Permalink
Browse files

beautify: add smart color effect

  • Loading branch information...
1 parent f0741ca commit fc9b47cd89e648635fd258f44ff1425b02762277 @hejiann committed Jul 14, 2012
Showing with 81 additions and 0 deletions.
  1. +3 −0 README
  2. +33 −0 beautify.c
  3. +45 −0 curves/smart-color
View
@@ -26,6 +26,9 @@ Tools -> Beautify -> Rip Border
CHANGELOG
===================
+2012-07-14
+beautify: add smart color effect
+
2012-07-13
beautify: add little fresh effect
View
@@ -45,6 +45,7 @@ typedef enum
BEAUTIFY_EFFECT_SOFT_LIGHT,
BEAUTIFY_EFFECT_WARM,
BEAUTIFY_EFFECT_SHARPEN,
+ BEAUTIFY_EFFECT_SMART_COLOR,
BEAUTIFY_EFFECT_INVERT,
BEAUTIFY_EFFECT_LITTLE_FRESH,
BEAUTIFY_EFFECT_ABAO,
@@ -632,6 +633,7 @@ create_effect_pages (GtkNotebook *notebook) {
BEAUTIFY_EFFECT_SOFT_LIGHT,
BEAUTIFY_EFFECT_WARM,
BEAUTIFY_EFFECT_SHARPEN,
+ BEAUTIFY_EFFECT_SMART_COLOR,
BEAUTIFY_EFFECT_INVERT,
BEAUTIFY_EFFECT_LITTLE_FRESH,
BEAUTIFY_EFFECT_ABAO,
@@ -685,6 +687,9 @@ effect_icon_new (BeautifyEffectType effect)
case BEAUTIFY_EFFECT_SHARPEN:
title = "Sharpen";
break;
+ case BEAUTIFY_EFFECT_SMART_COLOR:
+ title = "Smart Color";
+ break;
case BEAUTIFY_EFFECT_INVERT:
title = "Invert";
break;
@@ -785,6 +790,34 @@ do_effect (gint32 image, BeautifyEffectType effect)
gimp_destroy_params (return_vals, nreturn_vals);
}
break;
+ case BEAUTIFY_EFFECT_SMART_COLOR:
+ {
+ guint8 red_pts[] = {
+ 0.0, 0.001012 * 255, 0.121569 * 255, 0.126695 * 255,
+ 0.247059 * 255, 0.279821 * 255, 0.372549 * 255, 0.428038 * 255,
+ 0.498039 * 255, 0.567700 * 255, 0.623529 * 255, 0.699439 * 255,
+ 0.749020 * 255, 0.821423 * 255, 0.874510 * 255, 0.953474 * 255,
+ 1.000000 * 255, 0.997988 * 255,
+ };
+ guint8 green_pts[] = {
+ 0.0, 0.004278 * 255, 0.121569 * 255, 0.107139 * 255,
+ 0.247059 * 255, 0.225961 * 255, 0.372549 * 255, 0.346578 * 255,
+ 0.498039 * 255, 0.472647 * 255, 0.623529 * 255, 0.602136 * 255,
+ 0.749020 * 255, 0.730046 * 255, 0.874510 * 255, 0.873495 * 255,
+ 1.000000 * 255, 0.996787 * 255,
+ };
+ guint8 blue_pts[] = {
+ 0.0, 0.000105 * 255, 0.121569 * 255, 0.060601 * 255,
+ 0.247059 * 255, 0.146772 * 255, 0.372549 * 255, 0.262680 * 255,
+ 0.498039 * 255, 0.408053 * 255, 0.623529 * 255, 0.566459 * 255,
+ 0.749020 * 255, 0.691468 * 255, 0.874510 * 255, 0.847356 * 255,
+ 1.000000 * 255, 0.999226 * 255,
+ };
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_RED, 18, red_pts);
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_GREEN, 18, green_pts);
+ gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
+ }
+ break;
case BEAUTIFY_EFFECT_INVERT:
gimp_invert (effect_layer);
break;
View
@@ -0,0 +1,45 @@
+# GIMP curves tool settings
+
+(time 0)
+(time 0)
+(channel value)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.000000 0.003922 0.007843 0.011765 0.015686 0.019608 0.023529 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.050980 0.054902 0.058824 0.062745 0.066667 0.070588 0.074510 0.078431 0.082353 0.086275 0.090196 0.094118 0.098039 0.101961 0.105882 0.109804 0.113725 0.117647 0.121569 0.125490 0.129412 0.133333 0.137255 0.141176 0.145098 0.149020 0.152941 0.156863 0.160784 0.164706 0.168627 0.172549 0.176471 0.180392 0.184314 0.188235 0.192157 0.196078 0.200000 0.203922 0.207843 0.211765 0.215686 0.219608 0.223529 0.227451 0.231373 0.235294 0.239216 0.243137 0.247059 0.250980 0.254902 0.258824 0.262745 0.266667 0.270588 0.274510 0.278431 0.282353 0.286275 0.290196 0.294118 0.298039 0.301961 0.305882 0.309804 0.313725 0.317647 0.321569 0.325490 0.329412 0.333333 0.337255 0.341176 0.345098 0.349020 0.352941 0.356863 0.360784 0.364706 0.368627 0.372549 0.376471 0.380392 0.384314 0.388235 0.392157 0.396078 0.400000 0.403922 0.407843 0.411765 0.415686 0.419608 0.423529 0.427451 0.431373 0.435294 0.439216 0.443137 0.447059 0.450980 0.454902 0.458824 0.462745 0.466667 0.470588 0.474510 0.478431 0.482353 0.486275 0.490196 0.494118 0.498039 0.501961 0.505882 0.509804 0.513725 0.517647 0.521569 0.525490 0.529412 0.533333 0.537255 0.541176 0.545098 0.549020 0.552941 0.556863 0.560784 0.564706 0.568627 0.572549 0.576471 0.580392 0.584314 0.588235 0.592157 0.596078 0.600000 0.603922 0.607843 0.611765 0.615686 0.619608 0.623529 0.627451 0.631373 0.635294 0.639216 0.643137 0.647059 0.650980 0.654902 0.658824 0.662745 0.666667 0.670588 0.674510 0.678431 0.682353 0.686275 0.690196 0.694118 0.698039 0.701961 0.705882 0.709804 0.713725 0.717647 0.721569 0.725490 0.729412 0.733333 0.737255 0.741176 0.745098 0.749020 0.752941 0.756863 0.760784 0.764706 0.768627 0.772549 0.776471 0.780392 0.784314 0.788235 0.792157 0.796078 0.800000 0.803922 0.807843 0.811765 0.815686 0.819608 0.823529 0.827451 0.831373 0.835294 0.839216 0.843137 0.847059 0.850980 0.854902 0.858824 0.862745 0.866667 0.870588 0.874510 0.878431 0.882353 0.886275 0.890196 0.894118 0.898039 0.901961 0.905882 0.909804 0.913725 0.917647 0.921569 0.925490 0.929412 0.933333 0.937255 0.941176 0.945098 0.949020 0.952941 0.956863 0.960784 0.964706 0.968627 0.972549 0.976471 0.980392 0.984314 0.988235 0.992157 0.996078 1.000000))
+(time 0)
+(channel red)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.001012 -1.000000 -1.000000 0.121569 0.126695 -1.000000 -1.000000 0.247059 0.279821 -1.000000 -1.000000 0.372549 0.428038 -1.000000 -1.000000 0.498039 0.567700 -1.000000 -1.000000 0.623529 0.699439 -1.000000 -1.000000 0.749020 0.821423 -1.000000 -1.000000 0.874510 0.953474 -1.000000 -1.000000 1.000000 0.997988)
+ (n-samples 256)
+ (samples 256 0.001012 0.004881 0.008751 0.012623 0.016499 0.020379 0.024266 0.028159 0.032060 0.035971 0.039892 0.043824 0.047770 0.051729 0.055703 0.059694 0.063702 0.067728 0.071774 0.075842 0.079931 0.084043 0.088179 0.092341 0.096530 0.100747 0.104992 0.109268 0.113575 0.117914 0.122287 0.126695 0.131145 0.135642 0.140184 0.144768 0.149391 0.154052 0.158746 0.163473 0.168229 0.173012 0.177819 0.182647 0.187495 0.192359 0.197237 0.202126 0.207024 0.211929 0.216837 0.221747 0.226655 0.231559 0.236457 0.241345 0.246222 0.251085 0.255931 0.260758 0.265563 0.270343 0.275097 0.279821 0.284529 0.289235 0.293939 0.298642 0.303341 0.308038 0.312731 0.317421 0.322107 0.326789 0.331466 0.336138 0.340805 0.345466 0.350122 0.354771 0.359414 0.364049 0.368678 0.373299 0.377912 0.382517 0.387113 0.391700 0.396278 0.400847 0.405405 0.409954 0.414492 0.419018 0.423534 0.428038 0.432532 0.437016 0.441492 0.445959 0.450418 0.454867 0.459308 0.463741 0.468165 0.472580 0.476987 0.481386 0.485777 0.490159 0.494533 0.498899 0.503257 0.507607 0.511949 0.516283 0.520609 0.524928 0.529239 0.533542 0.537838 0.542126 0.546407 0.550680 0.554946 0.559204 0.563456 0.567700 0.571938 0.576169 0.580394 0.584613 0.588825 0.593031 0.597229 0.601420 0.605604 0.609781 0.613950 0.618111 0.622264 0.626409 0.630546 0.634674 0.638794 0.642905 0.647007 0.651100 0.655183 0.659257 0.663321 0.667376 0.671420 0.675455 0.679479 0.683493 0.687496 0.691488 0.695469 0.699439 0.703389 0.707312 0.711210 0.715085 0.718938 0.722771 0.726586 0.730385 0.734169 0.737941 0.741703 0.745455 0.749200 0.752940 0.756677 0.760412 0.764146 0.767883 0.771624 0.775370 0.779124 0.782887 0.786661 0.790448 0.794249 0.798067 0.801904 0.805760 0.809638 0.813540 0.817468 0.821423 0.825443 0.829560 0.833764 0.838046 0.842398 0.846810 0.851273 0.855780 0.860319 0.864884 0.869464 0.874052 0.878637 0.883211 0.887765 0.892290 0.896778 0.901219 0.905604 0.909924 0.914171 0.918335 0.922408 0.926380 0.930243 0.933988 0.937606 0.941088 0.944424 0.947607 0.950626 0.953474 0.956169 0.958741 0.961191 0.963526 0.965749 0.967863 0.969873 0.971783 0.973597 0.975319 0.976952 0.978502 0.979971 0.981364 0.982685 0.983938 0.985126 0.986255 0.987327 0.988348 0.989320 0.990248 0.991137 0.991989 0.992809 0.993601 0.994369 0.995117 0.995848 0.996568 0.997280 0.997988))
+(time 0)
+(channel green)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.004278 -1.000000 -1.000000 0.121569 0.107139 -1.000000 -1.000000 0.247059 0.225961 -1.000000 -1.000000 0.372549 0.346578 -1.000000 -1.000000 0.498039 0.472647 -1.000000 -1.000000 0.623529 0.602136 -1.000000 -1.000000 0.749020 0.730046 -1.000000 -1.000000 0.874510 0.873495 -1.000000 -1.000000 1.000000 0.996787)
+ (n-samples 256)
+ (samples 256 0.004278 0.007496 0.010714 0.013934 0.017156 0.020380 0.023607 0.026838 0.030074 0.033314 0.036560 0.039812 0.043072 0.046338 0.049613 0.052897 0.056190 0.059493 0.062807 0.066132 0.069468 0.072818 0.076180 0.079557 0.082948 0.086353 0.089775 0.093213 0.096667 0.100139 0.103630 0.107139 0.110669 0.114220 0.117792 0.121384 0.124994 0.128622 0.132267 0.135928 0.139603 0.143292 0.146993 0.150707 0.154432 0.158166 0.161909 0.165660 0.169418 0.173182 0.176951 0.180725 0.184501 0.188279 0.192058 0.195838 0.199616 0.203393 0.207167 0.210937 0.214703 0.218463 0.222216 0.225961 0.229701 0.233440 0.237178 0.240915 0.244651 0.248388 0.252124 0.255861 0.259599 0.263338 0.267079 0.270821 0.274566 0.278313 0.282063 0.285817 0.289573 0.293334 0.297099 0.300868 0.304643 0.308422 0.312207 0.315998 0.319796 0.323599 0.327410 0.331228 0.335053 0.338886 0.342728 0.346578 0.350436 0.354301 0.358173 0.362052 0.365938 0.369830 0.373728 0.377632 0.381542 0.385457 0.389378 0.393304 0.397236 0.401172 0.405113 0.409058 0.413008 0.416962 0.420919 0.424881 0.428846 0.432815 0.436787 0.440761 0.444739 0.448720 0.452702 0.456687 0.460675 0.464664 0.468655 0.472647 0.476644 0.480649 0.484661 0.488680 0.492706 0.496737 0.500774 0.504816 0.508862 0.512913 0.516967 0.521024 0.525084 0.529147 0.533211 0.537276 0.541343 0.545410 0.549477 0.553543 0.557608 0.561672 0.565735 0.569795 0.573852 0.577906 0.581956 0.586002 0.590044 0.594080 0.598111 0.602136 0.606149 0.610145 0.614126 0.618094 0.622050 0.625995 0.629931 0.633860 0.637784 0.641703 0.645619 0.649535 0.653451 0.657369 0.661291 0.665218 0.669152 0.673095 0.677047 0.681011 0.684988 0.688980 0.692987 0.697013 0.701058 0.705124 0.709212 0.713324 0.717463 0.721628 0.725822 0.730046 0.734310 0.738622 0.742976 0.747371 0.751803 0.756269 0.760765 0.765288 0.769835 0.774403 0.778988 0.783587 0.788197 0.792815 0.797436 0.802059 0.806680 0.811295 0.815901 0.820495 0.825074 0.829634 0.834173 0.838686 0.843171 0.847624 0.852042 0.856422 0.860761 0.865055 0.869300 0.873495 0.877648 0.881773 0.885870 0.889940 0.893984 0.898004 0.901999 0.905972 0.909922 0.913851 0.917759 0.921649 0.925520 0.929373 0.933210 0.937031 0.940837 0.944629 0.948409 0.952176 0.955933 0.959679 0.963416 0.967145 0.970866 0.974581 0.978291 0.981996 0.985697 0.989395 0.993091 0.996787))
+(time 0)
+(channel blue)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.000105 -1.000000 -1.000000 0.121569 0.060601 -1.000000 -1.000000 0.247059 0.146772 -1.000000 -1.000000 0.372549 0.262680 -1.000000 -1.000000 0.498039 0.408053 -1.000000 -1.000000 0.623529 0.566459 -1.000000 -1.000000 0.749020 0.691468 -1.000000 -1.000000 0.874510 0.847356 -1.000000 -1.000000 1.000000 0.999226)
+ (n-samples 256)
+ (samples 256 0.000105 0.001868 0.003633 0.005400 0.007170 0.008946 0.010727 0.012515 0.014311 0.016117 0.017933 0.019761 0.021602 0.023457 0.025327 0.027214 0.029119 0.031042 0.032985 0.034950 0.036936 0.038947 0.040982 0.043042 0.045130 0.047246 0.049392 0.051568 0.053776 0.056016 0.058291 0.060601 0.062937 0.065291 0.067662 0.070052 0.072460 0.074888 0.077336 0.079805 0.082295 0.084807 0.087341 0.089898 0.092479 0.095084 0.097714 0.100369 0.103050 0.105757 0.108492 0.111254 0.114044 0.116864 0.119712 0.122591 0.125501 0.128441 0.131413 0.134418 0.137456 0.140527 0.143632 0.146772 0.149944 0.153146 0.156376 0.159636 0.162925 0.166244 0.169591 0.172968 0.176373 0.179808 0.183272 0.186765 0.190287 0.193837 0.197417 0.201026 0.204664 0.208330 0.212025 0.215750 0.219503 0.223284 0.227095 0.230934 0.234802 0.238699 0.242624 0.246578 0.250561 0.254572 0.258612 0.262680 0.266785 0.270933 0.275122 0.279353 0.283622 0.287928 0.292270 0.296646 0.301055 0.305495 0.309966 0.314464 0.318989 0.323540 0.328114 0.332710 0.337328 0.341964 0.346618 0.351289 0.355974 0.360672 0.365382 0.370103 0.374832 0.379568 0.384310 0.389056 0.393805 0.398555 0.403305 0.408053 0.412828 0.417657 0.422535 0.427458 0.432423 0.437425 0.442459 0.447521 0.452607 0.457713 0.462835 0.467968 0.473108 0.478251 0.483393 0.488529 0.493655 0.498766 0.503860 0.508930 0.513974 0.518986 0.523963 0.528900 0.533794 0.538639 0.543431 0.548167 0.552842 0.557452 0.561992 0.566459 0.570841 0.575133 0.579341 0.583472 0.587531 0.591524 0.595457 0.599336 0.603166 0.606954 0.610706 0.614426 0.618123 0.621800 0.625464 0.629121 0.632777 0.636437 0.640108 0.643796 0.647505 0.651243 0.655015 0.658827 0.662685 0.666595 0.670562 0.674593 0.678693 0.682868 0.687124 0.691468 0.695889 0.700370 0.704910 0.709504 0.714149 0.718843 0.723582 0.728363 0.733182 0.738037 0.742925 0.747841 0.752783 0.757748 0.762732 0.767733 0.772747 0.777771 0.782801 0.787835 0.792870 0.797901 0.802927 0.807943 0.812947 0.817935 0.822904 0.827851 0.832773 0.837667 0.842529 0.847356 0.852162 0.856962 0.861756 0.866546 0.871330 0.876109 0.880883 0.885653 0.890418 0.895180 0.899937 0.904690 0.909439 0.914185 0.918928 0.923668 0.928404 0.933138 0.937870 0.942598 0.947325 0.952050 0.956773 0.961494 0.966214 0.970932 0.975649 0.980366 0.985082 0.989797 0.994511 0.999226))
+(time 0)
+(channel alpha)
+(curve
+ (curve-type free)
+ (n-points 17)
+ (points 34 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000)
+ (n-samples 256)
+ (samples 256 0.000000 0.003922 0.007843 0.011765 0.015686 0.019608 0.023529 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.050980 0.054902 0.058824 0.062745 0.066667 0.070588 0.074510 0.078431 0.082353 0.086275 0.090196 0.094118 0.098039 0.101961 0.105882 0.109804 0.113725 0.117647 0.121569 0.125490 0.129412 0.133333 0.137255 0.141176 0.145098 0.149020 0.152941 0.156863 0.160784 0.164706 0.168627 0.172549 0.176471 0.180392 0.184314 0.188235 0.192157 0.196078 0.200000 0.203922 0.207843 0.211765 0.215686 0.219608 0.223529 0.227451 0.231373 0.235294 0.239216 0.243137 0.247059 0.250980 0.254902 0.258824 0.262745 0.266667 0.270588 0.274510 0.278431 0.282353 0.286275 0.290196 0.294118 0.298039 0.301961 0.305882 0.309804 0.313725 0.317647 0.321569 0.325490 0.329412 0.333333 0.337255 0.341176 0.345098 0.349020 0.352941 0.356863 0.360784 0.364706 0.368627 0.372549 0.376471 0.380392 0.384314 0.388235 0.392157 0.396078 0.400000 0.403922 0.407843 0.411765 0.415686 0.419608 0.423529 0.427451 0.431373 0.435294 0.439216 0.443137 0.447059 0.450980 0.454902 0.458824 0.462745 0.466667 0.470588 0.474510 0.478431 0.482353 0.486275 0.490196 0.494118 0.498039 0.501961 0.505882 0.509804 0.513725 0.517647 0.521569 0.525490 0.529412 0.533333 0.537255 0.541176 0.545098 0.549020 0.552941 0.556863 0.560784 0.564706 0.568627 0.572549 0.576471 0.580392 0.584314 0.588235 0.592157 0.596078 0.600000 0.603922 0.607843 0.611765 0.615686 0.619608 0.623529 0.627451 0.631373 0.635294 0.639216 0.643137 0.647059 0.650980 0.654902 0.658824 0.662745 0.666667 0.670588 0.674510 0.678431 0.682353 0.686275 0.690196 0.694118 0.698039 0.701961 0.705882 0.709804 0.713725 0.717647 0.721569 0.725490 0.729412 0.733333 0.737255 0.741176 0.745098 0.749020 0.752941 0.756863 0.760784 0.764706 0.768627 0.772549 0.776471 0.780392 0.784314 0.788235 0.792157 0.796078 0.800000 0.803922 0.807843 0.811765 0.815686 0.819608 0.823529 0.827451 0.831373 0.835294 0.839216 0.843137 0.847059 0.850980 0.854902 0.858824 0.862745 0.866667 0.870588 0.874510 0.878431 0.882353 0.886275 0.890196 0.894118 0.898039 0.901961 0.905882 0.909804 0.913725 0.917647 0.921569 0.925490 0.929412 0.933333 0.937255 0.941176 0.945098 0.949020 0.952941 0.956863 0.960784 0.964706 0.968627 0.972549 0.976471 0.980392 0.984314 0.988235 0.992157 0.996078 1.000000))
+
+# end of curves tool settings

0 comments on commit fc9b47c

Please sign in to comment.