<aid="bitmap-vector"name="bitmap-vector">BeOS bitmap vs. Haiku vector icons</a></h1>
<p>Contrary to the BeOS, Haiku uses vector icons instead of bitmap icons. A special Haiku Vector Icon Format (HVIF) was developed that is highly optimized for small file sizes and fast rendering. That's why our icons are for the most part <i>much</i> smaller than either a bitmap or the widely used SVG format. Also, unlike BeOS' bitmap icons, Haiku isn't limited to an 8bit palette (256 colors).<br/>
<p>Note that the BeOS used two versions of an icon, one 16x16 and 32x32, to achieve good visuals in List and Icon View mode.</p>
<p>This trick isn't needed with vector icons. Besides only taking up a few hundred bytes in a file, vector icons also scale much better than bitmaps. (Note: BeOS offered only a 16x16 and 32x32 display.)</p>
<aid="icons-attributes"name="icons-attributes">Icons are attributes</a></h1>
<p>Icons are stored as an attribute with their file. However, that doesn't mean that every file has to have this attribute to appear with an icon in a Tracker window: data files inherit their icon from their filetype. To globally change the filetype's icon you use the <spanclass="app">FileTypes</span> preferences. If you only want to add a special icon to an individual file, you use the <spanclass="app">FileType Add-On</span> on it instead. See topic <ahref="../filetypes.html">Filetypes</a> for more information.</p>
<divclass="box-info">Being an attribute, it follows that only filesystems supporting metadata can retain a file's individual icon. So, if you move files off your BFS volume, consider zipping them up so you don't lose icons or other attributes.</div>
<aid="i-o-m"name="i-o-m">Creating icons with Icon-O-Matic</a></h1>
<p>Icon-O-Matic is Haiku's icon editor that can save your work as HVIF, SVG or PNG. The icon can also be directly attached as attribute to an existing file or exported as a resource or source file used by developers. Since the application was tailored to the optimized HVIF format, its usage reflects the inner workings of this format.</p>
<p>Other than your normal vector graphics software, you don't deal with separate objects that each include all their specific properties like path, stroke width, stroke and fill color etc. Rather, you assemble your objects ("shapes") from shared paths and colors ("styles") and set certain properties. This re-using of elements is one secret of HVIF's efficiency. Although that imposes some constraints on the icon designer, there are a few advantages, too.<br/>
For example, by re-using a path, several objects can be modified together by manipulating this one path. Think of an object and its shadow. Modifying their shared path will change the object itself and automatically its (maybe slightly distorted/translated) shadow.</p>
<p>Here's a quick overview of Icon-O-Matic's window:</p>
<p>To create any visible object on the canvas, you need a shape with a path and a style. Conveniently, you can create one, two or all three of those together from the <spanclass="menu">Shape</span> menu. Every kind of object (Paths, Shapes, Transformers, and Styles) has a menu above its list of elements, offering various commands. Every element has certain options that are set in the <spanclass="menu">Property</span> view.</p>
<p>A path consists of several points which are connected with lines or Bezier curves. To add or change points, make sure, the path is selected in the path list.</p>
<p>Simply clicking in the canvas will set the first point. While setting a point, you decide if the resulting line will be straight or curved: a simple click and release produces a straight line, holding down the mouse button and moving the mouse will drag out the handles for a Bezier curve. Of course, you can also change it all later on.</p>
<p>To get from "A" to "B", you have to transform some points from corner-points to curve-points. That's done by holding <spanclass="key">ALT</span> while clicking on a point and dragging out the handles. This results in a symmetrical Bezier: the second handle follows the movement of the other. If you need to move the handles independently, again click&drag on a Bezier handle while holding <spanclass="key">ALT</span>.<br/>
Vice versa, to go from Bezier to a corner-point, hold <spanclass="key">ALT</span> and click on a point.</p>
<p>To move a point, simply click&drag it. To select more than one point, hold down <spanclass="key">SHIFT</span> and draw a selection rectangle. Selected points are marked with a red border instead of the usual black.<br/>
To insert a point into a path you click on the connecting line between two points.<br/>
Selected points are deleted by pressing <spanclass="key">DEL</span> or by clicking on any point while holding <spanclass="key">CTRL</span>.</p>
<p>The mouse pointer indicates the current mode:</p>
<tr><tdclass="onelinetop"><spanclass="menu">Select all</span></td><tdwidth="70"><spanclass="key">ALT</span> <spanclass="key">A</span></td><td>Selects all points of the current path.</td></tr>
<tr><td><spanclass="menu">Transform</span></td><td><spanclass="key">T</span></td><td>Puts all selected points in a transformation box, so you can move, resize and rotate them together. It works just like with shapes, described a bit further down.</td></tr>
<tr><td><spanclass="menu">Split</span></td><td></td><td>Splits selected points into two, one sitting on top of the other.</td></tr>
<tr><td><spanclass="menu">Flip</span></td><td></td><td>Rotates selected points by 180°. Only has an effect on Bezier points.</td></tr>
<p>The <spanclass="menu">Path</span> menu offers a few obvious entries to <spanclass="menu">Add Rectangle</span> and <spanclass="menu">Add Circle</span> or to <spanclass="menu">Duplicate</span> or <spanclass="menu">Remove</span> a path. Here are some that may need a bit more explaining:</p>
<tr><td><spanclass="menu">Reverse</span></td><tdstyle="width:15px;"></td><td>If your path isn't "closed" (see Path Properties below), a click into the canvas always creates a new point, connecting it with the last one. "Reverse" will reverse this order and your new point will connect to original start point instead.</td></tr>
<tr><td><spanclass="menu">Clean Up</span></td><td></td><td>Most useful with imported SVGs, this function will remove redundant points.</td></tr>
<p>The <spanclass="menu">Property</span> at the bottom left of the window offers all available settings of the currently selected object. A path only has two: a <spanclass="menu">Name</span> and if it's <spanclass="menu">Closed</span> or not.</p>
<p>A shape groups together one or more paths with a style. Practically, it's the object that you'll actually see on the canvas. The grouping is done with the checkboxes in front of the paths and styles: Just select your shape and tick off the desired path(s) and a style.</p>
<p>A shape defines how a path and style is applied, e.g. if the object is filled or only stroked (which is done by using Transformers on the shape, we'll get to that later). Also, a shape can be moved, rotated or resized without touching the used path. That way, you can re-use a single path and get different, but related, shapes.</p>
<p>When a shape is selected from the list, a rectangle is drawn around it. Depending on where exactly you grab it, the shape is moved, resized or rotated around a point in its center, which itself can be moved. Holding <spanclass="key">SHIFT</span> will lock direction when moving, limit resizing to 45° angles and restrict the aspect ratio while resizing. The mouse pointer again indicates the current mode:</p>
<p>Shapes lie on top of each other, each is on its own layer, if you will. To reorder them you drag&drop their entry to a different position in the list.</p>
<p>The <spanclass="menu">Shape</span> menu offers the before mentioned possibility to <spanclass="menu">Add Empty, With Path/Style/Path&Style</span> and to <spanclass="menu">Duplicate</span> or <spanclass="menu">Remove</span> a shape. Then, there is:</p>
<tr><td><spanclass="menu">Reset Transformation</span></td><tdstyle="width:15px;"></td><td>Reverts all the move, resize and rotate transformations you have applied to the shape.</td></tr>
<tr><tdclass="onelinetop"><spanclass="menu">Freeze Transformation</span></td><td></td><td>When you transform a shape, its assigned path(s) stay in their original position. This may be intended; maybe more than one shape is using that path, maybe you intentionally used <spanclass="menu">Options | Snap to Grid</span> to set the points at precise pixel borders.<br/>
If not, "Freeze Transformation" will apply the current shape transformation to the assigned path(s). A future "Reset Transformation" will then return to this new state.</td></tr>
<tr><td><spanclass="menu">Rounding</span></td><tdstyle="width:15px;"></td><td><i>Unfinished feature</i>. Once working correctly, it will do a kind of "hinting" for vector paths, rounding their coordinates to the next full pixel, giving it a crisper look.</td></tr>
<tr><td><spanclass="menu">Min LOD</span></td><td></td><td>Minimum Level of Detail</td></tr>
<tr><td><spanclass="menu">Max LOD</span></td><td></td><td>Maximum Level of Detail</td></tr>
</table>
<h4><aid="i-o-m-shape-lod"name="i-o-m-shape-lod">Level of Detail (LOD)</a></h4>
With the LOD you control the visibility of a shape depending on its size. That way, you can leave away details of an icon that look good on a bigger icon, but maybe not so much on its smaller version.</p>
<p>This is how it works: A LOD of 1.0 is defined as a 64px icon size. To get the LOD of a particular icon size you simply divide it by 64, e.g. a 16px icon has a LOD of 16/64 = 0.25. A shape won't be visible below its <spanclass="menu">Min LOD</span> and above its <spanclass="menu">Max LOD</span>.</p>
<p>So, if you set a shape's <spanclass="menu">Min LOD</span> to 0.0 and the <spanclass="menu">Max LOD</span> to 0.5, this means that the shape will only be visible for icon sizes smaller or <i>equal</i> to 32px. If you wanted to exclude the 32px icon size, you'd have to stay below 0.5, say 0.49.</p>
<p>The LOD is not only for leaving out detailing shapes, but also to e.g. change the stroke width at different sizes, if you feel that's needed. Simply duplicate a shape, make your changes and set both of their LOD settings to show either one or the other. Here lies the only source of potential confusion, when you unwittingly overlap LODs of shapes, and wonder why at some size both are visible...<br/>
<p>A style can either be a solid color or some type of gradient.<br/>
Besides the predefined colors under <spanclass="menu">Swatches</span>, you can mix your own by clicking on the current color. Also, note the slider under the color spectrum which sets the alpha-channel (transparency).</p>
<p>You quickly create a new style by mixing your color and simply drag&dropping it into the list of styles.</p>
<p>If you go for a gradient, you set the type (<spanclass="menu">Linear</span>, <spanclass="menu">Radial</span>, <spanclass="menu">Diamond</span>, <spanclass="menu">Cone</span>) and then define the start and end colors. This is done with a drag&drop from a color bucket into the respective color indicator under the gradient.<br/>
Of course you can move these indicators to change the gradient to your liking. You can also insert more indicators to add more colors by double-clicking into the gradient. Pressing <spanclass="key">DEL</span> removes the selected indicator.</p>
<p>The <spanclass="menu">Style</span> menu offers the usual entries to <spanclass="menu">Add</span>, <spanclass="menu">Duplicate</span> or <spanclass="menu">Remove</span> a style and to <spanclass="menu">Reset Transformation</span>.</p>
<tr><td><spanclass="menu">Transformation</span></td><tdstyle="width:15px;"></td><td>Offers the same move/resize/rotate options you have by manipulating a shape with your mouse directly.</td></tr>
<p>Besides a <spanclass="menu">Name</span> and the actual <spanclass="menu">Width</span> for the transformer, the <spanclass="menu">Property</span> view has these (depending on its type slightly differing) options:</p>
<tr><td><spanclass="menu">Caps</span></td><tdstyle="width:15px;"></td><td><i>Stroke only</i>. Defines the end caps of a line: <spanclass="menu">Butt</span>, <spanclass="menu">Square</span> or <spanclass="menu">Round</span>.</td></tr>
<tr><td><spanclass="menu">Detect Orient.</span></td><td></td><td><i>Contour only</i>. Makes sure the contour always extends outwards when you have self-intersecting paths.</td></tr>
<tr><td><spanclass="menu">Joins</span></td><td></td><td>Defines how lines are joint at a point: <spanclass="menu">Miter</span>, <spanclass="menu">Round</span> or <spanclass="menu">Bevel</span>.</td></tr>
<tr><td><spanclass="menu">Miter Limit</span></td><td></td><td>Only when the above <spanclass="menu">Joins</span> is set to "Miter" this setting influences the looks of the miter joint. </td></tr>
<aid="i-o-m-save"name="i-o-m-save">Saving an icon</a></h2>
<p>There's your usual menu bar at the top, <spanclass="menu">File</span>, <spanclass="menu">Edit</span>, <spanclass="menu">Options</span>. The usage is pretty much self-explaining, so we'll only look at how to save your work.</p>
<p><spanclass="menu">File | Save As...</span> will save in a special Icon-O-Matic format that retains additional information like the names of paths, shapes and styles. These will be stripped from the actual icon once you export it to save space. It's a good idea to back-up your work like this, because without named objects everything's named "<path>/<shape>/<style>" which makes specific changes tedious.</p>
<p><spanclass="menu">File | Export As...</span> opens a familiar save panel with a file format dropdown menu at the bottom, offering these choices:</p>
<p>A few things you should keep in mind when working with Icon-O-Matic and some general tips for its usage:</p>
<ul>
<li><p>Read the <ahref="http://factory.haiku-os.org/documentation/icon_guidelines/">Icon Guidelines</a> to learn about important characteristics of Haiku icons, e.g. perspective, colors and shadows.</p></li>
<li><p>You should always try to minimize your use of paths, those are the most expensive, file size wise. Re-use paths wherever possible and work with manipulated shapes and their transformers instead. Smart use of gradients can also save space.</p></li>
<li><p>Wherever possible, you should activate Snap-to-Grid from the <spanclass="menu">Options</span> menu when editing paths. Path points that align with the 64x64 pixel grid use less storage space. You'll also get the crispest look if points are set on exact pixel borders. For example, it is important to align the most prominent outlines with the 16x16 grid.</p></li>
<li><p>Check the preview to see if your icon still looks good in 16x16. You may want to use the <ahref="#i-o-m-shape-lod">Level Of Detail</a> settings described in the Shapes section.</p></li>
<li><p>There's an easy way to produce letters, even if Icon-O-Matic doesn't provide such a tool. Just enter the text in a text editor such as StyledEdit, adjust font type and style, and drag&drop or copy&paste the selected text into Icon-O-Matic. This will create the according paths and shapes.</p></li>
<li><p>If you assign more than one path to a shape, their overlapping areas will cancel each other out. When one path is completely inside another, it practically creates a hole in the resulting shape.</p></li>
<li><p>You can zoom in and out of the canvas with the mouse wheel. Panning is done either by click&drag with the middle mouse button or with a normal left-click&drag while holding <spanclass="key">SPACE</span>.</p></li>
<p>The above is of course quite theoretical. The best way to learn using Icon-O-Matic is by experimenting. To get you started and once more show the basics, have a look at these short clips:</p>