Skip to content
This repository
Browse code

beautify: fix the Soft Light effect.

  • Loading branch information...
commit 81a3f01e5bc8c8f4371784bb492875ab6a304875 1 parent 2bbc14a
Jian He authored

Showing 2 changed files with 31 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 0  README
  2. +28 3 beautify-effect.c
3  README
@@ -47,6 +47,9 @@ GIMP Chat: http://www.gimpchat.com/viewtopic.php?f=9&t=4811
47 47 CHANGELOG
48 48 ===================
49 49
  50 +2012-08-03:
  51 +beautify: fix the soft light effect.
  52 +
50 53 2012-08-02:
51 54 beautify: add the relief effect.
52 55 beautify: add the soft effect.
31 beautify-effect.c
@@ -31,6 +31,7 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
31 31 gint32 layer = gimp_image_get_active_layer (image_ID);
32 32 gint32 effect_layer = gimp_layer_copy (layer);
33 33 gimp_image_add_layer (image_ID, effect_layer, -1);
  34 + //gimp_layer_set_lock_alpha (effect_layer, TRUE);
34 35
35 36 gint width = gimp_image_width (image_ID);
36 37 gint height = gimp_image_height (image_ID);
@@ -38,9 +39,8 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
38 39 switch (effect)
39 40 {
40 41 case BEAUTIFY_EFFECT_SOFT_LIGHT:
41   - //gimp_layer_set_mode (effect_layer, GIMP_SOFTLIGHT_MODE);
42 42 {
43   - guint8 red_pts[] = {
  43 + /*guint8 red_pts[] = {
44 44 0.000000 * 255, 0.018301 * 255,
45 45 0.121569 * 255, 0.140340 * 255,
46 46 0.247059 * 255, 0.293839 * 255,
@@ -75,7 +75,31 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
75 75 };
76 76 gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_RED, 18, red_pts);
77 77 gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_GREEN, 18, green_pts);
78   - gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);
  78 + gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);*/
  79 +
  80 + gint32 layer;
  81 +
  82 + layer = gimp_layer_copy (effect_layer);
  83 + gimp_image_add_layer (image_ID, layer, -1);
  84 + gimp_levels (layer, GIMP_HISTOGRAM_VALUE, 20, 255, 1, 0, 255);
  85 +
  86 + GimpParam *return_vals;
  87 + gint nreturn_vals;
  88 + return_vals = gimp_run_procedure ("plug-in-gauss",
  89 + &nreturn_vals,
  90 + GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE,
  91 + GIMP_PDB_IMAGE, image_ID,
  92 + GIMP_PDB_DRAWABLE, layer,
  93 + GIMP_PDB_FLOAT, 15.0,
  94 + GIMP_PDB_FLOAT, 15.0,
  95 + GIMP_PDB_INT32, 1,
  96 + GIMP_PDB_END);
  97 + gimp_destroy_params (return_vals, nreturn_vals);
  98 +
  99 + gimp_layer_set_mode (layer, GIMP_SCREEN_MODE);
  100 + gimp_layer_set_opacity (layer, 35);
  101 + gimp_image_merge_down (image_ID, layer, GIMP_CLIP_TO_IMAGE);
  102 +
79 103 break;
80 104 }
81 105 case BEAUTIFY_EFFECT_WARM:
@@ -1593,6 +1617,7 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
1593 1617 gint32 layer;
1594 1618
1595 1619 gimp_desaturate_full (effect_layer, GIMP_DESATURATE_LUMINOSITY);
  1620 +
1596 1621 layer = gimp_layer_copy (effect_layer);
1597 1622 gimp_image_add_layer (image_ID, layer, -1);
1598 1623 gimp_layer_set_mode (layer, GIMP_DODGE_MODE);

0 comments on commit 81a3f01

Please sign in to comment.
Something went wrong with that request. Please try again.