
One of the bright innovations nanoCAD 4.5 - is working with raster images. What is it? What for? And what gives users? Let's try to figure it out ...
What is fuss about? Raster vs vector
Before telling you about the “goodness” of the raster editing functions in nanoCAD, you need to dive a little into the basic concepts - the world of a raster and a vector.
I think that the difference between raster and vector should already be clear to any modern person. This difference is best illustrated by the image shown in Fig. one.

. 1. ()
A vector is a mathematical description, a raster is a set of points. If you paint the difference in more detail, a lot of details (pluses / minuses?) Will pop up. Try to answer the following questions: how easy is it to make changes to the vector and to the raster drawing: to mirror, change the line type, its thickness? Is it easy to enlarge a drawing three times? What size does an A0 format drawing take in a raster format? .. It is clear that vector drawing is much easier to edit.
')
And the raster seems to have a lot of flaws; it seems that the vector format is more promising ... But there is a raster and several undeniable advantages. For example, the complexity of making changes to a raster drawing is at the same time a plus: imagine that you have finished working on a drawing and you need to protect it from changes. Equipment drawings are often stored on manufacturers' websites in raster format. And finally, it is easiest to scan a printed drawing back to a computer, and scan copy is a raster ... Precisely because of the ease of transferring paper drawings to electronic format using a scanner and due to maximum correspondence of the copy to the original, drawing archives are created in enterprises in raster format.
In general, raster is one of the storage formats for working documentation. And that means you need to be able to work with him. But raster raster discord ...
A little bit about the quality of the bitmap
A raster has a fundamental characteristic that directly influences its quality — resolution. Considering that a raster image is a collection of points, the answer to the question “How many raster points fit in a certain segment?” Is the resolution of the raster. Per section usually take an inch. A resolution of 300 dots per inch (dot per inch or dpi) means 300 dots per 2.54 centimeters. A resolution of 72 dpi is terrible, it’s impossible to work with it, 1200 dpi is generally a good full-color image with very high quality. An example of the same image with different resolution is shown in Fig. 2

. 2.
If we talk about drawings in raster format, then for work it is desirable to have a drawing with a resolution of 300-600 dpi. Less - vectorization and bindings will not work correctly, more - redundant, the drawing will take up too much space in memory and on the hard disk.
Not less important characteristic of the drawing in raster format is the color of the image. Let's look at pic. 3

. 3. grayscale
The image on the left is only one color - black (white is the background), that is, the image is monochrome. It absolutely correctly conveys most of the standard drawings. With vectorization, working with a monochrome drawing is much easier - unlike the drawing shown in the same drawing (on the right) with shades of gray. When there are half tones in the image, it is very difficult to programmatically determine which point belongs to the line, and which is the background.
The latter requires clarification. Along with the concept of raster quality, there is also the concept of drawing quality. If the drawing is printed out and scanned immediately, it will have a high enough quality. Such a drawing protein requires minimal quality improvement tools. But if copies were taken from the drawing several times, he was lying in storage for a long time, his paper turned yellow and deformed - the quality of the drawing starts to get lost. And if the used drawing is very old and is a copy on photosensitive paper (blue), then restoration is not enough (fig. 4, drawings are taken from the site
RasterArts.ru and from
Wikipedia ).


. 4. – -
During restoration, many methods are used - from removing the background (that is, actually removing raster spots of a certain size) to binarization, in which a certain color is highlighted in a separate monochrome image. With all these methods, the software products of the Raster Arts series are superbly managed (for those interested, we recommend
www.rasterarts.ru , where the entire series is presented in full detail). The main task of the restoration tools is to save the old paper drawing, translate it into electronic format and archive it, providing an information card.
And then you need to work with these raster drawings and release new documentation on their basis. Here is a set of such tools that appeared in nanoCAD 4.5 ...
A set of nanoCAD 4.5 tools for working with raster drawings
So, in one way or another you have received a raster drawing: either from the archive of the enterprise, or from the NormaCS database of regulatory documents, or from the Internet, or you have scanned it yourself from a textbook. What to do with it now?

