HarmWave V1.00
by Harm
harmans@uswest.net
Copyright © 1999 Technoid Brain Trust Productions
All Rights Reserved
Introduction
System Requirements
License
Installation
Source Code
Credits
Using the Interface
Effects
Filters
Distortions
Color
Size/Aspect
Draw
Drawing Tools
Gradient
Buffer
Seamlessness
Menu Selections
Technical Support
Introduction
HarmWave was developed using Delphi 4, although it can compile with Delphi
3 as well. It uses Native Delphi VCL with two exceptions - HarmFade is a custom component
I developed, which can be seen in action on the About dialog, and HarmGradient is used in
the main window for drawing purposes.
HarmWave is a drawing tool that can produce seamless textures for use as Windows Wallpaper or backgrounds of Web pages. It's not intended to be a real tool for use by professionals - it's more of a toy for people who like to doodle. It has many filters which are useful for Photo Editing/Enhancing.
It's free. I expect nothing in return, but if you like it drop me an email. If you're a Delphi programmer, see the Source code section. I'm sorry for this lame excuse for a Help file, but I don't like mucking with *.rtf files for the normal windows help. Thanks for your interest in this software, I hope you enjoy it.
System Requirements
HarmWave was developed for my own purposes, so it is designed to work on
my system. It will not work very well on anything less than a Pentium. It will fit on a
640 X 480 screen, but I developed it on 800 X 600. I did not provide for different
resolutions, so 800 x 600 and small fonts looks best. Win95 or higher is required.
I also use 24 bit (True) Color. 16 bit (High) color works OK, but 256 colors look like crap. For best results, set your monitor resolution to True or High Color.
STB video cards have a reputation for not correctly handling some graphics operations. It works great on my machine, which uses a Matrox card. This is not an advertisement for them, or a slam on STB, I'm just stating the facts, in the event that this program does not function correctly on your machine.
This software is free of charge, and as such, you get what you pay for.
I am not liable for anything that goes wrong while using this software. No warranty, express or implied, is provided. You are free to use this software as you see fit. I reserve all rights and copyrights to this software program, however, and it cannot be sold or packaged in a commercial collection without my express written consent.
Installation
Installation is simple. Unzip the files. You are done.
HarmWave can be run by double clicking on the HarmWave.exe file. The files can be
placed in any folder you like. Keep these three files in the same Folder for the Help menu
item to work. Files included:
HarmWave.exe - program executable
HarmWave.htm - this file, my excuse for a help system
Bkgd.jpg - The background image for the help file. Created with HarmWave, of course.
HarmWave does not use any *.dll files, everything is self-contained. It only updates the registry to change the wallpaper settings, it does put any application-specific information there. To uninstall HarmWave:
Delete files HarmWave.exe, HarmWave.htm, Bkgd.jpg from the directory where you installed them. If you did a test wallpaper, delete the file HarmWave.bmp from your windows directory.
Source Code
I am not a professional programmer. For me, it is a hobby. I have spent a
great deal of time developing this program, but I am not attempting to make any money from
it. It seems like maybe it is just useful enough that others could benefit from it and
enjoy it.
If there is sufficient response from the programming community, I will make the source code available, although it's a mess. Keep in mind, I taught myself, so I'm sure there are many dumb things I did code-wise that serious programmers would scoff at.
If there is sufficient download numbers from the sites where I upload, the next version will include full source free of charge. In the meantime, if you have a question about a specific effect, you can reach me by email at the address above. Or, even better, if you would like to contribute working code for a new effect, I would be glad to include it in the next release.
Credits
The FishEye and Twist transforms were translated and modified from Visual
Basic code written by Rod Stephens. I also modified some of his code for the smooth resize
and Rotate Angle. He's the author of 'Visual Basic Graphics Programming', a great
resource (even if it is VB). I can only hope that he becomes enamored of Delphi and
decides to write a book for that platform.
The Color Noise and Spray effects came from authors that contributed to a Delphi unit called FastBMP, by Gordon Cowie III. FastBMP is an excellent free tool.
The Gradient Bars is an adaptation from a newsgroup post by (I think) Bjorn Ischo. I'm still waiting for his article in the UNDU newsletter.
All other effects and filters are mine.
Using the Interface
The HarmWave window has a toolbar along the top with primitive drawing
tools. By default the paintbrush is selected, with a black Pen color. Along the left side
are the main controls for effects and filters: a treeview control which lists all the
options, which will expand or collapse by clicking the small button with the 'E' caption
(for Expand); a preview area for the gradient and buffer images; an area for user input;
and an Execute button. Some functions are only available from the menus.
NOTE! - I use what I call 'Hacks' to accomplish some things. What may seem like normal windows functions don't work quite the way you would expect. For instance, I am still working on perfecting the Text tool, and the paste as selection function is a little different, but they work for my purposes.
When an item is selected in the treeview, the User Input area will display the controls where you can adjust values. You can test your image as wallpaper by selecting that option under the Image menu.
The fastest way to get started with a new picture:
1. Click the small button labeled 'E' to fully expand the treeview.
2. Double Click 'Gradient' in the Draw section of the tree. This will invoke the Gradient Designer window, where you can select the style and colors for the gradient.
3. Click OK when you have the gradient designed to your tastes. This will copy the gradient into the Image, and it now appears in the Thumbnail window.
You are now on your way to designing (or doodling).
Items in the treeview can be double-clicked to invoke the effect, or single-clicked to expose the controls for that effect. When values have been adjusted, use the Execute button. Clicking the small 'D' button (if visible) in the User Input area will restore the defaults for the current effect.
Some items don't have any user-adjustable values. Others invoke a dialog instead of using the User Input area.
There is one level of Undo. If, after using an effect, you don't like the results, simply use the Undo menu item, or Ctrl/Z to undo the last operation.
Currently, HarmWave only supports BMP and JPG file formats.
NOTE! - The User Input area uses a normal run-of-the-mill edit box for input. I do not verify that a number has been entered. You may experience a program error if you type in something other than a number, or erase the contents and attempt to invoke an effect.
Effects
The effects are grouped into several categories. They are not
alphabetic. Sorry. Some are not perfected. Sorry. Some are not
easy to use, but I'll make an attempt to give an example in those cases. Most are
fairly intuitive, and once you try them they are easy to understand. Some effects
maintain seamlessness, others do not. I will try to mention those in the individual
descriptions below, and how to deal with them. In some cases you may not be trying
for seamlessness, so it won't matter. See the section below on Seamlessness.
Filters
Most of the filters included use a 3x3 convolution. In cases where
there is a 'More' and 'Less' version of the same filter, it means that the 'More' is a
higher intensity of the effect, while the 'Less' does the same thing, but at a lower
intensity.
Filter | Description |
Soften More, Less | Softens rough jagged edges. |
Edge Enhance More, Less | Sharpens edges, adds a touch of brightness to them. |
Edge Emboss More, Less | Full color emboss effect |
Classic Emboss * | Grayscale Emboss |
HiPass | Adds a sharp glow to lines and edges |
Sharpen | Sharpens the image, enhances edges. |
Laplace | Glowing edges, darken everything else. |
Blur | Makes the image a bit fuzzy |
Find Edges | Very dark filter, top down edge finder |
Gaussian Soften | Similar to Blur |
Gaussian Blur * | Will make a very blurry image. |
* Indicates user adjustable values
The filters are mostly self-explanatory. You'll find that after some Distortion operations, one or more of the Filters can make the image look a lot better. Most do not have any user adjustable values, you just invoke them
Distortions
Distortions are the cool effects. They will alter the current image,
shifting the pixels somewhere else. They generally don't change any colors. If
I indicate that a distortion will maintain seamlessness, it pre-suppose that the image is
currently in that state.
SineWave Up/Down *
This was the first distortion I concocted. It will maintain seamlessness, IF:
the wrap checkbox is checked, and the Use Peaks checkbox is checked, and whole
numbers are used for Peaks. This allows great flexibility. A peak is the apex
of a sinewave, either at the top or bottom extremity. Therefore, 3 peaks would have
two waves pointing down, and one wave pointing up. Unchecking the Use Peaks checkbox
allows the user to specify a 'wavelength', and unchecking the wrap checkbox causes the
edge pixels to be 'stretched'.
SineWave Left/Right *
Identical explanation as the previous section, only the waves go left to right.
Maintains seamlessness.
SineWave Both *
This is a mix of the U/D and L/R, but there is no option for using peaks or
wavelength. You may choose how many peaks and their size, but that's all.
Maintains seamlessness.
Twist *
This will twist, or spin the picture in a sort of double elliptic. The
smaller the number, the tighter the spin. Does NOT maintain seamlessness.
FishEye *
This will make the image bulge out from center. Does NOT maintain
seamlessness, UNLESS: the image is a mirror image. See 4Way Flip under
seamlessness.
Circular
This is similar to twist, but it only works correctly on 256 x 256 images. It
will work on other sizes, but not very well. You'll get a warning if your image is
not 256 x 256, but then it will go ahead and execute unless you click Cancel. Does NOT
maintain seamlessness.
Astroid *
This is a messy effect, I haven't perfected it. I almost didn't include it
with this release, but then decided that if people don't like it, they don't have to use
it. Oddly enough, it maintains seamlessness. To get the best results, here's a
hint on how it works: It reads the column of pixels on the extreme left side of the
image, and bases it's pixel calculations on those. A VertCenter gradient works best
to illustrate. To create an interesting border around your image, follow these
steps:
1. when your image is ready for a border, go to the scroll option in the Size/Aspect
group. Use the scrollers to scroll exactly half the image width left, and exactly
half the image height down.
2. copy your image to the clipboard with Ctrl+C
3. design a new gradient. Make it a VertCenter style, with colors that will
complement your image in the clipboard. Make the gradient two pixels wider than your
image in the clipboard. Paste it into the image.
4. use the menu to paste as selection. Watch the title bar, and position the
selection at 1,0 - then release the mouse to paste it.
5. you should now have your original image with a very thin line on each side of the
gradient you designed. Invoke the Astroid effect, works best with a setting of 7.
6. Click the Selection drawing tool. Watch the X Y values, and select a rectangle
starting at x=1 y=0 and going to 1 less than the current image width for X, and the
current image height for y. Choose Crop to selection.
7. Go back to the Scroll tools. Again, scroll exactly half the width and half the
height. Voila! you now have a kind of rounded window around your original
image.
Concentric Rects *
Nothing fancy here. This draws a smaller copy of the current image directly
in the center, repeatedly, until the last rectangle is about half the size of the
original. User input is the number of pixels to decrease the size of each successive
rectangle. Maintains seamlessness.
Mosaic *
Will draw colored squares of the size specified by the user. Maintains
seamlessness.
Circle Mosaic *
Similar to mosaic, but draws circles instead of squares. User input is the
diameter of the circle. Will leave some of the original image visible in the
'cracks' (space between circles). Maintains seamlessness.
Color Noise *
Adds noise to the image by altering random pixels colors. User input changes
the amount of noise. Maintains seamlessness.
Spray *
Scatters pixels, depending on the user input value. Maintains seamlessness.
HarmSwizzle *
This effect takes advantage of the pixel loss for fast resizing (StretchDraw).
You can achieve the same thing by doing the following: Set the Up/Down Sine
Peaks value to match the current image width, and execute. From the menu, do a 4Way
Flip. Then, do a ReSize Fast back to your original image dimensions. I
incorporated those things into one procedure because I found myself doing that sequence a
lot. Maintains seamlessness.
Color Rotate
24 bit bitmaps have their color values stored as separate Blue, Green, and Red
values, each of which can range from 0 - 255. This effect shifts the color bits one
position to the left, with the overflow being added to the right. Since each color
is 8 bits, repeating this effect 8 times will change a mostly blue image to a mostly red
image, and 8 more times will change it to a mostly green image. Maintains
seamlessness.
Negative
Just what the name implies, it will create a negative of the current image.
Maintains seamlessness.
Brighten
Brightens the image. I don't provide for user input, you must execute several
times if you require a lot of brightness adjustment. Maintains seamlessness.
Lighten
Lightens the image. It tends to wash out colors as they get lighter.
Maintains Seamlessness.
Tint *
This invokes a color selection dialog. It tints the entire image to the
chosen color. If it 'erases' the image, try doing a grayscale and then do the tint
again. Maintains seamlessness.
GrayScale *
Changes to grayscale image. Maintains seamlessness.
Erase to Black
Fills the image with black. To get other colors, use this, then the FloodFill
tool with your selected brush color. You can probably figure out about the
seamlessness part here.
Size/Aspect
ReSize Fast *
Invokes the Sizer dialog. It uses Windows StretchDraw to do the resize, which
tends to add or drop pixels. Sometimes that's what you want. For a more
accurate resize, use smooth. Might maintain seamlessness.
ReSize Smooth *
Invokes the Sizer dialog. Uses a resampling method to resize. It looks
better, but performance is a bit slower. Maintains seamlessness.
Rotate 90
This rotates the image 90 degrees clockwise. To rotate an image 90 degrees
counterclockwise, do this 3 times. Maintains seamlessness.
Mirror Left/Right
This flips the image so the left side is now on the right. Maintains
seamlessness.
Mirror Up/Down
This flips the image so the top is now on the bottom. Maintains seamlessness.
Rotate Angle *
Rotates the image, wrapping pixels (instead of resizing the image), to the angle
specified. Does NOT maintain seamlessness.
Rotate Seamless
Rotates the image by 45 degrees, and will maintain seamlessness IF: the image
is a square. If the image is not a square, seamlessness is NOT maintained.
Shrinks the image somewhat.
Scroll *
This exposes the scrollers in the user input area. Clicking the arrows will
scroll the image by the amount specified. Hold down the arrow to repeatedly scroll.
Maintains seamlessness.
Cycloid Mosaic *
A flaky kind of effect, it draws a pattern of squares (or dots, depending on user
input). Maintains seamlessness.
Gradient Bars *
A different kind of gradient, it draws vertical bars of gradient. The number
of bars is user specified. The gradient colors are the current gradient colors.
Maintains seamlessness. To draw horizontal bars, use this, then do a rotate
90.
Gradient
Invokes the gradient designer dialog. When the gradient is designed, it
automatically pastes it into the image. Depending on the gradient, will maintain
seamlessness. VertCenter, HorizCenter, Rectangle, and Elliptic are seamless
gradients.
Merge Gradient *
Will merge the gradient with the current image. User specifies percentage of
gradient to merge. Maintains seamlessness IF: both the gradient and image are
seamless.
Merge Buffer *
Will merge the current buffer with the current image. User specifies
percentage of buffer image to merge. Maintains seamlessness IF: both the
buffer and image are seamless.
Buttonize *
Kind of a lame effect, draws a Highlight and Shadow on the image, width specified
by user. The current Brush color is used for the Highlight, and the Pen color is
used for the Shadow. Does NOT maintain seamlessness.
Drawing Tools
The drawing tools are available from the top toolbar. Because of
their nature, none maintain seamlessness. The tools are as follows:
Pen - Draws freehand style using the current Pen Color, Pen Width, and Pen Mode. Is actually a series of lines, so looks kind of jagged. Compensate by doing a blur or soften.
Ellipse - Draws ellipses by clicking and dragging to desired size, using current Pen Color and Width. If the Fill Shape checkbox is checked, then the ellipse is filled with the Brush color. Ignores Pen Mode.
Rectangle - Draws rectangles by clicking and dragging to desired size, using current Pen Color and Width. If the Fill Shape checkbox is checked, then the rectangle is filled with the Brush color. Ignores Pen Mode.
Line - Draws a straight line using current Pen color, width, and mode.
Flood Fill - Click an area to fill it with the current Brush color.
Text - Click anywhere on the image to invoke the Text Designer dialog. After the text is the desired font, size, color, etc. click OK and then drag the text to the location you desire, then click to drop it. This tool is still kind of flaky, the X and Y values don't accurately reflect the left and top of the text.
Selection Tool - Click and drag to outline a part of the image. When the mouse is released, the selection dialog is invoked. You can copy the selection to the clipboard or buffer, or crop the current image to the selection.
Fill Shape checkbox - when checked, ellipse and rectangles will be filled with the brush color. Otherwise, they are 'hollow'.
Pen Size - allows user to specify width of pen.
Pen and Brush Color - Clicking these buttons invokes a color dialog to specify a new color.
X and Y values - These provide feedback to the user on where the cursor is when mouse
is over the image.
Gradient
The gradient designer is used to control the type, colors, and size of the gradient. While it's not necessary to use a gradient, they do make nice backgrounds. Some gradients are seamless, others are not. Seamless gradients are: VertCenter, HorizCenter, Rectangle, and Elliptic. The other gradients are Vertical, Horizontal, Radial 1, and Radial 2. If you are not concerned about seamlessness, these are OK too. Or, you can compensate by doing a 4Way flip or seamless operation. The current gradient always shows in the preview window.
The buffer is used to store an image for later use. It is always visible in the preview window. You can copy the current image to the buffer, or load it from a file. You can merge the buffer with the current image, or paste it into the current image. It rates its own menu item.
Seamlessness
Making an image seamless is not an easy task. A lot of the effects
here will maintain a seamless image, but what about an image that's not already there?
I have a couple of methods to help with this situation, but neither is foolproof.
They are accessible from the Image Menu item, under the Seamless submenu. The
first is Edge Merge. It copies opposing edges and blends them in to the right and
bottom. It will copy 1/16, 1/8, or 1/4 of the image for blending. The other
method, 4 Way Flip, re-sizes the image. It copies the image and mirrors it
left/right, up/down, and l/r/u/d. The image ends up being twice as big, but for
pattern type images it works well. Use the ReSize to get the image back to its
normal size, or crop out the piece you want. If your image has an unwanted border,
use the selection tool to crop the image and then use the edge merge method.
NOTE! - To use your image as a web page background, you may want to 'dim it down' so the text is legible. Here's the technique I use: Once you have an image, save it in the buffer. Erase to Black the image. Do a Negative to make it all white. Then, merge the buffer by 25 % or less. This makes a very light image. Or, you can make the text of your web page white or some other light color to show up against a dark background image.
Finally, a brief word about the menu items.
File: Open, Save, and Exit.
Edit: UnDo (one level of undo only), Copy (to Clipboard as BMP), Paste - either as a
draggable selection or the nomal paste, and a Reset. Reset will paste the original image
or gradient back into the image.
Gradient: Design invokes the gradient designer (does not paste automatically), Paste
will copy the gradient from the designer to the image, and Merge will merge the gradient
using the current settings.
Buffer: Copy will copy the current image to the buffer. Paste will paster the
buffer to the image. Merge will merge the buffer with the image using the current
settings. Load buffer from file will invoke the Open picture dialog.
Image: Test Wallpaper will save the current image in the Windows directory as
HarmWave.bmp, then set it as the windows wallpaper. It then minimizes all top-level
windows so you can get a good look at it. * Does not work if you are using Active
Desktop. Seamless has submenus for adjusting the image to be seamless. See the
Seamless topic for details.
Effects: Is a mirror of the treeview structure. Selecting an item here
executes the effect using the current settings.
Pen: Sets the Pen mode for freehand drawing and lines. Most of the available
windows pen modes are available.
Help: Has the About box with a HarmFade, and a bit of information. Help
*should* start your default browser and open this file.
None. I'm sorry, but I'm not making any money from this effort, so I don't get paid to support it. If you are really stuck using this, I might answer your email. If you discover a bug, I will try to address it, but I can't guarantee a fix. I am always open to suggestions, but like I said I am not a professional programmer and I may not know how to implement your ideas or have time or inclination to do so. You can always try, though, by sending me an email at the above address. Please, no criticisms. I know this program has severe shortcomings - if you don't like it, simply delete the files and forget about it. Otherwise, I hope you enjoy this and find some use for it.