Commit 1927c3d4 authored by Niklas Mattisson's avatar Niklas Mattisson

Removed the borders around the images. This makes a lot of images look better then with the border.

Changed (Image|Colors|Desaturate) to "<Image> Image -> Colors -> Desaturate".
Bug fix in "What is it?" about image placement in the tutorial. Intention: Linked "Drawing Shapes with Bezier" to the tutorial on the site.
Fixed a typo.
Did some changes in the paragraphs to make them more clear and look more like the original tutorial.
Changed the words "below" to "above". Add some paragraphs to make the tutorial more readable.
Fixed the missing links in the tutorial. Missing tags from the original tutorial fixed.
Fixed some tags to go with the original tutorial. Fixed a few links that was not added.
Fixed a few missing tags that is being used in the original tutorial. Fixed a small typo.
Bug fix that said image to the left instead of image above. Add Keep Trans to the drop shadow step.
Add some files to the repository.
Removed some other files that is being replaced.
parent 4d5d3680
2003-06-19 scizzo <scizzo@gimp.org>
* index.html, bugs.html, registry.html, template.html: Removed files.
* index.htrw, bugs.htrw, registry.htrw, template.htrw: Added files.
* /style/default.css: Removed the borders around the images. This
makes a lot of images look better then with the border.
* /tutorials/The_Basics: Bug fix that said image to the left instead
of image above. Add Keep Trans to the drop shadow step.
* /tutorials/Borders_On_Selections/: Fixed a typo.
* /tutorials/Anti-Aliased_Threshold: Changed (Image|Colors|Desaturate)
to "<Image> Image -> Colors -> Desaturate".
* /tutorials/Bezier_Selections/: Bug fix in "What is it?" about image
placement in the tutorial. Intention: Linked "Drawing Shapes with
Bezier" to the tutorial on the site.
* /tutorials/Custom_Brushes/: Note: needs a class.
* /tutorials/Drawing_Shapes/: Fixed the missing links in the tutorial.
Missing tags from the original tutorial fixed.
* /tutorials/Film_Grain/film-grain-vertical.pat: Add this file it was
missing in the tutorial.
* /tutorials/Film_Grain/gimp-grey-modes.diff: This was also missing.
Fixed the links to the files.
* /tutorials/Film_Grain/index.htrw: Fixed some tags to go with the
original tutorial. Fixed a few links that was not added.
* /tutorials/Changing_Background_Color_1/: Did some changes in the
paragraphs to make them more clear and look more like the original tutorial.
* /tutorials/Changing_Background_Color_2/: Changed the words "below"
to "above". Add some paragraphs to make the tutorial more readable.
* /tutorials/Simple_Animations/: Fixed a few missing tags that is
being used in the original tutorial. Fixed a small typo.
2003-06-18 Helvetix Victorinox <helvetix@mysterious.org>
* Some code cleanup and tightening.
......
......@@ -121,7 +121,7 @@ p.news {
}
p.images img {
border: solid black 2px;
border: none;
}
p.images {
......
......@@ -20,8 +20,11 @@
<img src="threshold.jpg" alt="" />
</p>
<p>
On the left you we see the original image that is about to be thresholded, and on the right side we see the result. The default settings
for the Threshold plug-in were used (<span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Threshold</span>). The resulting image is very blocky and aliased.
On the left you we see the original image that is about to be thresholded,
and on the right side we see the result. The default settings
for the Threshold plug-in were used
(<span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Threshold</span>).
The resulting image is very blocky and aliased.
</p>
<h2>The Curves Trick</h2>
......@@ -30,12 +33,16 @@
<img src="finished.jpg" alt="" />
</p>
<p>
First duplicate the image layer by going to the layers dialog, making sure the image layer is selected, and clicking the duplicate button
(fourth from the left). We can use the original layer for some color tricks later. Now the next thing is to desaturate the image
(Image|Colors|Desaturate). This way the colors wont interfere with the fake thresholding. When the layer is grayscale, select the curves
First duplicate the image layer by going to the layers dialog,
making sure the image layer is selected, and clicking the duplicate button
(fourth from the left). We can use the original layer for some color tricks later.
Now the next thing is to desaturate the image
(<span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Desaturate</span>).
This way the colors wont interfere with the fake thresholding. When the layer is grayscale, select the curves
plug-in (<span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Curves</span>). Now we can play with the value "channel".
The image on the left displays the settings used for the example image. The space between the two dots determines how much aa the
resulting image will have. The wider the gap, the more grayscale values it will have, and vice versa. The resulting image can be seen on
resulting image will have. The wider the gap,
the more grayscale values it will have, and vice versa. The resulting image can be seen on
the right.
</p>
......
......@@ -9,10 +9,13 @@
<h2>Intention</h2>
<p>
Bezier selection is a powerful tool in The Gimp. The rectangle- and ellipse-selections are not very flexible if you happen to need something more special.
And since many of us gimpers don't have a graphics tablet, it's not so easy to make the mouse pointer move the way you want. Bezier selection fixes the
problem by using smooth mathematical curves instead your own shaky mouse trail. Beziers are also very useful when used with gradient fills, see
"Drawing Shapes with Bezier" for more information on this great tool.
Bezier selection is a powerful tool in The Gimp.
The rectangle- and ellipse-selections are not very flexible if you happen to need something more special.
And since many of us gimpers don't have a graphics tablet,
it's not so easy to make the mouse pointer move the way you want. Bezier selection fixes the
problem by using smooth mathematical curves instead your own shaky mouse trail.
Beziers are also very useful when used with gradient fills, see
<a href="/tutorials/Drawing_Shapes/">Drawing Shapes with Bezier</a> for more information on this great tool.
</p>
<h2>What is it?</h2>
......@@ -20,11 +23,13 @@
<img src="bezier_box.gif" alt="" />
</p>
<p>
<img src="bezier_button.gif" alt="" />Bezier selection is a tool to make complex
<img src="bezier_button.gif" alt="" /> Bezier selection is a tool to make complex
selections by specifying certain points that are connected together with a curve.
So to make a box you would specify four points, one for each corner of the box. Example is on the right side.
The great thing is the corners don't have to be 90 degrees. After selecting the fourth point, click on the first point to close the curve
(beziers have to be closed - at least at the moment in the current Gimp). Finally click inside our 'box' to turn it into a selection.
So to make a box you would specify four points, one for each corner of the box. Example in image above.
The great thing is the corners don't have to be 90 degrees.
After selecting the fourth point, click on the first point to close the curve
(beziers have to be closed - at least at the moment in the current Gimp).
Finally click inside our 'box' to turn it into a selection.
Of course you can have as many points as you need.
</p>
......@@ -33,13 +38,19 @@
<img src="bezier_curve.gif" alt="" />
</p>
<p>
Straight lines alone are a useful thing, but it's not all. Actually they are not lines but curves. Cool anti-aliased smooth curves.
Straight lines alone are a useful thing, but it's not all.
Actually they are not lines but curves. Cool anti-aliased smooth curves.
<br />
The curves can be modified quite flexibly by adjusting the 'handles' of the nearest points. 'What handles?' you say... See the image above? The small
circles are those familiar points we used with the box in the previous section. The little boxes are those handles. The handles are not visible by default,
you must drag them 'out' from a point. To make the handles visible 1. click to a point to make it active, 2. click again on the same point and
3. drag the handles out with the mousebutton still pressed down. You notice the curves between the points are not straight anymore. You can control the shapes
by dragging the handles around.
The curves can be modified quite flexibly by adjusting the 'handles' of
the nearest points. 'What handles?' you say... See the image above? The small
circles are those familiar points we used with the box in the previous section.
The little boxes are those handles. The handles are not visible by default,
you must drag them 'out' from a point. To make the handles visible
1. click to a point to make it active,
2. click again on the same point and
3. drag the handles out with the mousebutton still pressed down.
You notice the curves between the points are not straight anymore. You can control the shapes
by dragging the handles around.
</p>
<h2>A Few Tips</h2>
......
......@@ -13,9 +13,12 @@
<img src="img14_step1.png" alt="" />
</p>
<p>
Since Gimp is an image manipulation program and not a painting program it doesn't include tools to draw shapes like squares and circles.
However this doesn't mean you can paint them, in fact there are some interesting options regarding this subject when it comes to the gimp.
The solution is to use the selection stroking capabilities of the Gimp. This option can be accesed on the image menu (right button click
Since Gimp is an image manipulation program and not a painting program
it doesn't include tools to draw shapes like squares and circles.
However this doesn't mean you can't paint them, in fact there are
some interesting options regarding this subject when it comes to the gimp.
The solution is to use the selection stroking capabilities of the Gimp.
This option can be accesed on the image menu (right button click
on the image), by going to <span class="filter">&lt;Image&gt; Edit -&gt; Stroke</span>.
</p>
......
......@@ -14,9 +14,12 @@
<img src="pr_red.png" alt="" />
</p>
<p>
This tutorial shows you how you can effeciently replace the background of an image with another in GIMP, through the use of the color to alpha plug-in.
The aim is to show the advantages of using the color to alpha plug-in over selection-based techniques. To illustrate this, this tutorial will use the above
images as source and destination. This tutorial doesn't address the complexities of handling real-world photos in this manner, but does briefly discuss it at the end.
This tutorial shows you how you can effeciently replace the background of an image with another in GIMP,
through the use of the color to alpha plug-in.
The aim is to show the advantages of using the color to alpha plug-in over selection-based techniques.
To illustrate this, this tutorial will use the above
images as source and destination. This tutorial doesn't address the complexities of
handling real-world photos in this manner, but does briefly discuss it at the end.
</p>
<h2>Why Not a Selection</h2>
......@@ -36,14 +39,25 @@
<img src="pr3.png" alt="" />
</p>
<p>
The common approach to doing many things in GIMP is to first get a good selection. However, when removing an anti-aliased object from its background
is not a good idea, as shown above. You'll note that each of the three zoomed in selections above have varying amounts of the green-blue mix selected.
When these are filled, we are left with flat black and slightly blueish-green pixels between them, or no transition to black at all.
Compare each with the target image below. The left one has a blue border around it. This looks somewhat neat, but not what we're going for. The middle
one is close, but there are some ugly visble pixels still. You can try getting rid of all the ugly pixels,
The common approach to doing many things in GIMP is to first get a good selection.
However, when removing an anti-aliased object from its background is not a good idea, as shown above.
</p>
<p>
You'll note that each of the three zoomed in selections above have varying amounts of the green-blue mix selected.
When these are filled, we are left with flat black and slightly blueish-green pixels between them,
or no transition to black at all.
</p>
<p>
Compare each with the target image below. The left one has a blue border around it.
This looks somewhat neat, but not what we're going for. The middle one is close,
but there are some ugly visble pixels still. You can try getting rid of all the ugly pixels,
but then you'll end up with something jagged like on the right.
You can spend hours trying to find something that will work perfectly, but you won't. Anything short of the rightmost image has some blue in the pixel,
which will stick out. You can go too far, and blend it back to something close, but this is time consuming. Instead, may I suggest the rest of the tutorial?
</p>
<p>
You can spend hours trying to find something that will work perfectly, but you won't.
Anything short of the rightmost image has some blue in the pixel,
which will stick out. You can go too far, and blend it back to something close,
but this is time consuming. Instead, may I suggest the rest of the tutorial?
</p>
<h2>Step 1</h2>
......
......@@ -13,7 +13,7 @@
<img src="img1_initial.jpg" alt="" />
</p>
<p>
Many times you have an image with a colored background, like the one below and you want to take
Many times you have an image with a colored background, like the one above and you want to take
out the background to use the image's subject in a composition.
With gimp there are many ways to achieve this, one of which is
using a plug-in specifically designed for this: <a href="/tutorials/Changing_Background_Color_1/">Changing Background Color 1</a>.
......@@ -37,11 +37,15 @@
<p>
After choosing that option a dialog window will appear. This window shows several options.
The black square on the left side shows the current selection.
Anything that appears white is selected, anything that is black is not.
Anything that appears white is selected, anything that is black is not.
</p>
<p>
When you strart using the dialog you will see what this means. On the right side
there are two options we will consider for the moment. The first one is the Selection Mode.
We will use the add option, which means any color we click on
will be added to the selection. The other setting is the Fuzziness Threshold.
will be added to the selection. The other setting is the Fuzziness Threshold.
</p>
<p>
When you click on a color, the higher this setting is, the more similar colors
to the one you clicked on will be selected. You can start by using the default
setting and increasing it if you need to add more colors faster, or decrease
......
......@@ -30,13 +30,15 @@
This is not a 'back to basics' -tutorial. You should be familiar with Gimp's dialogs and menus.
I was thinking about this, and I did not want to make this an 'entry level' thing,
basically to avoid bloating this too big and duplicating other people's work.
Beziers are covered in my other tutorial, and I recommend you to read it before going further if you find the material here confusing.
If you are new to Gimp I suggest you to go to the Gimp homepage in www.gimp.org and first read through the Documentation section there.
<a href="/tutorials/Bezier_Selections/">Beziers are covered in my other tutorial</a>,
and I recommend you to read it before going further if you find the material here confusing.
If you are new to Gimp I suggest you to go to the Gimp homepage in <a href="home:gimp">www.gimp.org</a> and
first read through the Documentation section there.
</p>
<h2>Let's get started!</h2>
<p>
First we must create a new image for our creation. Make the size 256x256 pixels and choose RGB for the type.
First we must <b>create a new image</b> for our creation. Make the <b>size 256x256</b> pixels and choose <b>RGB</b> for the type.
The image background should be white.
Open the Layers &amp; Channels -dialog with the right-button-menu:
<span class="filter">&lt;Image&gt; Dialogs -&gt; Layers, Channels &amp; Paths...</span>
......@@ -47,8 +49,9 @@
<img src="box_numb.gif" alt=""/>
</p>
<p>
Now create a new transparent layer, and name it Left_side so you know what layer I'll talk about later on.
Make sure you have the new layer active by checking the layers-dialog. If it is not selected, click the layer's name in the dialog.
Now create a new transparent layer, and name it <i>Left_side</i> so you know what layer I'll talk about later on.
Make sure you have the new layer active by checking the layers-dialog.
If it is not selected, click the layer's name in the dialog.
</p>
<p>
Imagine the blue cube on the right side into your canvas, we'll be doing side #1 now.
......@@ -61,7 +64,8 @@
think about the perspective. (If this causes you trouble, don't worry. You will learn by experience).
</p>
<p>
You can adjust the points' places if you can't get them right at the first try, see the Bezier tutorial for more information on that.
You can adjust the points' places if you can't get them right at the first try,
see the <a href="/tutorials/Bezier_Selections/">Bezier tutorial</a> for more information on that.
Your bezier should look something like the one on the right.
</p>
<p>
......@@ -71,7 +75,8 @@
<img src="gradient1.gif" alt=""/>
</p>
<p>
Next we must choose some nice colors for our gradient, choose white for the foreground color and some dark-blue for the background
Next we must choose some nice colors for our gradient,
choose white for the foreground color and some dark-blue for the background
(we are making a blue box, remember?) Something like that on the image nearby.
</p>
<p class="images">
......@@ -89,7 +94,7 @@
<img src="gradient2.gif" alt=""/>
</p>
<p>
Now on to the right side, side #2. Create a new transparent layer and name it Right_side.
Now on to the right side, side #2. Create a new transparent layer and name it <i>Right_side</i>.
Use the Bezier Tool and try to make the right side of the cube and turn it into a selection.
</p>
<p>
......@@ -106,13 +111,15 @@
<img src="gradient3.gif" alt=""/>
</p>
<p>
Our final ultimate task is to create the top, side #3. Again, create a new transparent layer and name it (who quessed? :) Top_side.
Our final ultimate task is to create the top, side #3.
Again, create a new transparent layer and name it (who quessed? :) <i>Top_side</i>.
</p>
<p>
Now you probably know we want to make yet one bezier selection and this time the gradient has to be even lighter than in the first side.
So I suggest you lighten the dark blue color a fair amount, it's easier to get a light gradient that way.
This time you pull the gradient from left to right, according the arrow in the picture. Once you find the shading look good,
you can flatten the image and our little tutorial-cube is finished. Now apply for your 'Cube Gimp Licence' from the nearest Gimp Station ;)
you can flatten the image and our little tutorial-cube is finished.
Now apply for your 'Cube Gimp Licence' from the nearest Gimp Station ;)
</p>
<h2>4. Finished Work</h2>
......
diff -ur gimp-1.2.2-old/app/apptypes.h gimp-1.2.2/app/apptypes.h
--- gimp-1.2.2-old/app/apptypes.h Sat Dec 16 15:33:41 2000
+++ gimp-1.2.2/app/apptypes.h Wed Sep 26 19:18:40 2001
@@ -78,8 +78,15 @@
DIVIDE_MODE,
ERASE_MODE, /*< skip >*/
REPLACE_MODE, /*< skip >*/
- ANTI_ERASE_MODE /*< skip >*/
+ ANTI_ERASE_MODE, /*< skip >*/
+ GREY_ADDITION_MODE,
+ GREY_SUBTRACTION_MODE
} LayerModeEffects;
+
+/* Is this a regular brush mode? */
+#define GIMP_IS_BRUSH_MODE(mode) \
+ ((NORMAL_MODE <= mode && mode <= DIVIDE_MODE) \
+ || (GREY_ADDITION_MODE <= mode && mode <= GREY_SUBTRACTION_MODE))
/* Types of convolutions */
typedef enum
diff -ur gimp-1.2.2-old/app/brush_select_cmds.c gimp-1.2.2/app/brush_select_cmds.c
--- gimp-1.2.2-old/app/brush_select_cmds.c Thu Feb 17 06:44:26 2000
+++ gimp-1.2.2/app/brush_select_cmds.c Wed Sep 26 20:48:56 2001
@@ -83,7 +83,7 @@
spacing = args[4].value.pdb_int;
paint_mode = args[5].value.pdb_int;
- if (paint_mode < NORMAL_MODE || paint_mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(paint_mode))
success = FALSE;
if (success)
@@ -136,7 +136,7 @@
{
PDB_INT32,
"paint_mode",
- "The initial paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The initial paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
}
};
@@ -240,7 +240,7 @@
spacing = args[3].value.pdb_int;
paint_mode = args[4].value.pdb_int;
- if (paint_mode < NORMAL_MODE || paint_mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(paint_mode))
success = FALSE;
if (success)
@@ -295,7 +295,7 @@
{
PDB_INT32,
"paint_mode",
- "The initial paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The initial paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
}
};
diff -ur gimp-1.2.2-old/app/brushes_cmds.c gimp-1.2.2/app/brushes_cmds.c
--- gimp-1.2.2-old/app/brushes_cmds.c Sun Dec 17 14:25:56 2000
+++ gimp-1.2.2/app/brushes_cmds.c Wed Sep 26 20:48:56 2001
@@ -369,7 +369,7 @@
{
PDB_INT32,
"paint_mode",
- "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
}
};
@@ -396,7 +396,7 @@
gint32 paint_mode;
paint_mode = args[0].value.pdb_int;
- if (paint_mode < NORMAL_MODE || paint_mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(paint_mode))
success = FALSE;
if (success)
@@ -410,7 +410,7 @@
{
PDB_INT32,
"paint_mode",
- "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
}
};
@@ -580,7 +580,7 @@
{
PDB_INT32,
"paint_mode",
- "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The paint mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
},
{
PDB_INT32,
diff -ur gimp-1.2.2-old/app/layer_cmds.c gimp-1.2.2/app/layer_cmds.c
--- gimp-1.2.2-old/app/layer_cmds.c Thu Dec 28 12:37:23 2000
+++ gimp-1.2.2/app/layer_cmds.c Wed Sep 26 20:48:56 2001
@@ -134,7 +134,7 @@
success = FALSE;
mode = args[6].value.pdb_int;
- if (mode < NORMAL_MODE || mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(mode))
success = FALSE;
if (success)
@@ -187,7 +187,7 @@
{
PDB_INT32,
"mode",
- "The layer combination mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The layer combination mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
}
};
@@ -1683,7 +1683,7 @@
success = FALSE;
mode = args[1].value.pdb_int;
- if (mode < NORMAL_MODE || mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(mode))
success = FALSE;
if (success)
diff -ur gimp-1.2.2-old/app/layers_dialog.c gimp-1.2.2/app/layers_dialog.c
--- gimp-1.2.2-old/app/layers_dialog.c Thu Jun 21 04:27:22 2001
+++ gimp-1.2.2/app/layers_dialog.c Wed Sep 26 15:20:37 2001
@@ -384,6 +384,8 @@
_("Difference"), (gpointer) DIFFERENCE_MODE, NULL,
_("Addition"), (gpointer) ADDITION_MODE, NULL,
_("Subtract"), (gpointer) SUBTRACT_MODE, NULL,
+ _("Grey Addition"), (gpointer) GREY_ADDITION_MODE,NULL,
+ _("Grey Subtraction"),(gpointer) GREY_SUBTRACTION_MODE, NULL,
_("Darken Only"), (gpointer) DARKEN_ONLY_MODE, NULL,
_("Lighten Only"), (gpointer) LIGHTEN_ONLY_MODE, NULL,
_("Hue"), (gpointer) HUE_MODE, NULL,
diff -ur gimp-1.2.2-old/app/paint_funcs.c gimp-1.2.2/app/paint_funcs.c
--- gimp-1.2.2-old/app/paint_funcs.c Tue Jun 26 04:59:24 2001
+++ gimp-1.2.2/app/paint_funcs.c Wed Sep 26 16:35:07 2001
@@ -103,7 +103,9 @@
{ 0, 0, 0, N_("Divide (Dodge)") },
{ 1, 0, 1, N_("Erase") },
{ 1, 1, 1, N_("Replace") },
- { 1, 0, 1, N_("Anti Erase") }
+ { 1, 0, 1, N_("Anti Erase") },
+ { 0, 0, 0, N_("Grey Addition") },
+ { 0, 0, 0, N_("Grey Subtraction") }
};
/* ColorHash structure */
@@ -1081,6 +1083,76 @@
}
}
+void
+grey_add_pixels (const unsigned char *src1,
+ const unsigned char *src2,
+ unsigned char *dest,
+ int length,
+ int bytes1,
+ int bytes2,
+ int has_alpha1,
+ int has_alpha2)
+{
+ int alpha, b;
+ int sum;
+
+ alpha = (has_alpha1 || has_alpha2) ? MAX (bytes1, bytes2) - 1 : bytes1;
+
+ while (length --)
+ {
+ for (b = 0; b < alpha; b++)
+ {
+ /* Add, re-center and clip. */
+ sum = src1[b] + src2[b] - 128;
+ dest[b] = MAX(MIN(sum, 255), 0);
+ }
+
+ if (has_alpha1 && has_alpha2)
+ dest[alpha] = MIN (src1[alpha], src2[alpha]);
+ else if (has_alpha2)
+ dest[alpha] = src2[alpha];
+
+ src1 += bytes1;
+ src2 += bytes2;
+ dest += bytes2;
+ }
+}
+
+
+void
+grey_subtract_pixels (const unsigned char *src1,
+ const unsigned char *src2,
+ unsigned char *dest,
+ int length,
+ int bytes1,
+ int bytes2,
+ int has_alpha1,
+ int has_alpha2)
+{
+ int alpha, b;
+ int diff;
+
+ alpha = (has_alpha1 || has_alpha2) ? MAX (bytes1, bytes2) - 1 : bytes1;
+
+ while (length --)
+ {
+ for (b = 0; b < alpha; b++)
+ {
+ diff = src1[b] - src2[b] + 128;
+ dest[b] = MAX(MIN(diff, 255), 0);
+ }
+
+ if (has_alpha1 && has_alpha2)
+ dest[alpha] = MIN (src1[alpha], src2[alpha]);
+ else if (has_alpha2)
+ dest[alpha] = src2[alpha];
+
+ src1 += bytes1;
+ src2 += bytes2;
+ dest += bytes2;
+ }
+}
+
void
difference_pixels (const unsigned char *src1,
@@ -5820,6 +5892,14 @@
case SUBTRACT_MODE:
subtract_pixels (src1, src2, *dest, length, bytes1, bytes2, has_alpha1, has_alpha2);
+ break;
+
+ case GREY_ADDITION_MODE:
+ grey_add_pixels (src1, src2, *dest, length, bytes1, bytes2, has_alpha1, has_alpha2);
+ break;
+
+ case GREY_SUBTRACTION_MODE:
+ grey_subtract_pixels (src1, src2, *dest, length, bytes1, bytes2, has_alpha1, has_alpha2);
break;
case DARKEN_ONLY_MODE:
diff -ur gimp-1.2.2-old/app/paint_funcs.h gimp-1.2.2/app/paint_funcs.h
--- gimp-1.2.2-old/app/paint_funcs.h Sat Dec 16 12:26:28 2000
+++ gimp-1.2.2/app/paint_funcs.h Wed Sep 26 19:17:57 2001
@@ -114,6 +114,18 @@
int bytes1, int bytes2,
int has_alpha1, int has_alpha2);
+void grey_add_pixels (const unsigned char *src1,
+ const unsigned char *src2,
+ unsigned char *dest, int length,
+ int bytes1, int bytes2,
+ int has_alpha1, int has_alpha2);
+
+void grey_subtract_pixels (const unsigned char *src1,
+ const unsigned char *src2,
+ unsigned char *dest, int length,
+ int bytes1, int bytes2,
+ int has_alpha1, int has_alpha2);
+
void difference_pixels (const unsigned char *src1,
const unsigned char *src2,
unsigned char *dest, int length,
diff -ur gimp-1.2.2-old/app/tool_options.c gimp-1.2.2/app/tool_options.c
--- gimp-1.2.2-old/app/tool_options.c Sat Dec 16 14:44:25 2000
+++ gimp-1.2.2/app/tool_options.c Wed Sep 26 15:22:39 2001
@@ -929,6 +929,8 @@
_("Difference"), (gpointer) DIFFERENCE_MODE, NULL,
_("Addition"), (gpointer) ADDITION_MODE, NULL,
_("Subtract"), (gpointer) SUBTRACT_MODE, NULL,
+ _("Grey Addition"), (gpointer) GREY_ADDITION_MODE, NULL,
+ _("Grey Subtraction"),(gpointer) GREY_SUBTRACTION_MODE, NULL,
_("Darken Only"), (gpointer) DARKEN_ONLY_MODE, NULL,
_("Lighten Only"), (gpointer) LIGHTEN_ONLY_MODE, NULL,
_("Hue"), (gpointer) HUE_MODE, NULL,
diff -ur gimp-1.2.2-old/app/tools_cmds.c gimp-1.2.2/app/tools_cmds.c
--- gimp-1.2.2-old/app/tools_cmds.c Mon Apr 24 11:22:56 2000
+++ gimp-1.2.2/app/tools_cmds.c Wed Sep 26 20:50:19 2001
@@ -277,7 +277,7 @@
success = FALSE;
paint_mode = args[2].value.pdb_int;
- if (paint_mode < NORMAL_MODE || paint_mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(paint_mode))
success = FALSE;
gradient_type = args[3].value.pdb_int;
@@ -340,7 +340,7 @@
{
PDB_INT32,
"paint_mode",
- "The paint application mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The paint application mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
},
{
PDB_INT32,
@@ -438,7 +438,7 @@
success = FALSE;
paint_mode = args[2].value.pdb_int;
- if (paint_mode < NORMAL_MODE || paint_mode > DIVIDE_MODE)
+ if (!GIMP_IS_BRUSH_MODE(paint_mode))
success = FALSE;
opacity = args[3].value.pdb_float;
@@ -480,7 +480,7 @@
{
PDB_INT32,
"paint_mode",
- "The paint application mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15) }"
+ "The paint application mode: { NORMAL_MODE (0), DISSOLVE_MODE (1), BEHIND_MODE (2), MULTIPLY_MODE (3), SCREEN_MODE (4), OVERLAY_MODE (5), DIFFERENCE_MODE (6), ADDITION_MODE (7), SUBTRACT_MODE (8), DARKEN_ONLY_MODE (9), LIGHTEN_ONLY_MODE (10), HUE_MODE (11), SATURATION_MODE (12), COLOR_MODE (13), VALUE_MODE (14), DIVIDE_MODE (15), GREY_ADDITION_MODE (19), GREY_SUBTRACTION_MODE (20) }"
},
{
PDB_FLOAT,
......@@ -9,7 +9,8 @@
<h2>Intention</h2>
<p>
This tutorial assumes a patched version of GIMP 1.2.2. Please don't distribute binaries which include this patch;
This tutorial assumes a <a href="gimp-grey-modes.diff">patched</a> version of GIMP 1.2.2.
Please don't distribute binaries which include this patch;
it creates non-standard XCF files, which would suprise users terribly. Real-world images have lots of noise:
film grain, scanner lines, CCD noise, paper texture, and just about anything else you can imagine. Computer-generated
images, on the other hand, tend to be too real. If you need to make computer-generated images look like real-world ones,
......@@ -30,16 +31,20 @@
<li>Take a noisy image.</li>
<li>Duplicate it into a new layer.</li>
<li>Blur it to remove the noise.</li>
<li>Set the blurred layer to Grey Subtraction mode to extract the noise. (You need to install the above patch to get this mode.)</li>
<li>Set the blurred layer to <b>Grey Subtraction</b> mode to extract the noise.
(You need to install the above patch to get this mode.)</li>
<li>Flatten the image.</li>
<li>Choose an interesting area of the noise, and make it into a tileable pattern.</li>
</ol>
<p class="images">
<img src="film-grain-vertical.jpg" alt=""/>
<img src="film-grain-vertical.jpg" alt=""/>(<a href="film-grain-vertical.pat">GIMP pattern file</a>)
</p>
<p>
Some good ways of making tileable patterns include Make Seamless, the Resynthesizer and Homogenizer, mirroring, and hand-editing. You'll have to experiment a bit.
In the following example, we'll use a weird, vertically-striped noise pattern. It looks like some kind of scanner noise, or perhaps an artifact of old newsprint.
Some good ways of making tileable patterns include <b>Make Seamless</b>,
the <a href="http://www.csse.monash.edu.au/~pfh/resynthesizer/">Resynthesizer and Homogenizer</a>,
mirroring, and hand-editing. You'll have to experiment a bit.
In the following example, we'll use a weird, vertically-striped noise pattern.
It looks like some kind of scanner noise, or perhaps an artifact of old newsprint.
</p>
<h2>Ruining a Perfectly Good Image</h2>
......@@ -68,7 +73,8 @@
<img src="sailboat-04-grain-added.jpg" alt=""/>
</p>
<p>
Position the noise layer above the image layer, and set the mode to Grey Addition. (Again, this won't work unless the patch has been installed.)
Position the noise layer above the image layer, and set the mode to <b>Grey Addition</b>.
(Again, this won't work unless the patch has been installed.)
</p>
<h2>Step 4</h2>
......@@ -76,10 +82,13 @@
<img src="sailboat-05-luminosity-blurred.jpg" alt=""/>
</p>
<p>
So far, so good. But the noise is too strong in the shadows and highlights of the image. To demphasize it, we can use a layer mask.
So far, so good. But the noise is too strong in the shadows and highlights of the image.
To demphasize it, we can use a layer mask.
<br />
First, add a layer mask to the noise layer. Then, make a copy of the image, gaussian blur it with a radius of 15 pixels, and paste
the blurred image into the layer mask. Use <span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Invert</span> to swap bright for dark.
First, add a layer mask to the noise layer. Then, make a copy of the image,
gaussian blur it with a radius of 15 pixels, and paste
the blurred image into the layer mask.
Use <span class="filter">&lt;Image&gt; Image -&gt; Colors -&gt; Invert</span> to swap bright for dark.
This will cause the grain to show through strongly in the shadows and midtones, but not in the highlights.
</p>
......@@ -92,19 +101,21 @@
We want to make the midtones bright, and the shadows and hightlights dark.
You can adjust the curves to taste. Curves Dialog This increases the grain in the midtones, and reduces it elsewhere.
<br />
Here's the Layers, Channels &amp; Paths dialog for the finished image.
Here's the <b>Layers, Channels &amp; Paths</b> dialog for the finished image.
</p>
<h2>Related Techniques</h2>
<p>
You can use various brushes in the mask layer to selectively edit the grain. You can also use the bucket tool in Pattern Fill, Grey Addition
mode to fill a selection with grain directly.
You can use various brushes in the mask layer to selectively edit the grain.
You can also use the bucket tool in <b>Pattern Fill</b>, <b>Grey Addition</b> mode to fill a selection with grain directly.
<br />
Many kinds of noise can be created using
<span class="filter">&lt;Image&gt; Filters -&gt; Noise -&gt; Scatter HSV</span>. You can apply this directly to an image,
or to a film grain pattern.
<br />
To denoise an image, try <span class="filter">&lt;Image&gt; Filters -&gt; Blur -&gt; Selective Guassian Blur</span>. It's slow, but very nifty.
To denoise an image,
try <span class="filter">&lt;Image&gt; Filters -&gt; Blur -&gt; Selective Guassian Blur</span>.
It's slow, but very nifty.
</p>
<p>
......
......@@ -20,21 +20,24 @@
<img src="flower-layers.png" alt=""/>
</p>
<p>
We'll create a very simple web banner. Let's start with a new image 468x60 px. Use white as the background color.
We'll create a very simple web banner. Let's start with a new image <b>468x60 px</b>. Use white as the background color.
Create new transparent layer. Select the whole image with <kbd>Ctrl+A</kbd> and fill it with black (<kbd>Ctrl+,</kbd>).
Shrink the selection by 1 px ( <span class="filter">&lt;image&gt; Selection -&gt; shrink</span>) and delete the selection with <kbd>Ctrl+K</kbd>.
We created a 1 px frame around out banner.
Shrink the selection by <b>1 px</b> (<span class="filter">&lt;image&gt; Selection -&gt; shrink</span>)
and delete the selection with <kbd>Ctrl+K</kbd>. We created a 1 px frame around out banner.
</p>
<p>
Now it's time to put our logo or the main theme picture into the banner. I have prepared a masked-out flower you see on the picture on the left.
I just pasted the flower below the border frame, used alpha to selection,
Now it's time to put our logo or the main theme picture into the banner.
I have prepared a masked-out flower you see on the picture on the left.
I just pasted the flower below the border frame, used <b>alpha to selection</b>,
created an empty layer below it and filled the selection with black using <kbd>Ctrl+,</kbd>.
After that I blurred the shadow using Gaussian blur RLE and ofset it by 2px to bottom right. I couldn't resist adding the interlace effect using
<span class="filter">&lt;image&gt; Filters -&gt; Render -&gt; Grid</span> and a layer mask. In that layer mask i applied a b/w gradient,
so that the left of the flower is not interlaced.
After that I blurred the shadow using <b>Gaussian blur RLE</b>
and offset it by 2px to bottom right. I couldn't resist adding the interlace effect using
<span class="filter">&lt;image&gt; Filters -&gt; Render -&gt; Grid</span> and a layer mask.
In that layer mask i applied a b/w gradient, so that the left of the flower is not interlaced.
</p>
<p>
This part of the tutorial is not the key element, so feel free to experiment. Once you're ready flatten the image using the
This part of the tutorial is not the key element, so feel free to experiment.