. 5.
In general, the list of functions for working with raster is shown in Fig. 5, but let's look at them with a real example.
Insert image
To place a raster drawing in * dwg-document, it is enough to use the command GIFT (
Insert -> Link to raster ... ). You can insert any bitmap image in the drawing field (albeit monochrome or color) and in any of the five formats (TIFF, JPG, PNG, PCX and BMP). By experience, the best format is TIFF. It can store multi-raster images without loss of quality. At the same time, monochrome rasters will also occupy a minimal volume - an A4 format drawing and an average saturation will require about 50 Kb at a resolution of 300 dpi.
For example, let's take a working drawing from typical documentation stored in the NormaCS database (Fig. 6).

. 6. 1.100.3-6, 1988 . ! NormaCS
Bitmap Correction
Externally, the document is almost flawless: the text is perfectly readable, good resolution. But if the inserted vector drawing is superimposed with an ideal vector dimensional frame, we will see that the paper drawing does not coincide with it. Why?
In the process of storing and scanning a paper drawing, both its quality and its dimensions (paper squeezing) suffered. This means that there is no need to talk about any accuracy at the moment: if we now just “chop up” the documentation, we will get an incorrect vector drawing. The raster document must first be corrected.
Call the
4-point correction command (
Framing ), specify the format to which the raster should correspond, then four corner points on the raster that correspond to the ideal frame, click
OK - and get a flattened raster image (Fig. 7).

. 7. 4-
The image correction functions also include the commands to
rotate / display a raster (exists in any graphic editor, but in our case you don’t need to upload the raster to an external application),
fix skew and
trim the raster along the rectangle . The last two are very important. The original is often scanned with a slight bias, and nanoCAD can not just eliminate this bias - by analyzing the lines, the program is able to independently determine the bias angle and eliminate distortions in automatic mode.
Bitmap Editing
Let's say that now the document inserted from NormaCS should be tied to our project. To do this, remove some information from the drawing (stamp data, product code, 30 in the upper right corner, etc.). Well, write over your raster drawing own data. The ideal tool for the first part of this task is the
Eraser . Call the command
RastrEraser (
Raster -> Eraser ), set the size of the eraser and gently erase the excess from the document (Fig. 8).

. 8. ,
There is also a reverse command -
Pencil , which, on the contrary, will allow to draw data. Of course, drawing the whole document with a pencil does not make sense, but restoring the line erased with an eraser is very helpful. There are also the
Fill and
Erase fill commands: they allow you to fill a closed area with a new color. The latter command is especially useful when you need to remove a complex area from a drawing — say, letters or an isolated piece. You click in the letter or the black part of the drawing - and the area disappears ...
When the raster drawing is clean, all further work on the document is standard: on top of the raster data we enter vector - texts, lines, arcs, hatching.
Raster binding
Drawing over a bitmap is easy enough - you put lines on the peephole and gradually draw what you need. But nanoCAD provided automation here too: starting from version 4.0, it is possible to attach to raster objects and catch typical bindings (end point, center of circle, closest, etc.).
In fact, this is a temporary vectorization. While the user is holding the cursor over the raster drawing, the program analyzes the structure of the raster and tries to find a vector as close as possible to the raster “spot” under the cursor. If the “spot” is elongated, then this is most likely a line, if a closed circle is a circle, if it is rounded, an arc. It looks absolutely fantastic and very comfortable in work (Fig. 9).

. 9. , nanoCAD ,
Work with color image
Despite the fact that the raster editing teams were originally conceived for working with drawings, nanoCAD has the ability to work with a color image. The commands
Rotate ,
Mirror ,
Eraser ,
Pencil ,
Image Cropping are applicable to any raster. At the same time, a number of commands (
Eliminate skew in automatic mode ,
raster binding ) works only with monochrome drawings. This must be borne in mind.
Print documentation
Working in nanoCAD, the user receives a hybrid drawing, in which there is both raster and vector data. What will this drawing look like on paper? However surprising it is - almost the same as a regular vector. If the quality of the source raster is good (read, the resolution of the raster is at least 300 dpi), then on paper the human eye cannot distinguish raster lines from vector ones. In the right part of fig. 10 vector data highlighted in blue.

. 10. nanoCAD , ,
This technology significantly reduces the time spent working on documentation. Thanks nanoCAD there is no need to redraw the entire document: you rule only the part that needs to be changed. And print the finished drawing to print. Profit!