Skip to content

Commit

Permalink
beautify: add retro effect
Browse files Browse the repository at this point in the history
  • Loading branch information
hejiann committed Jul 20, 2012
1 parent 9d0e03a commit c4a952b
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README
Expand Up @@ -32,6 +32,9 @@ Support: #beautify on FreeNode
CHANGELOG
===================

2012-07-21
beautify: add retro effect

2012-07-20
fix make install in x86_64
beautify refactor: split the effect code into beautify-feature.c
Expand Down
40 changes: 40 additions & 0 deletions beautify-effect.c
Expand Up @@ -346,6 +346,46 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
}
break;
case BEAUTIFY_EFFECT_RETRO:
{
guint8 red_pts[] = {
0.000000 * 255, 0.011765 * 255,
0.121569 * 255, 0.050275 * 255,
0.247059 * 255, 0.163976 * 255,
0.372549 * 255, 0.316983 * 255,
0.498039 * 255, 0.493141 * 255,
0.623529 * 255, 0.671170 * 255,
0.749020 * 255, 0.829955 * 255,
0.874510 * 255, 0.941938 * 255,
1.000000 * 255, 0.988797 * 255,
};
guint8 green_pts[] = {
0.000000 * 255, 0.044118 * 255,
0.121569 * 255, 0.081048 * 255,
0.247059 * 255, 0.181188 * 255,
0.372549 * 255, 0.327417 * 255,
0.498039 * 255, 0.493717 * 255,
0.623529 * 255, 0.658936 * 255,
0.749020 * 255, 0.811563 * 255,
0.874510 * 255, 0.915557 * 255,
1.000000 * 255, 0.956299 * 255,
};
guint8 blue_pts[] = {
0.000000 * 255, 0.247630 * 255,
0.121569 * 255, 0.268491 * 255,
0.247059 * 255, 0.325230 * 255,
0.372549 * 255, 0.405204 * 255,
0.498039 * 255, 0.497829 * 255,
0.623529 * 255, 0.588839 * 255,
0.749020 * 255, 0.675181 * 255,
0.874510 * 255, 0.731610 * 255,
1.000000 * 255, 0.752075 * 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_PINK_LADY:
{
guint8 red_pts[] = {
Expand Down
1 change: 1 addition & 0 deletions beautify-effect.h
Expand Up @@ -33,6 +33,7 @@ typedef enum
BEAUTIFY_EFFECT_IMPRESSION,

BEAUTIFY_EFFECT_LITTLE_FRESH,
BEAUTIFY_EFFECT_RETRO,
BEAUTIFY_EFFECT_PINK_LADY,
BEAUTIFY_EFFECT_ABAO,
BEAUTIFY_EFFECT_ICE_SPIRIT,
Expand Down
4 changes: 4 additions & 0 deletions beautify.c
Expand Up @@ -62,6 +62,7 @@ static const BeautifyEffectType lomo_effects[] =
static const BeautifyEffectType studio_effects[] =
{
BEAUTIFY_EFFECT_LITTLE_FRESH,
BEAUTIFY_EFFECT_RETRO,
BEAUTIFY_EFFECT_PINK_LADY,
BEAUTIFY_EFFECT_ABAO,
BEAUTIFY_EFFECT_ICE_SPIRIT,
Expand Down Expand Up @@ -832,6 +833,9 @@ effect_icon_new (BeautifyEffectType effect)
case BEAUTIFY_EFFECT_LITTLE_FRESH:
title = "Little Fresh";
break;
case BEAUTIFY_EFFECT_RETRO:
title = "Retro";
break;
case BEAUTIFY_EFFECT_PINK_LADY:
title = "Pink Lady";
break;
Expand Down
45 changes: 45 additions & 0 deletions curves/retro
@@ -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 0.121569 0.121569 -1.000000 -1.000000 0.247059 0.247059 -1.000000 -1.000000 0.372549 0.372549 -1.000000 -1.000000 0.498039 0.498039 -1.000000 -1.000000 0.623529 0.623529 -1.000000 -1.000000 0.749020 0.749020 -1.000000 -1.000000 0.874510 0.874510 -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.023530 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.050981 0.054902 0.058824 0.062745 0.066667 0.070589 0.074510 0.078432 0.082353 0.086275 0.090196 0.094118 0.098040 0.101961 0.105883 0.109804 0.113726 0.117647 0.121569 0.125491 0.129412 0.133334 0.137255 0.141177 0.145098 0.149020 0.152942 0.156863 0.160785 0.164706 0.168628 0.172549 0.176471 0.180392 0.184314 0.188236 0.192157 0.196079 0.200000 0.203922 0.207843 0.211765 0.215687 0.219608 0.223530 0.227451 0.231373 0.235294 0.239216 0.243137 0.247059 0.250981 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.313726 0.317647 0.321569 0.325490 0.329412 0.333333 0.337255 0.341177 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.403921 0.407843 0.411765 0.415686 0.419608 0.423529 0.427451 0.431372 0.435294 0.439216 0.443137 0.447059 0.450980 0.454902 0.458823 0.462745 0.466667 0.470588 0.474510 0.478431 0.482353 0.486274 0.490196 0.494117 0.498039 0.501961 0.505882 0.509804 0.513725 0.517647 0.521568 0.525490 0.529411 0.533333 0.537255 0.541176 0.545098 0.549019 0.552941 0.556862 0.560784 0.564705 0.568627 0.572549 0.576470 0.580392 0.584313 0.588235 0.592156 0.596078 0.600000 0.603921 0.607843 0.611764 0.615686 0.619607 0.623529 0.627451 0.631372 0.635294 0.639215 0.643137 0.647059 0.650980 0.654902 0.658823 0.662745 0.666666 0.670588 0.674510 0.678431 0.682353 0.686274 0.690196 0.694118 0.698039 0.701961 0.705883 0.709804 0.713726 0.717647 0.721569 0.725490 0.729412 0.733334 0.737255 0.741177 0.745098 0.749020 0.752942 0.756863 0.760785 0.764706 0.768628 0.772549 0.776471 0.780393 0.784314 0.788236 0.792157 0.796079 0.800000 0.803922 0.807844 0.811765 0.815687 0.819608 0.823530 0.827451 0.831373 0.835294 0.839216 0.843138 0.847059 0.850981 0.854902 0.858824 0.862745 0.866667 0.870588 0.874510 0.878432 0.882353 0.886275 0.890196 0.894118 0.898039 0.901961 0.905883 0.909804 0.913726 0.917647 0.921569 0.925490 0.929412 0.933333 0.937255 0.941177 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.011765 -1.000000 -1.000000 0.121569 0.050275 -1.000000 -1.000000 0.247059 0.163976 -1.000000 -1.000000 0.372549 0.316983 -1.000000 -1.000000 0.498039 0.493141 -1.000000 -1.000000 0.623529 0.671170 -1.000000 -1.000000 0.749020 0.829955 -1.000000 -1.000000 0.874510 0.941938 -1.000000 -1.000000 1.000000 0.988797)
(n-samples 256)
(samples 256 0.011765 0.012421 0.013081 0.013748 0.014426 0.015118 0.015829 0.016562 0.017321 0.018108 0.018929 0.019787 0.020685 0.021626 0.022616 0.023657 0.024752 0.025907 0.027123 0.028406 0.029758 0.031183 0.032686 0.034269 0.035936 0.037691 0.039538 0.041480 0.043522 0.045665 0.047915 0.050275 0.052742 0.055311 0.057976 0.060737 0.063588 0.066529 0.069554 0.072662 0.075849 0.079112 0.082449 0.085855 0.089329 0.092866 0.096464 0.100120 0.103831 0.107594 0.111405 0.115261 0.119160 0.123099 0.127073 0.131081 0.135120 0.139185 0.143275 0.147385 0.151514 0.155657 0.159812 0.163976 0.168170 0.172417 0.176715 0.181063 0.185459 0.189902 0.194390 0.198921 0.203496 0.208111 0.212765 0.217457 0.222186 0.226950 0.231747 0.236576 0.241436 0.246324 0.251240 0.256182 0.261149 0.266139 0.271151 0.276182 0.281233 0.286300 0.291383 0.296481 0.301591 0.306712 0.311843 0.316983 0.322148 0.327354 0.332599 0.337882 0.343201 0.348553 0.353937 0.359351 0.364792 0.370260 0.375751 0.381264 0.386798 0.392349 0.397916 0.403498 0.409092 0.414696 0.420309 0.425927 0.431551 0.437176 0.442803 0.448427 0.454049 0.459665 0.465274 0.470873 0.476462 0.482037 0.487598 0.493141 0.498686 0.504252 0.509836 0.515437 0.521052 0.526680 0.532320 0.537968 0.543623 0.549283 0.554946 0.560611 0.566274 0.571935 0.577592 0.583241 0.588883 0.594514 0.600132 0.605736 0.611324 0.616894 0.622444 0.627972 0.633476 0.638954 0.644404 0.649824 0.655213 0.660568 0.665888 0.671170 0.676436 0.681708 0.686983 0.692259 0.697533 0.702802 0.708064 0.713316 0.718557 0.723783 0.728991 0.734181 0.739348 0.744490 0.749605 0.754690 0.759744 0.764762 0.769743 0.774684 0.779583 0.784437 0.789244 0.794001 0.798705 0.803354 0.807946 0.812478 0.816947 0.821352 0.825688 0.829955 0.834172 0.838359 0.842515 0.846638 0.850726 0.854778 0.858793 0.862768 0.866702 0.870592 0.874438 0.878238 0.881990 0.885693 0.889344 0.892942 0.896485 0.899972 0.903402 0.906771 0.910079 0.913324 0.916504 0.919618 0.922664 0.925640 0.928545 0.931376 0.934133 0.936813 0.939416 0.941938 0.944373 0.946715 0.948968 0.951134 0.953217 0.955220 0.957145 0.958995 0.960774 0.962484 0.964129 0.965711 0.967233 0.968699 0.970111 0.971473 0.972787 0.974056 0.975283 0.976472 0.977624 0.978745 0.979835 0.980898 0.981938 0.982956 0.983957 0.984943 0.985917 0.986882 0.987841 0.988797))
(time 0)
(channel green)
(curve
(curve-type smooth)
(n-points 17)
(points 34 0.000000 0.044118 -1.000000 -1.000000 0.121569 0.081048 -1.000000 -1.000000 0.247059 0.181188 -1.000000 -1.000000 0.372549 0.327417 -1.000000 -1.000000 0.498039 0.493717 -1.000000 -1.000000 0.623529 0.658936 -1.000000 -1.000000 0.749020 0.811563 -1.000000 -1.000000 0.874510 0.915557 -1.000000 -1.000000 1.000000 0.956299)
(n-samples 256)
(samples 256 0.044118 0.044818 0.045520 0.046229 0.046947 0.047677 0.048423 0.049187 0.049973 0.050783 0.051621 0.052490 0.053392 0.054331 0.055311 0.056333 0.057401 0.058519 0.059688 0.060914 0.062197 0.063542 0.064951 0.066429 0.067976 0.069598 0.071296 0.073074 0.074936 0.076883 0.078919 0.081048 0.083261 0.085546 0.087903 0.090330 0.092826 0.095389 0.098018 0.100711 0.103468 0.106287 0.109166 0.112105 0.115101 0.118154 0.121261 0.124423 0.127636 0.130901 0.134215 0.137578 0.140987 0.144442 0.147940 0.151482 0.155065 0.158688 0.162349 0.166048 0.169782 0.173552 0.177354 0.181188 0.185072 0.189025 0.193043 0.197124 0.201266 0.205467 0.209724 0.214034 0.218396 0.222807 0.227264 0.231766 0.236310 0.240893 0.245513 0.250167 0.254855 0.259572 0.264316 0.269086 0.273878 0.278691 0.283522 0.288368 0.293228 0.298099 0.302978 0.307863 0.312752 0.317642 0.322531 0.327417 0.332320 0.337261 0.342239 0.347251 0.352296 0.357372 0.362475 0.367606 0.372762 0.377940 0.383139 0.388357 0.393592 0.398842 0.404106 0.409380 0.414664 0.419955 0.425252 0.430552 0.435853 0.441154 0.446453 0.451748 0.457036 0.462316 0.467586 0.472844 0.478088 0.483316 0.488526 0.493717 0.498902 0.504096 0.509298 0.514507 0.519722 0.524942 0.530166 0.535393 0.540621 0.545850 0.551079 0.556307 0.561532 0.566753 0.571970 0.577181 0.582386 0.587582 0.592770 0.597949 0.603116 0.608271 0.613414 0.618542 0.623655 0.628752 0.633832 0.638894 0.643936 0.648958 0.653958 0.658936 0.663913 0.668910 0.673923 0.678949 0.683985 0.689027 0.694073 0.699118 0.704160 0.709194 0.714219 0.719231 0.724225 0.729200 0.734151 0.739076 0.743971 0.748833 0.753658 0.758443 0.763186 0.767881 0.772528 0.777121 0.781658 0.786135 0.790550 0.794898 0.799177 0.803383 0.807513 0.811563 0.815556 0.819514 0.823437 0.827322 0.831168 0.834975 0.838741 0.842463 0.846142 0.849776 0.853363 0.856902 0.860392 0.863831 0.867219 0.870553 0.873832 0.877056 0.880222 0.883329 0.886377 0.889363 0.892286 0.895146 0.897940 0.900667 0.903327 0.905917 0.908436 0.910884 0.913258 0.915557 0.917773 0.919899 0.921938 0.923893 0.925767 0.927562 0.929283 0.930931 0.932510 0.934022 0.935470 0.936858 0.938187 0.939462 0.940685 0.941858 0.942985 0.944068 0.945111 0.946117 0.947087 0.948026 0.948936 0.949820 0.950680 0.951521 0.952344 0.953152 0.953949 0.954737 0.955519 0.956299))
(time 0)
(channel blue)
(curve
(curve-type smooth)
(n-points 17)
(points 34 0.000000 0.247630 -1.000000 -1.000000 0.121569 0.268491 -1.000000 -1.000000 0.247059 0.325230 -1.000000 -1.000000 0.372549 0.405204 -1.000000 -1.000000 0.498039 0.497829 -1.000000 -1.000000 0.623529 0.588839 -1.000000 -1.000000 0.749020 0.675181 -1.000000 -1.000000 0.874510 0.731610 -1.000000 -1.000000 1.000000 0.752075)
(n-samples 256)
(samples 256 0.247630 0.248024 0.248419 0.248818 0.249223 0.249634 0.250054 0.250484 0.250927 0.251384 0.251856 0.252346 0.252855 0.253385 0.253937 0.254514 0.255117 0.255748 0.256409 0.257101 0.257827 0.258587 0.259384 0.260219 0.261094 0.262011 0.262972 0.263978 0.265031 0.266133 0.267286 0.268491 0.269745 0.271043 0.272384 0.273767 0.275190 0.276653 0.278155 0.279695 0.281271 0.282883 0.284530 0.286209 0.287922 0.289666 0.291440 0.293243 0.295075 0.296933 0.298818 0.300729 0.302663 0.304620 0.306599 0.308600 0.310620 0.312659 0.314715 0.316789 0.318878 0.320982 0.323100 0.325230 0.327382 0.329567 0.331783 0.334028 0.336303 0.338606 0.340937 0.343293 0.345675 0.348081 0.350511 0.352963 0.355436 0.357929 0.360443 0.362974 0.365523 0.368089 0.370670 0.373266 0.375876 0.378498 0.381132 0.383776 0.386431 0.389094 0.391765 0.394443 0.397127 0.399816 0.402508 0.405204 0.407914 0.410649 0.413407 0.416188 0.418990 0.421811 0.424651 0.427509 0.430382 0.433269 0.436170 0.439083 0.442006 0.444939 0.447879 0.450827 0.453779 0.456736 0.459696 0.462657 0.465618 0.468578 0.471536 0.474490 0.477439 0.480381 0.483316 0.486242 0.489157 0.492061 0.494952 0.497829 0.500699 0.503570 0.506442 0.509314 0.512187 0.515060 0.517933 0.520804 0.523676 0.526546 0.529414 0.532281 0.535146 0.538009 0.540869 0.543727 0.546581 0.549432 0.552280 0.555123 0.557962 0.560797 0.563627 0.566453 0.569272 0.572087 0.574895 0.577697 0.580493 0.583282 0.586064 0.588839 0.591620 0.594418 0.597232 0.600060 0.602898 0.605744 0.608597 0.611454 0.614312 0.617170 0.620024 0.622874 0.625715 0.628547 0.631366 0.634171 0.636959 0.639728 0.642475 0.645199 0.647896 0.650565 0.653203 0.655808 0.658378 0.660910 0.663402 0.665852 0.668257 0.670615 0.672924 0.675181 0.677400 0.679595 0.681766 0.683912 0.686032 0.688126 0.690194 0.692234 0.694247 0.696232 0.698187 0.700113 0.702009 0.703875 0.705710 0.707513 0.709284 0.711022 0.712727 0.714398 0.716034 0.717636 0.719202 0.720733 0.722226 0.723683 0.725101 0.726482 0.727823 0.729126 0.730388 0.731610 0.732785 0.733910 0.734985 0.736012 0.736993 0.737930 0.738824 0.739676 0.740490 0.741265 0.742004 0.742709 0.743380 0.744021 0.744631 0.745214 0.745771 0.746302 0.746811 0.747298 0.747766 0.748215 0.748648 0.749066 0.749471 0.749864 0.750248 0.750623 0.750992 0.751356 0.751716 0.752075))
(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 c4a952b

Please sign in to comment.