# Using &krayon;

## &krayon; Basics

To get you started right away using &krayon;, this tutorial will guide you step by step in making a finished image. Beneath each step in this tutorial is a note. This note will explain what the previous step in the tutorial accomplished.

A red rectangle will outline on each screenshot the object you will need to push, change, click, etc. for the given step.

### Creating a New Image

When you first start &krayon; (or start a new document after &krayon; is running), it displays a Choose dialog. You can choose to create a new image from scratch or from a template, or open an existing image.

Choose Dialog

This dialog box is used to:

1. To select the initial template for your new document

2. Open a &krayon; image saved to your hard drive or network.

3. Start &krayon; with a new image.

Step 1: Click on the Start with an empty document radio button. Then click on the OK button.

New Image Dialog

This dialog box is used to select the size, color mode and default background color of a new image

Step 2: All of the defaults in the New Image dialog are sufficient for our needs. Click on the OK button.

### Next Steps

&krayon; isn't quite ready for the bigtime yet. When it gets a bit more complete, this tutorial will proceed to use at least one tool/function from each general category.

## &krayon; Concepts

Image processing programs are centered around some concepts that might not be immediately obvious to the new user. These concepts are central to understanding &krayon; as well as image processing in general. This section will explain these concepts.

### Colors

Computers see colors differently than the human eye does. To a computer, everything is a number. When using a computer to manipulate colors the human user must model colors in a way that the computer can understand. There are several color models common to image processing.

Indexed Color

The most common color model is the indexed color. Indexed, or mapped, colors have an index from one color representation to another. As an example, on the X Window System, the word HotPink is mapped to the color value #FF69B4. In a similar way, an `XPM` image uses a discrete number of colors mapped onto the full range of the system colors.

Indexed colors are useful when dealing with a small number of colors. They become unwieldly when dealing with a large number of colors however. Modern display hardware is capable of displaying 16 million different colors.

RGB Color

The RGB color mode can easily represent the full range of colors on a computer monitor. RGB stands for red, green, blue. RGB is an additive color model,since the values for the red, green and blue component values are added together to derive the final color. Each of these components can have 256 different values. This results in 16 million different colors representable by the RGB model.

Color that comes from light behaves differently from color that comes from pigments. When you mix red and blue paint, you get purple paint. But when you mix red and blue light, which is what your computer monitor is doing, you get the color magenta.

CYMK Color

Printers and publishers do not use RGB or other additive color models, since they are using pigments instead of light. They use subtractive color models instead. If you were to break open an ink cartridge for a color printer (please don't do this, it's messy), you will find four different colors, cyan, magenta, and yellow. The CYMK color model uses these three colors, plus black (the K stands for black), to represent the same colors as the RGB model.

HSB Color

The HSB color model stands for hue, saturation and brightness. Sometimes this model is called HSV for hue, saturation and value. Hue describes the color on the spectrum, from red to indigo. Saturation describes how intense the color is. The lower the saturation value is, the duller the hue. Brightness and value describes how bright the color is. A color with zero brightness would be black, while one with the maximum brightness would be very light. If saturation is zero and the brightness set to maximum, the resulting color would be white.

Grey Color

&krayon; also includes a Grey color mode. Grey color ranges from black to white in shades of pure gray.

### Brushes, Patterns and Krayons

Just as color modes are analogous to a painter's palette in &krayon;, brushes, patterns and krayons are analogous to a painter's brushes and palette knives. The give the shape to the colors you paint.

A brush in &krayon; is the shape of the drawing tool being used. The painting tools include the Pen, Brush, Airbrush, and Eraser tools. There is a clear distinction between the Brush tool and the selected brush.

Just as real life bristle brushes can be round, flat, pointed or feathered, the brushes in &krayon; can have different shapes. These shapes are represented by gray scale images which you can select on the Sidebar. When you choose a round brush with a fuzzy edge from the Sidebar, then the lines and strokes you draw in &krayon; will be rounded with fuzzy edges.

Patterns are used with the Stamp tool to stamp patterns onto the image. Patterns come in a variety of shapes and sizes, and they can have colors, unlike brushes which are only grayscale.

Brushes

### Layers

Layers are a very useful concept in &krayon;. Newly created images only have one layer, but you can create more.

You can think of them as a stack of glass sheets. When you paint onto the top sheet of glass, none of the lower sheets are affected, yet when you look down on the stack, you perceive only one image. Layers work in the same way. If you create a new transparent layer on top of your image, you can paint on that layer without worrying about it affecting the underlying image. You can also move areas of a layer around while the other layers are untouched.

You control the layers of your image through the Layer menu and the Sidebar. Layers can have different levels of opacity, or transparency. You can rearrange and hide them. You can link layers so that they can be manipulated together. And you can give your layers names to help keep track of them. The first layer of a new image is called background by default.

