Terragen
images colour correction and other adjustments |
Part 3 | Sharpening images and saving in compressed formats
Jean Claude Grégoire & Esteban Glas
|
|
| The final steps in order to make your perfect image and to show it to
the rest of the world to admire and to applaud are: sharpening a little
bit (this will really enhance the features on your terrain and surface map)
and saving in a compressed format. Let's start with sharpening. |
Sharpening
|
The name gives a good clue about what this process does; it sharpens
the edges between different colours making that "division line" more visible. But how? Maybe a few examples might help to explain it. |
This is our unsharpened image. There is quite a
lot of work on that surface map. But lighting, and Terragen's native
blended detail and sub-pixel smoothing settings make the subtle
surface changes hard to see. |
|
And after applying the "sharpen more"
filter we get this image. There are a lot more visible details on
this image. All that surface map work really shows up now. |
|
|
Maybe a little zoom in can help to further illustrate this:
|
|
Zoom in to the unsharpened image
|
Same zoom in to the sharpened
image
|
|
This is all very nice, but what is this sharpen filter really doing?
Basically all it does is two different things: It enhances colour differences;
brighter colours are a bit brighter and darker ones get a bit darker
and it enlarges the main areas of similar colour up to the point where
they meet other colour areas, thus making transitions quite more tough:
sharper. |
|
| All of this is very nice; but what should I do with my image? There isn't
one single answer to this question, and, once again, it depends a lot on
what you are looking after. According to that you might want to use a very
visible sharpening, a subtle one or none at all. We'll now present different
ways of sharpening an image. |
We're not going to go through the very basics, we are pretty sure you
know where to find the Sharpen and Sharpen More Filters. While using them
is quite easy, there's a huge difference between applying the sharpen
filter before or after resizing.
sharpen > resize |
resize > sharpen |
The difference really resides in the bicubic resampling that Photoshop
applies when you resize images. This process "averages" pixels,
making transitions smoother... you could compare the effect to sharpening
and then blurring the image (although it is not the same). Bottom line
is: If you want a very sharpened look apply the filter after resizing,
otherwise sharpen before. |
| With this in mind we are now going to show you some alternative sharpening methods. |
L channel sharpening
|
| Something quite interesting happens
when you change the mode from RGB to Lab and then sharpen the
L channel. As we've already seen the L channel is the luminosity
channel, and when the filter is applied just to this a small
edge appears where lighter areas merge with darker ones. In
the image to the right there's a small zoom box to better show
this. |
|
|
The difference between an ordinary sharpened image and an
image where only the "L" channel has been sharpened
(in LAB mode) is particularly noticeable on images where there
is a strong contrast of colours between two adjacent areas.
For example, we show you a zoom-in of part of a downsized Terragen image
where the rocks are more or less yellowish and the sky blue.
This is an interesting contrast between complementary colours. |
Now we will compare the results of sharpening
the RGB image and sharpening the "L" channel in the
LAB image.
|
Fig 1.a - Lab sharpening |

