Permalink
Browse files

beautify: add night view effect.

  • Loading branch information...
1 parent f09cd5a commit edfdca4641d102cce8f9813252fd4715366dd2ff @hejiann committed Jul 29, 2012
Showing with 103 additions and 1 deletion.
  1. +1 −0 README
  2. +50 −0 beautify-effect.c
  3. +1 −1 beautify-effect.h
  4. +2 −0 beautify-textures.list
  5. +4 −0 beautify.c
  6. +45 −0 curves/night-view
  7. BIN textures/effects/night-view.jpg
View
1 README
@@ -45,6 +45,7 @@ skin-whitening: add reset feature.
skin-whitening: fix plug-in-skin-whitening procedure to let this filter can be used in scirpts.
Change all the beautify plug-ins under the "Filters" menu instead of "Tools" menu.
beautify: add classic studio effect.
+beautify: add night view effect.
2012-07-27
beautify: add sketch effect
View
@@ -1308,6 +1308,56 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
gimp_image_merge_down (image_ID, texture_layer, GIMP_CLIP_TO_BOTTOM_LAYER);
break;
}
+ case BEAUTIFY_EFFECT_NIGHT_VIEW:
+ {
+ guint8 red_pts[] = {
+ 0.000000 * 255, 0.003922 * 255,
+ 0.121569 * 255, 0.181978 * 255,
+ 0.247059 * 255, 0.348183 * 255,
+ 0.372549 * 255, 0.498116 * 255,
+ 0.498039 * 255, 0.630567 * 255,
+ 0.623529 * 255, 0.746150 * 255,
+ 0.749020 * 255, 0.848447 * 255,
+ 0.874510 * 255, 0.939235 * 255,
+ 1.000000 * 255, 1.000000 * 255,
+ };
+ guint8 green_pts[] = {
+ 0.000000 * 255, 0.002451 * 255,
+ 0.121569 * 255, 0.182281 * 255,
+ 0.247059 * 255, 0.347678 * 255,
+ 0.372549 * 255, 0.495968 * 255,
+ 0.498039 * 255, 0.629733 * 255,
+ 0.623529 * 255, 0.747508 * 255,
+ 0.749020 * 255, 0.852278 * 255,
+ 0.874510 * 255, 0.937573 * 255,
+ 1.000000 * 255, 1.000000 * 255,
+ };
+ guint8 blue_pts[] = {
+ 0.000000 * 255, 0.005240 * 255,
+ 0.121569 * 255, 0.182529 * 255,
+ 0.247059 * 255, 0.347919 * 255,
+ 0.372549 * 255, 0.496757 * 255,
+ 0.498039 * 255, 0.638620 * 255,
+ 0.623529 * 255, 0.753394 * 255,
+ 0.749020 * 255, 0.852676 * 255,
+ 0.874510 * 255, 0.948770 * 255,
+ 1.000000 * 255, 1.000000 * 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);
+
+ gint32 layer;
+ GdkPixbuf *pixbuf;
+
+ pixbuf = gdk_pixbuf_new_from_inline (-1, texture_night_view, FALSE, NULL);
+ layer = gimp_layer_new_from_pixbuf (image_ID, "texture", pixbuf, 100, 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);
+
+ break;
+ }
case BEAUTIFY_EFFECT_ASTRAL:
{
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_inline (-1, texture_astral, FALSE, NULL);
View
@@ -76,7 +76,7 @@ typedef enum
BEAUTIFY_EFFECT_BRIGHT_RED,
BEAUTIFY_EFFECT_CHRISTMAS_EVE,
BEAUTIFY_EFFECT_SNOW, // TODO
- BEAUTIFY_EFFECT_NIGHT_VIEW, // TODO
+ BEAUTIFY_EFFECT_NIGHT_VIEW,
BEAUTIFY_EFFECT_ASTRAL,
BEAUTIFY_EFFECT_COLORFUL_GLOW, // TODO
BEAUTIFY_EFFECT_BACKLIGHT, // TODO
View
@@ -10,6 +10,8 @@ texture_bright_red
./textures/effects/bright-red.jpg
texture_christmas_eve
./textures/effects/christmas-eve.jpg
+texture_night_view
+ ./textures/effects/night-view.jpg
texture_astral
./textures/effects/astral.jpg
texture_pick_light_1
View
@@ -93,6 +93,7 @@ static const BeautifyEffectType fashion_effects[] =
{
BEAUTIFY_EFFECT_BRIGHT_RED,
BEAUTIFY_EFFECT_CHRISTMAS_EVE,
+ BEAUTIFY_EFFECT_NIGHT_VIEW,
BEAUTIFY_EFFECT_ASTRAL,
BEAUTIFY_EFFECT_PICK_LIGHT,
};
@@ -1026,6 +1027,9 @@ effect_icon_new (BeautifyEffectType effect)
case BEAUTIFY_EFFECT_CHRISTMAS_EVE:
title = "Eve";
break;
+ case BEAUTIFY_EFFECT_NIGHT_VIEW:
+ title = "Night View";
+ break;
case BEAUTIFY_EFFECT_ASTRAL:
title = "Astral";
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 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.003922 -1.000000 -1.000000 0.121569 0.181978 -1.000000 -1.000000 0.247059 0.348183 -1.000000 -1.000000 0.372549 0.498116 -1.000000 -1.000000 0.498039 0.630567 -1.000000 -1.000000 0.623529 0.746150 -1.000000 -1.000000 0.749020 0.848447 -1.000000 -1.000000 0.874510 0.939235 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.003922 0.009805 0.015688 0.021568 0.027446 0.033321 0.039191 0.045056 0.050915 0.056767 0.062611 0.068446 0.074272 0.080087 0.085891 0.091682 0.097461 0.103226 0.108975 0.114710 0.120427 0.126127 0.131809 0.137472 0.143114 0.148736 0.154336 0.159913 0.165467 0.170996 0.176500 0.181978 0.187434 0.192871 0.198291 0.203693 0.209078 0.214445 0.219795 0.225128 0.230444 0.235742 0.241024 0.246288 0.251536 0.256767 0.261982 0.267180 0.272361 0.277527 0.282676 0.287809 0.292926 0.298027 0.303112 0.308182 0.313236 0.318274 0.323297 0.328304 0.333297 0.338274 0.343236 0.348183 0.353115 0.358033 0.362935 0.367823 0.372695 0.377552 0.382394 0.387220 0.392031 0.396826 0.401605 0.406368 0.411115 0.415846 0.420561 0.425259 0.429941 0.434606 0.439255 0.443887 0.448501 0.453099 0.457680 0.462243 0.466789 0.471318 0.475829 0.480322 0.484798 0.489255 0.493695 0.498116 0.502519 0.506905 0.511273 0.515624 0.519958 0.524273 0.528572 0.532853 0.537117 0.541364 0.545594 0.549807 0.554003 0.558181 0.562343 0.566488 0.570617 0.574728 0.578823 0.582902 0.586963 0.591009 0.595038 0.599050 0.603046 0.607026 0.610990 0.614937 0.618869 0.622784 0.626684 0.630567 0.634433 0.638279 0.642105 0.645913 0.649702 0.653473 0.657225 0.660960 0.664678 0.668378 0.672062 0.675730 0.679381 0.683017 0.686638 0.690243 0.693834 0.697410 0.700972 0.704521 0.708056 0.711578 0.715087 0.718584 0.722068 0.725541 0.729003 0.732453 0.735893 0.739322 0.742741 0.746150 0.749547 0.752930 0.756298 0.759652 0.762991 0.766317 0.769630 0.772928 0.776213 0.779485 0.782744 0.785990 0.789223 0.792444 0.795652 0.798848 0.802032 0.805204 0.808364 0.811512 0.814649 0.817775 0.820890 0.823993 0.827086 0.830168 0.833240 0.836301 0.839353 0.842394 0.845425 0.848447 0.851467 0.854492 0.857521 0.860551 0.863582 0.866611 0.869636 0.872657 0.875671 0.878676 0.881671 0.884655 0.887625 0.890580 0.893517 0.896437 0.899336 0.902213 0.905066 0.907894 0.910695 0.913467 0.916209 0.918919 0.921595 0.924235 0.926838 0.929402 0.931925 0.934406 0.936844 0.939235 0.941581 0.943885 0.946147 0.948370 0.950554 0.952701 0.954812 0.956889 0.958933 0.960945 0.962927 0.964881 0.966806 0.968706 0.970581 0.972432 0.974262 0.976071 0.977860 0.979632 0.981387 0.983127 0.984854 0.986568 0.988271 0.989964 0.991650 0.993328 0.995001 0.996669 0.998335 1.000000))
+(time 0)
+(channel green)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.002451 -1.000000 -1.000000 0.121569 0.182281 -1.000000 -1.000000 0.247059 0.347678 -1.000000 -1.000000 0.372549 0.495968 -1.000000 -1.000000 0.498039 0.629733 -1.000000 -1.000000 0.623529 0.747508 -1.000000 -1.000000 0.749020 0.852278 -1.000000 -1.000000 0.874510 0.937573 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.002451 0.008412 0.014373 0.020331 0.026287 0.032238 0.038184 0.044125 0.050058 0.055983 0.061899 0.067806 0.073701 0.079584 0.085454 0.091310 0.097151 0.102976 0.108784 0.114574 0.120345 0.126096 0.131826 0.137534 0.143218 0.148879 0.154514 0.160124 0.165706 0.171261 0.176786 0.182281 0.187750 0.193197 0.198622 0.204025 0.209408 0.214770 0.220111 0.225431 0.230732 0.236012 0.241273 0.246515 0.251738 0.256941 0.262126 0.267293 0.272442 0.277573 0.282686 0.287782 0.292861 0.297923 0.302969 0.307998 0.313012 0.318009 0.322991 0.327958 0.332910 0.337847 0.342770 0.347678 0.352570 0.357443 0.362297 0.367132 0.371949 0.376749 0.381530 0.386294 0.391040 0.395770 0.400482 0.405178 0.409858 0.414521 0.419168 0.423800 0.428416 0.433017 0.437603 0.442175 0.446732 0.451274 0.455803 0.460318 0.464819 0.469307 0.473782 0.478244 0.482693 0.487130 0.491555 0.495968 0.500369 0.504757 0.509131 0.513493 0.517841 0.522176 0.526498 0.530805 0.535099 0.539379 0.543645 0.547896 0.552134 0.556356 0.560564 0.564758 0.568936 0.573099 0.577248 0.581381 0.585498 0.589600 0.593686 0.597756 0.601811 0.605849 0.609871 0.613877 0.617866 0.621838 0.625794 0.629733 0.633654 0.637557 0.641442 0.645309 0.649159 0.652991 0.656807 0.660606 0.664389 0.668155 0.671906 0.675641 0.679361 0.683066 0.686757 0.690433 0.694094 0.697742 0.701377 0.704998 0.708605 0.712201 0.715783 0.719353 0.722912 0.726458 0.729994 0.733518 0.737031 0.740534 0.744026 0.747508 0.750982 0.754449 0.757908 0.761360 0.764802 0.768235 0.771659 0.775071 0.778473 0.781863 0.785240 0.788605 0.791956 0.795293 0.798616 0.801923 0.805214 0.808489 0.811747 0.814987 0.818209 0.821412 0.824596 0.827760 0.830903 0.834025 0.837125 0.840203 0.843257 0.846289 0.849296 0.852278 0.855240 0.858186 0.861115 0.864028 0.866924 0.869803 0.872664 0.875507 0.878332 0.881139 0.883926 0.886695 0.889444 0.892174 0.894883 0.897572 0.900240 0.902888 0.905514 0.908118 0.910701 0.913261 0.915799 0.918314 0.920805 0.923274 0.925718 0.928139 0.930535 0.932906 0.935252 0.937573 0.939865 0.942124 0.944351 0.946549 0.948717 0.950857 0.952969 0.955056 0.957117 0.959154 0.961168 0.963160 0.965132 0.967083 0.969016 0.970930 0.972828 0.974711 0.976578 0.978432 0.980274 0.982104 0.983923 0.985733 0.987535 0.989329 0.991117 0.992900 0.994679 0.996454 0.998228 1.000000))
+(time 0)
+(channel blue)
+(curve
+ (curve-type smooth)
+ (n-points 17)
+ (points 34 0.000000 0.005240 -1.000000 -1.000000 0.121569 0.182529 -1.000000 -1.000000 0.247059 0.347919 -1.000000 -1.000000 0.372549 0.496757 -1.000000 -1.000000 0.498039 0.638620 -1.000000 -1.000000 0.623529 0.753394 -1.000000 -1.000000 0.749020 0.852676 -1.000000 -1.000000 0.874510 0.948770 -1.000000 -1.000000 1.000000 1.000000)
+ (n-samples 256)
+ (samples 256 0.005240 0.011099 0.016956 0.022813 0.028666 0.034516 0.040362 0.046202 0.052036 0.057863 0.063683 0.069493 0.075294 0.081085 0.086864 0.092631 0.098385 0.104125 0.109850 0.115560 0.121253 0.126928 0.132585 0.138223 0.143840 0.149437 0.155012 0.160564 0.166093 0.171597 0.177076 0.182529 0.187960 0.193372 0.198768 0.204146 0.209506 0.214849 0.220175 0.225484 0.230775 0.236049 0.241307 0.246548 0.251771 0.256978 0.262168 0.267342 0.272499 0.277640 0.282764 0.287872 0.292964 0.298039 0.303098 0.308142 0.313169 0.318180 0.323176 0.328156 0.333120 0.338068 0.343001 0.347919 0.352816 0.357689 0.362538 0.367363 0.372167 0.376950 0.381713 0.386456 0.391180 0.395887 0.400578 0.405252 0.409911 0.414557 0.419189 0.423808 0.428417 0.433014 0.437602 0.442181 0.446752 0.451316 0.455874 0.460426 0.464974 0.469518 0.474059 0.478599 0.483138 0.487677 0.492216 0.496757 0.501305 0.505865 0.510433 0.515009 0.519590 0.524175 0.528762 0.533348 0.537933 0.542514 0.547089 0.551657 0.556216 0.560763 0.565298 0.569817 0.574321 0.578805 0.583270 0.587712 0.592130 0.596523 0.600887 0.605222 0.609526 0.613797 0.618032 0.622231 0.626391 0.630510 0.634587 0.638620 0.642611 0.646566 0.650485 0.654369 0.658220 0.662038 0.665825 0.669581 0.673309 0.677008 0.680679 0.684325 0.687946 0.691543 0.695116 0.698668 0.702199 0.705711 0.709204 0.712679 0.716137 0.719581 0.723009 0.726425 0.729828 0.733220 0.736601 0.739974 0.743338 0.746696 0.750047 0.753394 0.756725 0.760030 0.763311 0.766567 0.769801 0.773014 0.776206 0.779378 0.782533 0.785671 0.788793 0.791900 0.794993 0.798074 0.801143 0.804203 0.807253 0.810295 0.813330 0.816360 0.819384 0.822406 0.825425 0.828443 0.831460 0.834479 0.837500 0.840524 0.843553 0.846587 0.849628 0.852676 0.855747 0.858852 0.861986 0.865147 0.868330 0.871532 0.874748 0.877975 0.881209 0.884447 0.887684 0.890916 0.894141 0.897353 0.900549 0.903726 0.906880 0.910006 0.913101 0.916161 0.919182 0.922161 0.925093 0.927976 0.930804 0.933575 0.936283 0.938927 0.941501 0.944002 0.946426 0.948770 0.951039 0.953245 0.955389 0.957474 0.959501 0.961473 0.963391 0.965258 0.967075 0.968846 0.970571 0.972253 0.973894 0.975496 0.977061 0.978591 0.980088 0.981555 0.982992 0.984403 0.985790 0.987153 0.988497 0.989821 0.991130 0.992423 0.993705 0.994976 0.996239 0.997496 0.998749 1.000000))
+(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
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 edfdca4

Please sign in to comment.