To edit, or not to edit, that is the question. ~ Photographers world over
Why should you, the average joe, edit? And why should you learn about the intricacies of different image formats? Limping through life with paint sometimes just gets too hard. Some paint-gods can live with that, but the rest of us, once in a while, need to tweak that photo or cook up a little clip art. It happens. Choosing the right formats to use is part of knowing how to deliver the photos after you play with them. So, without further ado, we'll discuss different file formats, and then look at some things you can do with image editing.
If you look very closely at some images, you can see that there are solid blocks of colors, instead of a continuous range:
image - blown up
Looks like a bunch if pixels to me, which is the way most computers represent images. Because mathematically defining curves or shapes was difficult, the computational world went the route of the pixel, or raster image. There are pixels at regular intervals that would approximate where a curve was, for example, and that would be good enough. Recently, though, computers got fast enough that you could represent curves or shapes mathematically, with infinite precision (or as high as the computer could go!), which is called a vector image. Now, thinking back to our hardware days, the monitor displays pixels, which means whatever vector image is displayed is actually another raster approximation, albeit one that can be improved upon vastly. It is unlikely we will ever see a true vector image represented with infinite precision in a normal medium (although I wouldn't be suprised if they did so: all sorts of technological advances are made everyday).
Google gimp already? You'll find that it really isn't a one-package installer; instead, you might have gotten an eyeful of 'source code' or, if you were lucky, 'gtk'. What you need to do is find the link to the Windows portion of the page and find the automated installer. There are two parts to the gimp (three, if you want the help files): the gtk runtime libraries, and the gimp itself. Download both installers, and install the gtk before you install the gimp. Now, after installing and running the gimp for the first time, you should have a little dialoug about 'cache size' and where to put your preference files. If you don't want to manually allocate your resources, the defaults are fine.
As a quick review, a format is the way a file is written so that different programs (the gimp, word and paint, for instance) can read it and extract the same information about the pixels: if editing programs and display programs couldn't agree on image formats, a beautiful picture would be displayed badly, or not at all.
This is an extremly simple format. It's also very big, relative to other formats, because it doesn't compress. While it takes up alot more space, it also doesn't throw away information in compression, so any copy of the file will be a pixel by pixel original.
This format is, er, not so simple. Real people, looking at how big bmp's were, decided that they could do better. So, they made a compressible image format that works remarkably well on complex images, lending to the name: joint photographic experts group, which is simply the name of the group that made the format. While jpegs are smaller in file size than their bmp counterparts, you have to balance the quality of the image with the file size: if you compress the jpeg all the way, it'll look like this:
image
So what if you don't want to lose your details? Png uses a non-lossy compression algorithm, so you don't lose details. The file sizes do tend to be larger, though.
Another consideration with png is that it handles large patches of the same color gracefully. Jpeg mostly has artifacts all over a mono-colored space, while pngs usually have none. If you're looking for a replacement of gifs, then look into png.
Don't use gifs. Unless you have to support a legacy application or need animations, in which case you might be better off using flash or a movie1. It's small only because it uses indexed colors. Gifs index colors by using only 256 colors, and then giving each pixel a value, 0-255(bmp uses 3 values per pixel- the red, green and blue channels, also referred to as rgb.). An index at the beginning of the file gives the colors of each of the 255 values, in true rgb format. Because there are only 256 colors involved (255 if you're going to use an alpha channel2), then converting another image format to this format requires either deciding which color maps best to which color, or dithering, a process of mixing pixels to make the appearence of another color not in the index. It's really ugly, and I don't recommend dithering. However, if you need to do it under the gimp, go to image>indexed>color dithering, and have your pick of methods. None will make dithering go away, which isn't a whole lot better. Just don't use gifs is my suggestion.
You'll probably never need to use this file format, but if you run across it (.tga), it's essentially a equivalent to the bmp format.
This format is a vector image format that's xml based (much like html) and stands for Scaleable Vector Graphic, which is what it is. Here's some sample svg:
><svg height="300" width="300"> <circle cx="150" cy="150" r="150" fill="blue" /></svg>
And here's the same image in svg: firefox 2.0 should work, as well as opera. You'll need to get adobe's svg plugin for IE anything.
image
If you've never used any sort of editing software, then the gimp should be a real treat. If you've used photoshop before, you might want to stick to photoshop, unless you're poor, like me. Let's plow ahead, though, and get our hands wet with an example.
Before we get started on editing our photos, let's make sure we have the best photos avaliable to us. Here are some basic principles to taking photos.
If you always set your camera to automatically white balance, (ie find the best exposure to get equal parts between light and dark parts of the image) then using the brightness of an image might never have concerned you. If you can, though, you'll want to use manual exposure settings to get the best possible balance between light and dark for the area you're going to be editing. Another good solution is to try to exclude everything that you won't be editing, and then let the camera white balance that (getting the greatest dynamic range (contrast between the darkest and lightest parts) the largest it can be will prevent grain when using the layer>color>levels tool.).
Most people take photographs of themselves. If you just want to edit up snapshots of your friends and your weekend tryst so you don't have so many pimples, then that's fine. You don't have to worry about composition. However, if you want to actually have photos worthy to edit, you'll need to worry about composition, alot. I wish I could teach you composition right here, but the best idea is to look at great photos, of which there are a few on the internet. Google image search is your friend.
There are very few places in which flash is useful and desireable. Taking quick of yourself and your friend in a dark theater is one place: if you've been shooting for 3 years, and you need a fill light, then it works. However, if you don't know what you're doing, keeping the flash off your camera can make things better. The huge headlights that usually appear on reflective surfaces should go away, and natural lighting can take over. If your camera can't handle low lighting, though, and your pictures turn out blurry from too much exposure, then use some flash.
So you have this photo that you can download and open in gimp:
image
and you realize three things:
We can't fix the ugly part, but we can work on the pimple and red eyes part3. Let's get started.
In order to get rid of the red eye, we need to first select the red part of the eye, and then take out the red. Because the pupils of most people are black, this makes our job easy: we don't have to try and remake details that aren't there (for instance, repairing blown-out highlights is a tought job), and we just have to tone down the red alot.
We'll get started with the contiguous selection tool:
image
and we'll select a part of the eye that's red. Now, there should be a selection border (people describe it as 'marching ants') around the red part. If not, go to gimp's main window, and beneath all the buttons, there's a pane of options. Screw around with the threshold settings until you get a nice selection around the red part. Got it?
If not, we can try using the quick mask. The quick mask toggle is on the left bottom of the image window, little box that turns everything red. Whatever shows up clear in the image will be selected when quick mask is turned off, so let's try using the fuzzy brush:
image - fuzzy wuzzy
to refine our selection. Now, feather the selection by going to the image window and selection>feather with a value of around 2 or 1.
We have our selection, so let's tone down the red. Go to layer>color>curves>red (top left) and set the curve to look something like this:
image - curves
Hmmmm, the eyes on this guy usually look dark, so it looks pretty good!
image - result
Now, the photo is a bit washed out from the flash, so we might want to balance out the contast of the image. Using layer>color>level, adjust the contrast of the image until it suits you, and then hit okay.
It's kind of hard to remove things totally from pictures, but it can be done: I once removed an entire person from an image, even though anyone aquainted with the technique would have noticed it. Here, we'll take on a smaller object: a pimple.
Select this tool, known as the clone tool:
image
and now find a piece of the image that isn't quite so ugly, and holding down ctrl, select that spot and then try painting over the pimple. If the spot becomes even more conspicuous, make sure the spot you're cloning from is close in tone to the spot around the pimple, and then try again. Ctrl-z is your friend! You might also want to use a fuzzy brush, selectable in the lower pane of the main window.
Some people that send pictures don't know anything about the scale of a picture, or the resolution. How many pixels wide x how many pixels tall is the standard way of stating the resolution of images, the same as stating the resolution of a monitor. These 'some people' don't bother to scale down their pictures before they send them, which makes for hard viewing by the viewer.
You should bother to first crop, and then scale down this picture before you send it anywhere, by using the crop tool:
image - icon
and then going to image>scale image, and choosing a pixel value to scale down to. Anything around 480 pixels is good, unless you need more detail, in which you might want to consider more cropping.
The scale tool:
icon image
is hard to get accurate. Working with numbers, though, is sure to be accurate, and will preserve the aspect ratio, or the ratio of the height to the width, of the image.
You've seen those pictures where there's two things that really aren't supposed to be together: a national geographic photo with wild polar bears and pengiuns in the same picture, as well as the shark attacking a helicoptor picture come to mind. We'll try to get you started in the art of compositing pictures, but we'll cut your expectations of being able to produce a realistic-looking image after this tutorial by portraying an absurd situation: a banana rampaging in downtown DC.
We have an image of a banana:
image
that we will transform into an object of fear. We want only the banana, not the pad the banana sits on or anything. Now, the banana is irregularly shaped, so we can try using the contiguous region tool, but it didn't give me a very good selection. We have another option available to us: a path tool.
Using the path tool is quite simple (a little tedious); just click where you want your path to go, usually where the border of the banana curves sharply or has a corner. If you run into a smooth curve, you can curve the path by holding down ctrl and then dragging a handle out of a point. I eventually came up with this path:
image
Now, do a selection>from path, and you'll now have a selection around the outline of the banana! Selection>invert, and then edit>clear to get a white background and nothing else.
Let's open up our Washington DC image:
image
and put our banana into the scene. Go to the layers window, and then right click next to the layer named background and make a new transparent layer, so your window looks like this:
image - layer
Now, going back to your banana picture, select the banana, copy, and paste to the DC picture while the transparent layer is selected (it should be blue until you paste). Then, scale down the banana using the scale tool (not image>scale image), while trying not to squish it, until it looks like a respectable, terrifying banana. After I moved the banana into the middle of the picture, and anchored it (box select image#########, click on image when the cursor turns into an anchor), this is what it looked like:
image - banana in front
That looks terrible. It's not going to convince anyone: the banana needs to be BEHIND the building. Then, selecting the DC layer, we then duplicate it and move it to the top (our banana will disappear, but we'll bring it back). Then, select the builing that we're going to put the building behind, using paths or whatever you wish, and then invert your selection and delete everything but the building. Your banana should show through:
image - banana in back
The building and banana could use some convincing touches, however. The edges that seperate them are a wee sharp, for instance: they could stand a little blur. If you still have your paths, you could reselect the banana, and then do select>border, and accept the default 5 pixels. Feather that selection a bit, and then do filter>gaussian blur, which should get rid of the crisp look in the image boundaries.
The banana might look a little out of place, since the lighting outside and the lighting on a kitchen table are different. Play with the levels tool, or perhaps the curve tools, until the banana looks like it's a part of the enviornment.
Hopefully, you've been saving in gimp's native xcf format(bmp with layers and masks) until now, so when your computer or gimp crashes all is not lost. Now, you can save a final, scaled down version as a jpeg, since it's a photo.
If you've been wondering how to make the sort of background I have (you might have seen it in an earlier tutorial) then here is a quick sketch of how I did it.
When I was starting out to make a new background (most of the backgrounds xp comes with don't scale very well!), I decided to shoot for making a sky. Now, you can just lay down a layer of blue, and call it good. However, using the gradient tool can make things look alot more natural. Even if the colors are really close, it'll make a difference.
image
First, let's change our palatte to a little white and light red. Our next step will be to make a couple of clouds, and if we want to make a 'evening' feeling, white and light red should work fine.
Now, the Gimp comes with this nifty little plugin called flame. It's under filter>render>nature>flame, and it makes these interesting little... well, you can't call them patterns. Who knows what you can call them. But I found a nice little flame that resembled some clouds, and played with the camera settings to get this:
image
Looking at this image, it could be a very nice image all by itself. But something seemed to be missing, and I though that some 'dark' clouds would be good to contrast. Making a new layer, I then applied the filter>render>cloud>plasma onto the empty layer. Then, I did a layer>color>desaturate to get it to be a black and white cloud instead of a multi-color tie-dye cloud. We managed to cover up our flame, though! No worries: let's apply a mask to the layer!
Right-click the cloud layer, and add a mask to it. Now, select the mask that appears beside the layer preview (inside the layer window), and try drawing a black and white gradient. The clouds should now gently fade out into the flame, as I tried to do here:
image
Now, as a finishing touch, we'll add a flare to the upper left hand corner. The flare I used is found under filter>Lighting Effects>FlareFx, in which I put the flare in the corner and let it rip. You can get the final image here.
Now, let's move on to making html: the driver of the internet.