Hello Bar

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.