An especially useful layer operation is to merge layers. This combines two or more layers into one layer. You can merge all layers, just the visible layers, or just the linked layers. As an example, you could do some photo touchups on a layer, and when you were satisfied merge the layer into the original image.

Layers

### Channels

TODO: When channels is working better, play around with it to see exactly how it works

TODO: also explain the concept of alpha channel

Channels

### Effects

TODO: No effects yet...

### Filters

TODO: no filters yet... Assuming that there will be some...

### File Formats

&krayon; uses the `KRA` image file format (which stands for &krayon;) as its native file format. Most image formats only store a flat image, meaning that only one layer of data is saved. `KRA` images are not flat, and the image layers and channels are stored in the `KRA` file. It is a good idea to save your images to the `KRA` format if you plan to edit or modify them later with &krayon;.

&krayon; can import from, or export to, other image file formats. These formats include `GIF`, `JPEG`, `PNG`, `PNM`, `TIFF`, `XPM`, X Window System bitmaps, &Microsoft; &Windows; bitmaps, encapsulated &PostScript;, and g3 fax images. The precise list of formats that &krayon; will support depends on the &kde; and &Qt; libraries. For example, some distributions of the &Qt; library are not compiled to support the `GIF` file format. If this is the case for you, then you would need to compile `GIF` support into &Qt; in order for &krayon; to be able to use `GIF` images.

TODO: discussion on the various formats and how they differ from each other.

## &krayon; Tools

Tools are the controls you use to manipulate the working image. They include the items on the tool bars and on the sidebar. Menus are also tools, but they will be covered in TODO: section Commands.

### Paint Tools

The paint tools are used to draw on the image. You can think of them as your collection of paint brushes. You can use them to touch up parts of an image, or to draw a new image from scratch. The differences between the paint tools is best seen by simply using them. Drawing the same simple figure with each of the paint tools using the same color and brush with readily demonstrate their differences.

The pen tool Pen Icon draws sharp edged strokes. It is similar to drawing with a pen or pencil. The pen tool will only draw with the selected color. It will not draw in shades of the selected color. If you choose a brush with fuzzy edges, it will still draw with sharp edges.

The brush tool Brush Icon draws strokes just like the pen tool, but it has fuzzy edges. You can think of it as analogous to a a paintbrush. Although the pen tool uses the selected color to draw with, it also uses the alpha channel of the brush, so that it will appear to be drawing in shades of the selected color.

The airbrush tool Airbrush Icon draws with the selected brush but with a spray effect. It is very similar to drawing with a real airbrush. If you click the mouse once with the airbrush, you will get a few scattered dots. If you click some more in the same spot, or hold the mouse button down, more dots appear, until the shape of the brush becomes apparent. If you keep holding the mouse button down you will eventually get a stroke identical to the brush tool.

The eraser tool Eraser Icon works just like the brush tool, but instead of drawing onto the image with the selected color, it erases any color on the image it draws over. Like the brush tool, the alpha channel of the brush is preserved.

The pen, brush, airbrush and eraser tools all draw using the brush and spacing selected from the sidebar.

The gradient tool Gradient Icon allows you to fill areas with a gradient. The gradients used can be selected and edited from the sidebar.

TODO: Gradient isn't working fully now, so finish this up when it is

The filler tool Filler Icon fills an area with the selected color, pattern or gradient. All contiguous areas of the same color will be filled. For example, you can draw a blue circle with the pen tool, then use the filler tool to fill the inside of the circle with red.

### Selection Tools

The selection tools allow you to define regions in the image. These regions, or selections, can then be moved, cut or copied. There are different tools for selection, and each is suitable for a different kind of region.

The rectangular select tool Rectangular Select creates rectangular regions. You click the tool on one corner of the desired region and drag to the opposite corner, to create a rectangle.

The elliptical select tool Elliptical Select creates oval or circular regions. Click on the image and drag the mouse to create an elliptic area. If it is hard for you to get a region in the right place, imagine a rectangular box surounding your desired oval, then click in one corner that that rectangle and drag to the opposite corner.

The polygonal select tool Polygonal Select lets you draw irregularly shaped regions. Click the mouse with the left button anywhere along your desired region. Move the mouse a ways along the perimeter of the region and click the left button again. A line will be formed joining the two points. Keeping clicking the left button around the perimeter of your desired region. To finish you polygonal region, click the right mouse button and the last point will be automatically connected to the first point.

The contiguous select tool Contiguous Select is not working.

TODO: I'm not quite sure what this tool will do. I assume that it will be similar to the magic select used by many paint programs. But exactly how it will work is unknown. I'm leaving this section undone for now.

### Miscellaneous Tools

The move tool Move Tool moves the individual layers of the image. If your drawing on the top layer is not quite aligned with the drawings on lower layers, then the move tool can be used to adjust the top layer.

The zoom tool Zoom Tool

The color picker Color Picker

### The Sidebar

Elements of the sidebar