Fig. 1.b - Normal (RGB) Sharpening |
| In fig. 1.a, the lighter colors of the rocks are
even lighter than in the original image; the darker ones even darker, but the COLOURS are the same ones.
In fig. 1.b, the rocks are more yellow than in the original,
i.e. the yellows are over-saturated. In the
sky, there is a saturated blue edge against the rocks. Furthermore,
there are now some red pixels near the top and the left edge
of the rocks. In other words, the RGB sharpening method accentuates
the differences colours between adjacent areas,
and the LAB sharpening method accentuates the differences of
light between adjacent areas, without modifying
the balance of the colours. |
|
A short word about various sharpening filters
|
Photoshop proposes some sharpening filters:
sharpen
sharpen edges sharpen
more unsharp mask |
|
|
Which is the best one for our purpose?
In general you can read in books that only the unsharp mask is the appropriate
method, because the other ones accentuate the noise and the defects in the
image. This is certainly true when you work with ordinary photographs, particularly
with big ones. But Terragen always renders PERFECT images, without any noise
and without any defect. Thus the problem is not the same one. Furthermore,
you nearly never have to sharpen a Terragen image you haven't resized. In
most cases, for Terragen images, sharpening only becomes necessary after
downsizing the image.
In this case, the experience shows that the most useful sharpening filters
are "Sharpen" and "Sharpen more". You just have to decide
which one to utilize: it depends on the image and on what you want to obtain
from it; there is no all-purpose answer.
It is possible that, for some reason, you really want to sharpen a big size
Terragen image. In this case we advise you to utilize the unsharp mask
with the following settings: · amount:
25 or 50 (the more amount the stronger sharpening you get - I prefer 25);
· radius: from 0.1 to 2.0 (the more radius
the wider colored edges you get - I generally prefer 0.2 to 1); ·
threshold: 0 or more (the more threshold the sweetest sharpening you get
- I always begin with 0, and increase this figure according to the result).
With this method, it's generally better to apply the filter several times
with a small amount value than one time with a big one. But in any case
you'll have to experiment and to run several trials for each image.
What the "unsharp mask" does, according to Photoshop's user
manual is to add both dark and lighter areas where it finds colour contrasts.
Thus, the settings really depend a lot on the size of your image, since
a 0.5 pixel radius might be perfect for a 1000 pixel-wide image, but it
won't even be noticeable when applied to a 4000 pixel-wide image you are
going to downsize afterwards.
| TIP:
You should always keep a copy of your original Terragen image before
making any changes to it! Once you've tweaked all over the image it
won't be possible to make further corrections without really damaging
the quality of the image. If you keep a good (not compressed or saved
as PNG 24), original size copy of your image you can always make a
clean start if you are not satisfied with the results. |
|
Compression systems
|
There are numerous compression systems, but for our purpose, only three
of them are interesting. The PNG, the GIF and the JPG system. |
|
This is a zoom of a Terragen image in it's native BMP format. The
colors have been exaggerated for better showing the differences between
the GIF and the JPG system.
With the PNG-24 compression system, the image would be exactly the
same, without any loss in quality.
|
|
Here you can see the result of the GIF compression system. Because
.gif images can only have a maximum palette of 256 different colors, with this system, you get a lot of different pixels trying to reproduce
the tones of the original.
|
|
Now with the JPG system, you have all the colors, but you can see
the 2 sorts of artifacts introduced by the JPG compression: a lot
of "hairs" about the edges of the mountain, and a kind of
checkerboard in the sky. As JPG works in a perceptual way it really
alters the original file even when set to the maximum quality level.
Thus, it's only good for a final post and not to use as an original
for corrections or tweaking. |
|
Let's compare the size of the files, for the same image:
Original BMP file: 810,056 bytes; GIF file: 89,052 bytes;
JPG file, best quality: 134,576 bytes; JPG file, medium
quality: 26,436 bytes; JPG file, best compression and lowest
quality: 17,739 bytes; PNG-24 file, 117,663 bytes
These figures are not absolute ones, they vary with each image. If you want
the best quality, the PNG system certainly is the one to select. If you
want the best compression, choose JPG. GIF is never a good choice for color
photographs or Terragen images. But it can work quite well for graphics
and some B&W photos. |
What should be the balance between quality and size in JPG format? It
really depends a lot on the image. Some pictures can still deliver a very
good quality when compressed to 60, others will show visible artifacts
at the same compression.
In general we prefer to save the output file as BMP and then using another software for the final conversion to JPG. The advantage of this method is that you keep a copy of your work without any artifacts. On the other hand, the compression is a particular task that can be performed quite well by other various programs, like the ones that follow in this short and incomplete list:
|
| · Firegraphic |
Older versions are freeware upon registration, newer
versions are paid. This is an excellent visualization tool as well.
|
| · Fireworks
|
Macromedia's web-aimed image editor uses PNG files as it's native
format and it's JPG compression system is excellent.
|
· ACDSee Classic
|
ACDSee offers a variety of visualization and managing programs. Some are more expensive than others.
|
| · IrfanView |
Very complete for conversions to about any format.
The JPEG conversion is excellent: one of the best ones around!
And the unregistered version is entirely free, although registration is possible
at a very low cost about $10 or €10, for supporting the program. Special prices are available for commercial use.
|
| |
|
|
|
Small Technical review of the PNG and JPG formats
|
1. JPG Files
1.1 General Data
According to the JPG data sheet "JPEG is designed to exploit known limitations of the human eye, notably the fact that small color changes are perceived less accurately than small changes in brightness"; thus it uses a perceptual compression mechanism. That's why JPG images always loose part of the quality, although the eye probably wont see it (but your image editor sure will). JPG format stores pixel data in a 24-bit depth. JPEG has a hard time with very sharp edges: a row of pure-black pixels adjacent to a row of pure-white pixels, for example. Sharp edges tend to come out blurred unless you use a very high quality setting (never save masks as JPG!!).
Because the human eye is much more sensitive to brightness variations than to hue variations, JPEG can compress hue data more heavily than brightness (gray-scale) data. Therefore grayscale images compressed in JPG format have a lower compressed to original ratio than 24-bits full colour images.
An important thing to have in mind with JPG files is that the larger the resolution (bigger images) the lesser the compression artifacts will be visible.
1.2 Compression issues
A common mistake that people make is assuming that the
numbers they read on the quality scale of their compression software
is equal to quality; e.g. that a quality sclae value of 80 retains 80 percent of the original image quality. This scale is entirely arbitrary. Another thing to have in mind is that the quality scales vary from one program to another; so if I used a Q value of 80 in Photoshop it is not the same as a Q value of 80 in another program. The absolute quality scale is known as "IJG scale".
Never use a Q value above 95, since a Q of 100 will be three times bigger than one of 95 with no visible effects. The Q 100 top notch is a mathematical limit rather than a useful setting.
If your image contains sharp colored edges, you may notice slight fuzziness or jagginess around such edges no matter how high you make the quality setting (see the sample image above).
JPG uses either Huffman or Arithmetic coding. This last usually produces images 10 - 15 % smaller than those which use Huffmans algorithm. Regretably Arithmetic coding is subject to copyright since it's owned by IBM, AT&T and Mitsubishy and no commercial use can be done without obtaining a licence from them. The way different programs use this math results in the compression-quality ratio. Not all programs compress JPG files the same way.
Finally a JPG file is NEVER entirely lossless. |
| For more info on JPG compression and format refer to the JPG FAQ. |
|
2. PNG files
The developers of the PNG format created it taking in mind the difference between chromaticity and luminescence. In order to reproduce exact colours PNG has the ability to define a cHRM chunk who's purpose is to cope with the differences between monitors and manufacturers. As for luminescence, this format includes a gAMA (gamma) chunk to deal with this.
Colour in PNG files is represented by an RGB sample data. If there's a cHRM chunk present in the file that RGB data will then be calibrated; otherwise it's uncalibrated and device-dependant.
PNG also has the ability to include an alpha channel which allows a comprehensive transparency.
Finally, this format support three different types of Pixels; Indexed (each pixel is an index of a defined colour palette), Grayscale (where 0=black and the largest value for the bit depth = white) and Truecolour (three samples represent each pixel, Red, Green and Blue; where, for R = 0 = Black and R = largest value for bit depth = full red and so on).
Compression. PNG files compresses the pixel bit data, not the colours in a similar way that a Zip archives files. Image quality is lossless.
|
| For more info refer to the PNG Specification available here (tar.gz compressed file) |
|
With this we finish this 3 parts image adjustment tutorial. Final word is: try to make your Terragen images as good as you can get them, so they need as little correction as possible. It is always better when the original quality is good. Experiment, read the documentation, try different approaches and share your images for the rest of us to admire! |
| Keep rendering! |
Jean Claude Grégoire &
Esteban Glas |
|
|
|