Skip to content

Commit

Permalink
beautify: add milk effect
Browse files Browse the repository at this point in the history
  • Loading branch information
hejiann committed Jul 24, 2012
1 parent 58e1f00 commit 98f312e
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions README
Expand Up @@ -35,6 +35,7 @@ CHANGELOG
2012-07-24
beautify: add deep blue effect
beautify: add bronze effect
beautify: add milk effect

2012-07-23
beautify: fix soft light effect
Expand Down
50 changes: 50 additions & 0 deletions beautify-effect.c
Expand Up @@ -672,6 +672,56 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 6, blue_pts);
}
break;
case BEAUTIFY_EFFECT_MILK:
{
gint32 layer;
GdkPixbuf *pixbuf;

pixbuf = gdk_pixbuf_new_from_inline (-1, texture_milk, FALSE, NULL);
layer = gimp_layer_new_from_pixbuf (image_ID, "texture", pixbuf, 20, GIMP_SCREEN_MODE, 0, 0);
gimp_image_add_layer (image_ID, layer, -1);
gimp_layer_scale (layer, width, height, FALSE);
gimp_image_merge_down (image_ID, layer, GIMP_CLIP_TO_BOTTOM_LAYER);

guint8 red_pts[] = {
0.000000 * 255, 0.309804 * 255,
0.121569 * 255, 0.392252 * 255,
0.247059 * 255, 0.496494 * 255,
0.372549 * 255, 0.597570 * 255,
0.498039 * 255, 0.684511 * 255,
0.623529 * 255, 0.768060 * 255,
0.749020 * 255, 0.843330 * 255,
0.874510 * 255, 0.917231 * 255,
1.000000 * 255, 0.992213 * 255,
};
guint8 green_pts[] = {
0.000000 * 255, 0.299346 * 255,
0.121569 * 255, 0.395641 * 255,
0.247059 * 255, 0.498204 * 255,
0.372549 * 255, 0.597187 * 255,
0.498039 * 255, 0.680991 * 255,
0.623529 * 255, 0.762936 * 255,
0.749020 * 255, 0.841731 * 255,
0.874510 * 255, 0.910444 * 255,
1.000000 * 255, 0.980896 * 255,
};
guint8 blue_pts[] = {
0.000000 * 255, 0.296899 * 255,
0.121569 * 255, 0.400465 * 255,
0.247059 * 255, 0.501991 * 255,
0.372549 * 255, 0.598690 * 255,
0.498039 * 255, 0.685437 * 255,
0.623529 * 255, 0.766052 * 255,
0.749020 * 255, 0.842140 * 255,
0.874510 * 255, 0.913442 * 255,
1.000000 * 255, 0.981385 * 255,
};
layer = gimp_image_get_active_layer (image_ID);
gimp_curves_spline (layer, GIMP_HISTOGRAM_RED, 18, red_pts);
gimp_curves_spline (layer, GIMP_HISTOGRAM_GREEN, 18, green_pts);
gimp_curves_spline (layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
break;
}
case BEAUTIFY_EFFECT_OLD_PHOTOS:
{
guint8 red_pts[] = {
Expand Down
1 change: 1 addition & 0 deletions beautify-effect.h
Expand Up @@ -42,6 +42,7 @@ typedef enum
BEAUTIFY_EFFECT_ICE_SPIRIT,
BEAUTIFY_EFFECT_JAPANESE,
BEAUTIFY_EFFECT_NEW_JAPANESE,
BEAUTIFY_EFFECT_MILK,
BEAUTIFY_EFFECT_OLD_PHOTOS,
BEAUTIFY_EFFECT_WARM_YELLOW,
BEAUTIFY_EFFECT_BLUES,
Expand Down
2 changes: 2 additions & 0 deletions beautify-textures.list
@@ -1,3 +1,5 @@
texture_milk
./textures/effects/milk.jpg
texture_old_photos
./textures/effects/old-photos.jpg
texture_bright_red
Expand Down
4 changes: 4 additions & 0 deletions beautify.c
Expand Up @@ -71,6 +71,7 @@ static const BeautifyEffectType studio_effects[] =
BEAUTIFY_EFFECT_ICE_SPIRIT,
BEAUTIFY_EFFECT_JAPANESE,
BEAUTIFY_EFFECT_NEW_JAPANESE,
BEAUTIFY_EFFECT_MILK,
BEAUTIFY_EFFECT_OLD_PHOTOS,
BEAUTIFY_EFFECT_WARM_YELLOW,
BEAUTIFY_EFFECT_BLUES,
Expand Down Expand Up @@ -888,6 +889,9 @@ effect_icon_new (BeautifyEffectType effect)
case BEAUTIFY_EFFECT_NEW_JAPANESE:
title = "New Japanese";
break;
case BEAUTIFY_EFFECT_MILK:
title = "Milk";
break;
case BEAUTIFY_EFFECT_OLD_PHOTOS:
title = "Old Photos";
break;
Expand Down
45 changes: 45 additions & 0 deletions curves/milk
@@ -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.309804 -1.000000 -1.000000 0.121569 0.392252 -1.000000 -1.000000 0.247059 0.496494 -1.000000 -1.000000 0.372549 0.597570 -1.000000 -1.000000 0.498039 0.684511 -1.000000 -1.000000 0.623529 0.768060 -1.000000 -1.000000 0.749020 0.843330 -1.000000 -1.000000 0.874510 0.917231 -1.000000 -1.000000 1.000000 0.992213)
(n-samples 256)
(samples 256 0.309804 0.312312 0.314821 0.317332 0.319845 0.322363 0.324885 0.327412 0.329947 0.332489 0.335040 0.337600 0.340170 0.342752 0.345346 0.347954 0.350575 0.353212 0.355865 0.358535 0.361223 0.363930 0.366657 0.369405 0.372175 0.374967 0.377783 0.380624 0.383490 0.386383 0.389303 0.392252 0.395235 0.398256 0.401312 0.404403 0.407525 0.410677 0.413857 0.417063 0.420292 0.423543 0.426814 0.430103 0.433407 0.436725 0.440055 0.443394 0.446741 0.450094 0.453450 0.456808 0.460165 0.463520 0.466871 0.470215 0.473550 0.476876 0.480188 0.483487 0.486768 0.490031 0.493274 0.496494 0.499706 0.502924 0.506148 0.509377 0.512609 0.515844 0.519080 0.522317 0.525553 0.528789 0.532021 0.535251 0.538475 0.541695 0.544908 0.548113 0.551310 0.554498 0.557675 0.560841 0.563994 0.567134 0.570259 0.573369 0.576462 0.579538 0.582596 0.585634 0.588651 0.591647 0.594620 0.597570 0.600496 0.603398 0.606278 0.609137 0.611976 0.614795 0.617595 0.620379 0.623145 0.625897 0.628634 0.631357 0.634068 0.636768 0.639457 0.642136 0.644807 0.647470 0.650127 0.652778 0.655424 0.658067 0.660707 0.663346 0.665983 0.668621 0.671261 0.673902 0.676547 0.679196 0.681851 0.684511 0.687176 0.689841 0.692507 0.695174 0.697839 0.700505 0.703169 0.705831 0.708491 0.711148 0.713803 0.716454 0.719101 0.721744 0.724382 0.727015 0.729642 0.732263 0.734877 0.737485 0.740084 0.742676 0.745260 0.747834 0.750400 0.752955 0.755501 0.758036 0.760560 0.763072 0.765572 0.768060 0.770534 0.772994 0.775441 0.777874 0.780296 0.782705 0.785104 0.787492 0.789870 0.792239 0.794600 0.796953 0.799298 0.801637 0.803970 0.806298 0.808621 0.810940 0.813255 0.815568 0.817878 0.820187 0.822495 0.824803 0.827111 0.829420 0.831730 0.834043 0.836359 0.838678 0.841002 0.843330 0.845659 0.847984 0.850307 0.852626 0.854942 0.857256 0.859567 0.861876 0.864183 0.866489 0.868793 0.871096 0.873397 0.875698 0.877999 0.880298 0.882598 0.884898 0.887198 0.889499 0.891801 0.894103 0.896407 0.898712 0.901019 0.903327 0.905638 0.907951 0.910267 0.912585 0.914906 0.917231 0.919558 0.921887 0.924217 0.926548 0.928881 0.931216 0.933551 0.935888 0.938226 0.940565 0.942905 0.945246 0.947589 0.949932 0.952276 0.954621 0.956966 0.959313 0.961660 0.964008 0.966356 0.968705 0.971054 0.973404 0.975754 0.978105 0.980456 0.982807 0.985158 0.987510 0.989861 0.992213))
(time 0)
(channel green)
(curve
(curve-type smooth)
(n-points 17)
(points 34 0.000000 0.299346 -1.000000 -1.000000 0.121569 0.395641 -1.000000 -1.000000 0.247059 0.498204 -1.000000 -1.000000 0.372549 0.597187 -1.000000 -1.000000 0.498039 0.680991 -1.000000 -1.000000 0.623529 0.762936 -1.000000 -1.000000 0.749020 0.841731 -1.000000 -1.000000 0.874510 0.910444 -1.000000 -1.000000 1.000000 0.980896)
(n-samples 256)
(samples 256 0.299346 0.302427 0.305509 0.308590 0.311672 0.314755 0.317839 0.320923 0.324009 0.327096 0.330184 0.333274 0.336365 0.339459 0.342554 0.345652 0.348752 0.351855 0.354960 0.358068 0.361179 0.364293 0.367410 0.370531 0.373656 0.376784 0.379916 0.383052 0.386193 0.389338 0.392487 0.395641 0.398802 0.401972 0.405151 0.408337 0.411530 0.414730 0.417936 0.421147 0.424363 0.427582 0.430806 0.434032 0.437260 0.440490 0.443721 0.446952 0.450183 0.453413 0.456642 0.459868 0.463092 0.466313 0.469530 0.472742 0.475949 0.479151 0.482346 0.485534 0.488714 0.491886 0.495050 0.498204 0.501357 0.504517 0.507682 0.510852 0.514026 0.517202 0.520379 0.523557 0.526735 0.529910 0.533083 0.536252 0.539416 0.542574 0.545725 0.548868 0.552002 0.555125 0.558238 0.561337 0.564424 0.567496 0.570553 0.573592 0.576615 0.579618 0.582602 0.585565 0.588506 0.591424 0.594318 0.597187 0.600029 0.602845 0.605635 0.608402 0.611145 0.613866 0.616567 0.619249 0.621912 0.624559 0.627190 0.629807 0.632410 0.635002 0.637583 0.640154 0.642717 0.645273 0.647822 0.650368 0.652910 0.655449 0.657988 0.660526 0.663067 0.665610 0.668156 0.670708 0.673266 0.675832 0.678407 0.680991 0.683581 0.686169 0.688757 0.691345 0.693931 0.696516 0.699099 0.701682 0.704263 0.706842 0.709419 0.711995 0.714569 0.717140 0.719710 0.722277 0.724841 0.727403 0.729962 0.732519 0.735073 0.737623 0.740171 0.742715 0.745256 0.747793 0.750326 0.752856 0.755382 0.757904 0.760422 0.762936 0.765449 0.767966 0.770484 0.773005 0.775527 0.778049 0.780571 0.783093 0.785613 0.788131 0.790646 0.793158 0.795666 0.798170 0.800668 0.803160 0.805647 0.808126 0.810597 0.813060 0.815514 0.817958 0.820392 0.822815 0.825227 0.827626 0.830012 0.832386 0.834745 0.837089 0.839418 0.841731 0.844025 0.846299 0.848554 0.850791 0.853010 0.855214 0.857403 0.859577 0.861740 0.863890 0.866030 0.868160 0.870282 0.872397 0.874506 0.876609 0.878708 0.880804 0.882899 0.884992 0.887086 0.889181 0.891279 0.893380 0.895485 0.897597 0.899715 0.901841 0.903975 0.906120 0.908276 0.910444 0.912620 0.914798 0.916978 0.919161 0.921346 0.923534 0.925723 0.927914 0.930108 0.932303 0.934499 0.936698 0.938898 0.941100 0.943303 0.945507 0.947713 0.949919 0.952127 0.954336 0.956546 0.958757 0.960969 0.963181 0.965394 0.967608 0.969822 0.972036 0.974251 0.976466 0.978681 0.980896))
(time 0)
(channel blue)
(curve
(curve-type smooth)
(n-points 17)
(points 34 0.000000 0.296899 -1.000000 -1.000000 0.121569 0.400465 -1.000000 -1.000000 0.247059 0.501991 -1.000000 -1.000000 0.372549 0.598690 -1.000000 -1.000000 0.498039 0.685437 -1.000000 -1.000000 0.623529 0.766052 -1.000000 -1.000000 0.749020 0.842140 -1.000000 -1.000000 0.874510 0.913442 -1.000000 -1.000000 1.000000 0.981385)
(n-samples 256)
(samples 256 0.296899 0.300282 0.303666 0.307048 0.310430 0.313811 0.317191 0.320569 0.323945 0.327318 0.330690 0.334059 0.337425 0.340787 0.344147 0.347502 0.350854 0.354201 0.357544 0.360882 0.364214 0.367542 0.370864 0.374180 0.377490 0.380793 0.384090 0.387380 0.390663 0.393938 0.397205 0.400465 0.403718 0.406965 0.410206 0.413442 0.416673 0.419898 0.423118 0.426332 0.429541 0.432745 0.435944 0.439137 0.442326 0.445509 0.448687 0.451861 0.455029 0.458193 0.461351 0.464505 0.467654 0.470798 0.473938 0.477073 0.480203 0.483329 0.486451 0.489567 0.492680 0.495788 0.498892 0.501991 0.505088 0.508185 0.511282 0.514377 0.517471 0.520563 0.523652 0.526738 0.529821 0.532900 0.535974 0.539044 0.542108 0.545167 0.548219 0.551264 0.554302 0.557333 0.560355 0.563369 0.566374 0.569369 0.572354 0.575328 0.578292 0.581244 0.584184 0.587112 0.590027 0.592928 0.595816 0.598690 0.601550 0.604396 0.607230 0.610052 0.612861 0.615659 0.618445 0.621220 0.623985 0.626739 0.629484 0.632219 0.634944 0.637661 0.640369 0.643069 0.645761 0.648445 0.651123 0.653793 0.656457 0.659116 0.661768 0.664415 0.667056 0.669694 0.672326 0.674955 0.677580 0.680202 0.682821 0.685437 0.688048 0.690652 0.693249 0.695838 0.698421 0.700996 0.703566 0.706128 0.708684 0.711234 0.713778 0.716316 0.718848 0.721374 0.723895 0.726411 0.728921 0.731426 0.733927 0.736422 0.738913 0.741400 0.743882 0.746360 0.748834 0.751304 0.753771 0.756234 0.758693 0.761149 0.763602 0.766052 0.768498 0.770941 0.773379 0.775812 0.778242 0.780667 0.783088 0.785504 0.787917 0.790324 0.792728 0.795127 0.797521 0.799911 0.802297 0.804678 0.807055 0.809426 0.811794 0.814156 0.816515 0.818868 0.821217 0.823561 0.825900 0.828234 0.830564 0.832889 0.835209 0.837524 0.839835 0.842140 0.844440 0.846734 0.849022 0.851305 0.853582 0.855853 0.858120 0.860381 0.862637 0.864888 0.867135 0.869376 0.871614 0.873847 0.876075 0.878300 0.880521 0.882738 0.884951 0.887160 0.889366 0.891569 0.893768 0.895965 0.898158 0.900349 0.902537 0.904723 0.906906 0.909087 0.911265 0.913442 0.915615 0.917784 0.919948 0.922107 0.924262 0.926413 0.928560 0.930703 0.932843 0.934979 0.937111 0.939240 0.941367 0.943490 0.945610 0.947728 0.949844 0.951957 0.954068 0.956177 0.958284 0.960390 0.962494 0.964596 0.966697 0.968798 0.970897 0.972995 0.975093 0.977191 0.979288 0.981385))
(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
Binary file added textures/effects/milk.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 98f312e

Please sign in to comment.