Hello Bar

Sunday, December 2, 2007

Lawn Care with GIMP

In this short tutorial, you'll learn a technique you can apply to fixing many kinds of photo problems. In this lesson you'll use ...
  • The Lasso selection tool
  • Feather a selection
  • The Move tool
  • Move a selection
  • Move a layer
  • The Layers palette
  • Floating Selection
  • New Layer
  • Merge Down
  • and Flatten Image

In this photo you'll notice a couple of bad patches of lawn that detract from the appearance of the picture. We're going to repair the larger patch to the left.

1. Use the Lasso selection tool to draw a border surrounding the area to be repaired.

2. Feather the edge of the selection by at least 10 pixels, Select - Feather...

3. The selection needs to be dragged to a patch of good grass. Click the Move tool's icon then click the Selection icon so the move affects the selection only ...

... then drag the selection to a patch of good grass that will be placed over the bad patch.

4. Usethe keyboard shortcuts Control-C to copy that patch of good grass, then immediately Control-V to paste it as a Floating Layer on top of itself.

5. Use the Move tool again, but this time with the Layer icon chosen for Affect ...

... and position the copied patch of good grass over the bad patch.

6. Now, put the Floating Selection on a new layer of its own. In the Layers palette, be sure the Floating Selection is active, then click the New layer icon in the bottom left corner ...
... so the Floating Selection becomes a Pasted Layer in the Layers palette ...

... and the selection boundary has disappeared. (The layer boundary is still visible.)

7. Position this layer exactly as you want it, then merge this layer with the Background layer by right-clicking the Pasted Layer in the Layers palette and selecting Merge Down from the context menu.

8. Repeat this process to repair the other bad spots, then flatten the image, Image - Flatten Image, and save your work.

I haven't had much time for writing tutorials recently, but I've wanted to share this for some time. I hope you learn something you can use.

This is likely the last tutorial I'll write until I get GIMP 2.4 and learn about it.

Saturday, August 25, 2007

Put on a Happy Sky

In this lesson you will have the opportunity to learn a procedure to replace an overexposed sky in a photo with a more attractive sky from another image.
Before -

After -
Included in this lesson -
  • Decompose HSV filter
  • Threshold tool
  • Quick mask
  • Adjusting a selection
  • Moving layers

Open the photo with the unattractive sky (foreground image) and the image with the good sky you want to use. It's much easier if these images are the same size, so you may want to scale one or both images before proceeding. For the time being, you may want to minimize the "sky" image to reduce clutter.

Step 1 - Decompose the background image to HSV
Filters - Colors - Decompose ...
Select HSV in the dialog. This will create a new image with the same name as your original foreground image but which has HSV appended.
Be sure the Value layer is active (white border) in the layers dialog
Step 2 - Apply the Threshold tool to the Value layer
Tools - Color Tools - Threshold ... OR Layer - Colors - Threshold ...
Push the middle slider to the right until the sky is white and the foreground is black. Use one of the Paint tools (pencil, brush) to make any adjustments needed.
Step 3 - Apply Quick Mask to the foreground image
Select your original foreground image and toggle the Quick Mask ON by clicking in the bottom left corner of the image window (Shift+Q OR Select - Toggle Quick Mask).
The entire image should now be covered by a translucent red layer.
Step 4 - Copy the Decomposed image and paste it onto the Quick Mask in the foreground image
Select the Decomposed HSV image and copy it.
Edit - Copy (Ctrl+C)
Switch to the foreground image.
Edit - Paste (Ctrl+V)
Step 5 - Define the selection
Toggle Quick Mask OFF by clicking in the bottom left corner of the image window (Shift+Q OR Select - Toggle Quick Mask).
The red layer should be gone and the "marching ants" selection border should appear.
Right now the sky is selected, but you want the foreground to be selected.
Select - Invert (Ctrl+I)
Select - Shrink ... [setting: 1 pixel]
Select - Feather ... (Ctrl+Alt+F) [setting: 2 pixels]
Step 6 - Place the foreground on a new layer of its own
Edit - Copy (Ctrl+C)
Edit - Paste (Ctrl+V)
You should see a floating selection at the top of the layers dialog.

Put this on a new layer of its own.
Layer - New Layer ... (or click the New Layer icon at the bottom of the layers dialog)

Name this layer "foreground".
Step 7 - Copy the new sky from the other image to the foreground image
Activate the image containing the sky you wish to use and copy it.
Edit - Copy (Ctrl+C)
Activate the foreground image
Edit - Paste (Ctrl+V)
Layer - New Layer ... (or click the New Layer icon at the bottom of the layers dialog)
You now have the sky image on its own layer. Name this layer "sky".
Step 8 - Reposition the sky layer
Move the "sky" layer below the "foreground" layer in the stack by either dragging it or using the down button at the bottom of the layers dialog.
Step 9 - Finish up
If you want to save your image in JPG or PNG format you'll need to flatten it to a single layer first.
Image - Flatten Image

