<<< Home << Web < Arithmetic Top Bottom Next >

Image Arithmetic
Introduction

A Little About Image Arithmetic

Image arithmetic (IA) was a very useful tool back in the days of PSP version 4. Layers were implemented in PSP 5, and these provide many of the capabilities of IA in a much more friendly user interface. JASC no longer considers IA to be very important. While later PSP versions still provide the image arithmetic facility, the IA user interface remains unchanged from PSP 4 and lags far behind the usability of other features.

Before IA can be really useful, JASC needs to improve the user interface. The following features are needed to bring image arithmetic up to the same usability as other capabilities of PSP:

I've suggested these changes to JASC. They thanked me for my suggestion, but informed me that very few people have requested improvements to IA and they don't consider it worth their while. So I expect that IA to remain in the stone age era of PSP tools.

A Little About Color

Back in childhood, I was taught that there are three primary colors: red, blue and yellow. These can be combined to form the various other colors. When you mix them all together, you get black.

Well, that's true on paper where you have an opaque background. On the screen, it turns out that the primary colors are red, green and blue. Don't ask me why this is, it just is. And when you combine them all, you don't get black anymore. You get white.

In computers, each of the possible colors is represented by a red value, a green value and a blue value. Each of these is a value ranging from 0 through 255. Why 255? Well, that's just an accident of the binary numbering system used in computers, and 256 is a magic number. It's the number of values you can store in one byte. Instead of numbering them 1 through 256, they're numbered 0 through 255.

Within this tutorial, I usually refer to the color values in decimal using the notation (20,200,108). This represents a color with a red value of 20, a green value of 200 and a blue value of 108. If you've ever heard the term RGB you can easily remember this order: Red, Green, Blue.

Occasionally, I will need to refer to the color values in hexadecimal instead of decimal. When I do, I'll write it like this: x14c86c. The x in front of the value clues you in that this is a hexadecimal number (you might think x506438 was a decimal number without the x in front). In hexadecimal, each digit represents a value between 0 and 15. The digits 0-9 are used for 0-9, and the letters a-f are used for 10-15. It turns out that ff represents the value 255, so the entire range 0-255 can be expressed with two hexadecimal digits.

Types of Arithmetic

Most of the arithmetic functions in PSP are easily recognized. For example, addition simply takes two color values and adds them together: (14,30,28) + (20,50,10) = (34,80,38). Note how three separate additions took place: one each for the red, green and blue components.

These are the arithmetic functions that Paint Shop Pro provides:

Add Addition
Average Add then divide by 2
Subtract Subtraction
Difference Absolute value of subtraction
Multiply Multiplication
Lightest Choose the lightest value
Darkest Choose the darkest value
AND and OR Hexadecimal bit manipulation functions

About This Tutorial

Back in the days of PSP 4, I spent quite a bit of time playing with image arithmetic. The information presented in this tutorial has been gathered by trial and error. I hope most of it is accurate, but be aware that it's based on my observations and does not come from any "official" source.

For each of the arithmetic functions, I have attempted to describe a bit about how PSP goes about performing the function. I then show a few examples of how I've used the functions.

I hope you find this tutorial useful. I also hope you find it enjoyable.

<<< Home << Web < Arithmetic Top Bottom Next >