Chris' ColorWorks Power Tips- by Chris Wenham

What the heck to do with Adjust Histogram: Part 1

I'll bet you good money that one of the first things you did with ColorWorks, or any complex image processing program you first used, was to go through all the effects and try them out. If you were inexperienced with photo processing you probably couldn't figure out some of the more obscure looking devices like Advanced Color Balance and Adjust Histogram. Play with them a bit and probably the most you could get was to make something look more green, or duller.

However each tool is mightily powerful when used in the right place and I've been searching for ways in which the Adjust Histogram tool in particular can be useful. I've named this tip "Part 1" because I intend to be coming back to Adjust Histogram in later columns.

Smoothing Lines

How often have you needed to clean up an image that's been scanned at a low resolution, or has come in as a fax? In this case I'm talking about mostly monochrome figures (GIF, 1K) that have the dreaded "Jaggies" -- pixilated edges that come from a lack of smoothing or "anti-aliasing". Somehow you've got to smooth those lines out.

Smoothing of these kinds of images is a two step process -- first you blur the image to get the smoothing effect in the first place, then you sharpen it just enough so it looks crisp and finished. Blur and sharpen filters, right? Well... blur yes, but we want more control over the sharpening process to get exactly what we want in a very elegant way.

If you don't have a fax, you can easily create a test image by selecting the Text Tool with a black colour and writing to a blank white canvas without text anti-aliasing turned on (if you are using ColorWorks V2). This should produce black text with jagged edges on a white background.

If you already have a suitable image, load it, then pick Effects.Filter Labs.Smoothing Lab, choose a Gaussian Distribution blur at 100% on All Pixels. Now go to your canvas and paint that on (GIF, 4K) with the full canvas tool. You'll probably have to do this two or more times until you see all the jaggy effects blended out satisfactorily.

Now switch the smoothing effect off (Effects.Clear All Effects) and go to Effects.Tune Image Colors.Adjust Histogram.

A little bit about the histogram: "The X or horizontal axis represents all potential brightness values of the tonal range from 0 to 255. The Y or vertical axis represents the number of pixels in an image that exist for a particular brightness value. Hence, the height of the vertical line for a particular color value represents the number of pixels with that value." - ColorWorks 2.0 manual, page 399.

If you applied the right amount of Gaussian distribution on the figure you should see a broad and even spectrum on the histogram (GIF, 10K) with peaks at the start and end of the graph. If you don't see them immediately, press the "Zoom In" button a few times until you do.

On the left hand side of the graph you have the blacks, and on the right hand side you have the whites. In between are the greys. (This is assuming you're working with a B&W image.) At the bottom are two triangle pointers, one black, one white.

Set the "Shadows" radio button to "Compress" and the "Highlights" radio button to "Expand". Now take the black pointer and move it toward the right until it's at 70, then take the white pointer and move it left until it's at about 200. Preview that quickly, then paint it to your picture with the full canvas tool.

Result? Magic (GIF, 3K). The figure should have been sharpened but left with just enough smoothing/anti-aliasing around the edges to make it look clean, crisp and professional.

So what happened here? What we did was to strengthen the darker colors by moving the black pointer to the right, then "shave off" the excess lighter colors by moving the white pointer to the left. Try experimenting with the Adjust Histogram more after blurring the figure. Move the black pointer too far and you fatten the image, move the white pointer too far and you make it thinner.

Remember, we could have used a sharpening filter, but the Adjust Histogram effect was interactive, plus a lot more flexible and subtle.

If you didn't quite get the effect you were looking for, try using different settings on the Adjust Histogram dialog. Position the pointers just before or just after the "bumps" in the graph. And remember, if you get something that's -just right- and need to use it again you can save it as a Graphics State file with Options.Save Graphics State...

Q&A Center

"My old paint software, MegaPaint Pro Plus Gold, had a "Magic Wand" feature that let me select objects of irregular shape. How can I do that with ColorWorks?"

- Joe Anybody, Somewhere, Idano

Joe, the algorithm behind the "magic wand" tool is so much like the floodfill algorithm that it's practically the same thing. The makers of MegaPaint thought they'd impress you with something they called "Magic", that wasn't really. In ColorWorks you would flip into mask mode (left-click the mask button), select the floodfill tool, then click on the area of the canvas you would have clicked on if you were using a "Magic Wand" tool. ColorWorks will fill in any irregularly shaped area of the same color. After that just press Ctrl-F to float the image.

If you actually want to select an area of similar color, you would double-click the floodfill tool and use the spin buttons to change the RGB (or HLS) tolerances. Setting each to 10 would tell the floodfill tool to consider any pixel plus or minus 10 color values to be in the same area. Usually, setting each to 40 is good enough for selecting most objects against a plain background. If the background is more complex simply adjust the tolerances accordingly and use more fills until you've masked out the object you want.

If you're puzzled by something you can't figure out, drop us a line and we'll pool our resources to help you. Send your questions to us at OS/2 e-Zine!.

Readers Tips

"I wanted to make some icons using ColorWorks, but ColorWorks doesn't export to .ICO format directly. So after creating the icon I wanted I selected the area with the rectangle tool in mask mode, pressed Cntl-F to float the image, then selected Edit.Copy. I minimized ColorWorks for the time being and loaded OS/2's Icon Editor. I selected Edit.Paste, made sure everything was fine, then saved it to an .ICO file."

- Joe Anybody, Somewhere, Idano

We'll be publishing any tips that readers may have for getting the most out of ColorWorks. Send your suggestions to OS/2 e-Zine!.

Download Depot

Grab this month's palette and textures (ZIP, 32.8k):

Peach Palette - A palette of peach colors, good for use with the gradient effect. Save to the x:\cworks\palette directory.

Barbed Fence Texture - Save to the x:\cworks\texture directory.

Topography Texture - Appearance of a topographical map. Save to the x:\cworks\texture directory.

Waterfall Texture - Good to give the feeling of moving or falling water. Save to the x:\cworks\texture directory.

ColorWorks Culture

ColorWorks V2 and V1+ represent over 30 months of work, during which most of the developers were listening to calm, soothing music like White Zombie, Judas Priest, Soundgarden and Rage Against the Machine. So if you ever wondered what inspired them to name some of the Graphics States as "Black Sunshine" and "Thunder Kiss", now you know.

News from SPG

SPG's Web Site

During May, SPG released two more technique lessons. The first is "Creating Seamless Images", which teaches how to create pictures that can be tiled without any noticeable seams. This is useful for creating your own textures, displacement maps, bitmap fills (see last month's tips column) and backgrounds for your web pages or desktop.

The other is Killer Text Effects Volume 2, leading off from where the first one began and introducing a slew of new effects like Backlighting, distressed effects, cut out effects, Invisible moving text effects and more. Many of the tips don't just apply to text either, so check it out. These on-line technique lessons are H-U-G-E! but worth it with their full color examples. You bought that big ol' hard drive to store stuff on, didn't you? Well start cramming!


Chris Wenham is a Team OS/2er in Binghamton, NY and president of his own company--Wenham's Web Works. He has written comedy, sci-fi, HTML, Pascal, C++ and will work for tips.
Imaged with ColorWorks

[Index]  [ Previous] - [Feedback] - [Next ]
Our Sponsors: [Bianchi Software] [BMT Micro] [ChipChat] [EmTec] [H.O.T.] [Prominic]


This page is maintained by Falcon Networking. We welcome your suggestions.

Copyright © 1996 - Falcon Networking