Understand, this is NOT the ONLY way to do this. It works well for me and gives you an opportunity to use some functions of the GIMP which may be less familiar to you. The techniques used can be applied in other tasks as well. I hope you find this useful and instructive. Comments and/or donations appreciated.

Friday, August 3, 2007

How to delete saved settings from Levels, etc.

This information applies to Mac OS X, GIMP 2.2

Sometimes while working on a project you may want to save the settings you used in a Levels or other dialog to use on other images in the project. When that project ends, you will probably want to delete those saved settings.

I found myself in this situation recently, but I was unable to find any documentation explaining how to delete these saved Levels settings. I was eventually able to determine these settings were stored in a folder in /home/.gimp-2.2. I then learned that since this folder name begins with a dot, it is hidden by OS X.

Next, I had to figure out how to access this hidden folder. I found the following scripts which run from the Terminal. Type this in the Terminal to show all hidden folders and files,

defaults write com.apple.finder AppleShowAllFiles TRUE

killall Finder

Then, open Finder from the Dock and navigate to the .gimp-2.2 folder. Open it and delete the saved profiles.

You'll likely want to restore file/folder hiding. Run the following,

defaults write com.apple.finder AppleShowAllFiles FALSE

killall Finder

A note of warning, be careful when modifying hidden things. Backup first.

Hopefully, future versions of GIMP will have a simpler way to delete these no longer needed files.

Wednesday, July 25, 2007

Crop Tool Quick Tip

I had never understood how to use the Fixed aspect ratio option of the Crop tool correctly to retain the image's proportions. I learned this procedure from Beginning GIMP: From Novice to Professional, Akkana Peck, Apress, 2006.

  1. Select the Crop tool and click in the image to open the Crop dialog.
  2. Click on From selection to set the crop rectangle to the entire image.
  3. Next check Fixed aspect ratio. Now you can drag on one of the resize handles (upper-left or lower-right) to change the size of the crop rectangle while the proportions remain the same.
  4. Then you can use one of the move handles to position the crop rectangle as desired.

Tuesday, July 24, 2007

Grid on a Globe

I saw a similar effect on a recent Newsweek cover and I was inspired to try replicating it with GIMP. After a good bit of experimentation, I came up with a not-too-complex method which I have presented here.
Part 1 - Preparation
The most tedious part of this exercise is preparing the images you plan to place on the sphere. You will need twenty 100 pix by 100 pix square images. Of course, for the purpose of the exercise you could use just a few images repeatedly. At any rate, you will need to select your images and crop each one to a square. Then all the images will need to be resized to 100 x 100 pixels. I used Mac OS X's Automater to create a workflow to perform this second step. There are also a number of freeware/shareware utilities to carry out this task, as well, and an Apple Script.

Part 2 - Create a new image for the picture grid
Create a new image 425 pixels by 530 pixels (height = 1.25 x width). Next turn on the grid and configure it.
1. View - Show Grid
2. View - Snap to Grid
3. Image - Configure Grid ...
Set Width and Height both to 108. This will allow an 8 pixel space between the images in the grid.

4. Start placing the small square pictures into the grid.
File - Open as Layer... (Ctrl+Alt+O)
5. With the Move tool, position the picture in the top left corner of a grid square.
When you get near the corner, it'll snap into place.
6. Repeat steps 4 and 5 until all the grid squares are filled.
7. When the grid is filled, flatten the image to a single layer.
Image - Flatten Image
Part 3 - Create a second image which will become the sphere
1. Create a new square image 1000 pix by 1000 pix. 2. Activate the grid image and copy it. Edit - Copy (Ctrl+C) 3. Make the new empty image active and paste the grid image onto it. Edit - Paste (Ctrl+V) The grid image is now a floating layer centered over the plain background layer. 4. Stretch the new layer (the grid) vertically. Layer - Scale layer... Break the Width/Height link by clicking on the chain icon Set the height to 850 (height = 2 x width)

5. Anchor the floating selection to the background layer.
Layer - Anchor Layer (Ctrl+H, or click the anchor icon in the layers dialog)
Part 4 - Map this image to a sphere
1. Filters - Map - Map to Object...
Select Map to : Sphere
Check Transparent background

2. Depending on the speed of your system, this may take a bit to render.

Use this as a jumping-off point. You may want to experiment with different aspect ratios for the individual images, different numbers of images, different grid sizes, and so on. An idea I might work on is blending the pictures rather than having distinct frames. -- tab

Tuesday, July 17, 2007

Blending Two Images with GIMP

Included in this tutorial -
  • Resizing a Canvas
  • Creating a new transparent layer
  • Anchor a floating layer
  • Using a layer mask
  • Using the gradient tool
  • Flattening an image

Open both pictures you intend to blend

Activate the one you intend to use as the base image

Increase the canvas size of this image to accommodate pasting the overlapping image

Image - Canvas Size

Break the Width/Height link by clicking on the chain icon

If the two images are the same size you need to nearly double the width

Create a new transparent layer

Layer - New Layer ... (or click the new layer icon in the layers dialog)

Name the new layer 'Overlay layer'

Select Transparency as Layer Fill Type

Activate the second image which will be the overlay layer and copy it

Edit - Copy (or Ctrl+C)

Activate the base image and paste the copy of the second image onto it

Edit - Paste (or Ctrl+V)

Anchor the floating pasted layer to the transparent Overlay layer

Layer - Anchor Layer (or Ctrl+H, or click the anchor icon in the layers dialog)

Use the Move tool to position the Overlay layer so that it overlaps the base layer as much as you like

Note that it's helpful to slide the Overlay layer down a little so you can see how much overlap you've got

Add a layer mask to the Overlay layer

In the layer dialog, right-click the Overlay layer

Add Layer Mask ...

Select White (full opacity)

Paint a black-to-white gradient on the layer mask

Select the Gradient tool with the options shown

Draw a straight line (use Ctrl to constrain your line if necessary) from the left edge of the Overlap layer to the right edge of the base image

The two images should now be blended together as shown

Even up the tops of the two images

In the layers dialog activate the overlay image by clicking on it (look for the white border)

Use the Move tool to drag it up so the tops of the two images are aligned

Finishing up

Flatten the blended image into a single layer

Image - Flatten Image

Use the Crop tool to remove the unwanted portions of the image

This tutorial was adapted from a Photoshop® tutorial. There may be different and/or better ways to do some of these things. Some of the methods I used were developed from trial-and-error. I try, too, to include some less frequently used techniques if I can. I hope you find this tutorial useful and instructive. - tab

Monday, July 9, 2007

Creating a brush with variable size

When I first started to use GIMP, one of the Photoshop® features I most missed was the ability to resize a brush on-the-fly rather than having to reselect a different size brush or create a new one of the needed size. I searched unsuccessfully for a way to do this.

Recently, as I was looking in the GIMP manual online, I noticed an item 'Creating a brush with variable size'. I hadn't ever noticed this item before, so it's either been recently added or I'm #@%&. At any rate, I'm presenting it here enhanced with screenshots for those of you who would like to make use of this handy feature.

  1. Start with opening the Brush dialog by double-clicking on the Brush area in Toolbox, or by FileDialogsBrushes. Click on the New Brush button to open the Brush Editor dialog.

  2. Name your brush at once, 'Variable Round' for instance.
  3. Your brush will appear in the Brush options with a blue corner.
  4. Now, go FilePreferencesInput Controllers
  • Click the Main Mouse Wheel tab.
  • Check Enable this controller.
  • Scroll through the Events list and select Scroll up (Shift).
  • Click on the Edit button to open a window that allows you to assign an action to the selected event.

  1. Click on the small triangle next to Context to drop the list down. Scroll through this list and select the context-brush-radius-increase item.
  2. Do the same to assign the 'context-brush-radius-decrease' action to the 'Scroll down (Shift)' event to decrease the brush size.
  3. Click on the Save button in the Brush Editor to save your brush.

I am using a third-party mouse on my iMac and didn't have success with the scroll wheel actions. However, using the Main Keyboard tab I was able to assign increase and decease brush radius to the up- and down-arrow keys. I also used the left- and right-arrow keys to decrease and increase the hardness of the brush.

If you work with a tool that has a 'Brush' option and have selected your Variable Round brush, press the Shift key and you will be able to vary the brush size by using the mouse wheel or the up- and down-arrow keys. This change will be visible in real time in the brush area of the Toolbox and in the Brush Dialog.

Hope you found this useful. --tab

Thursday, July 5, 2007

Creating Text on a Sphere with GIMP

Includes -

Using guides, Text tool, Script-Fu drop shadow, Merging layers, Object mapping

Part 1 - Create a new square image

Choose the color of the sphere as the Background Color

File - New

Set the dimensions to 250 x 250 pixels

Part 2 - The guides

Image - Guides - New Guide (By Percent) ...

Select Horizontal from the drop down

Set Percent at 50%

Use the same procedure to set a Vertical guide at 50%

Part 3 - The text

Choose the color you want for your text as the Foreground Color

Select the Text tool

In the tool settings, select centered alignment

Set the text size about 30 pixels

Click in the image to show the text dialog

Type the text you wish to appear on the image in the dialog box

Select the Move tool

Use the Guides to position your text in the center of the square

Part 3a (Optional) - Add a drop shadow to the text

Script-Fu - Shadow - Drop Shadow

I simply used the default settings

Part 4 - Creating the sphere

In the Layers dialog, right click any layer, select Merge Visible Layers ...

Select Expand As Necessary

You should now have a single layer

Filters - Map- Map Object

Select the Options tab

Select Sphere from the drop down

Check Transparent background

Check Enable antialiasing

Part 5 - Finishing up

Hide the Guides

View - Show Guides (deselect)

You can now easily Copy and Paste into another image

The parameters I used throughout this lesson are a matter of personal preference. Feel free to experiment and have fun.

If you found this lesson useful, a small dontation would be greatly appreciated.