DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Everything you wanted to know about bitmaps and a lot more

Started by Dr PR, November 03, 2011, 12:20:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

Take a deep breath, there is a lot to know about bitmap files and DesignCAD.
(Note: This was also posted in another thread but I decided to put it here in Tips and Tricks)

A. Bitmap files are created at some dot per inch (dpi) density. They have fixed dimensions in the number of pixels (dots) wide and high. You cannot change this without editing the file in a bitmap editor like Photoshop.

B. DesignCAD files are vector files, so they have no fixed dimensions. You can change the dimensions simply by changing a variable. So there is no constant or predictable relationship between the size of objects in vector files and bitmap pixel density.

Everything that follows is a result of this ambiguity.

Relative Image Size

1. When DesignCAD imports a bitmap image the size of the bitmap relative to existing objects is somewhat arbitrary. The bitmap seems to be scaled relative to how you are zoomed in on the DesignCAD drawing (how much of the total vector drawing is visible at the time the bitmap is imported).

You can verify this for yourself by creating a new file in DesignCAD, then draw two horizontal lines, one spanning the width of the drawing window and another short line in the middle of the window.

Use "View/Fit to window" (CTRL W) to zoom out and then load a bitmap file (File/Image/Load Image File). Now draw a line (V) from the lower left corner to the upper right corner of the bitmap image.

Delete the bitmap.

Zoom in so the short horizontal line fills the width of the screen. Now load the same bitmap image again.

Zoom out again and compare the size of the second bitmap to the diagonal from the first. The second image is much smaller than the first.

2. The moral of this story is that of you want to import two bitmaps at the same pixel density relative to the rest of the drawing you MUST be zoomed to the same level when you import each file.

DesignCAD has no function to allow you to specify a specific zoom level, because zoom is relative to the overall drawing size, and that can change every time you edit the drawing. Again, there is NO absolute relationship between bitmap size and vector file dimensions.

3. If you want to import multiple bitmap images (say parts of a single larger drawing that was saved as multiple images) here is a trick that has always worked for me:

 a. Open a blank file.
 b. Draw a line of any length on layer 1. Lock this layer and never edit it! This is your scale reference for importing bitmaps images.
 c. Make layer 1 visible and hide all other layers.
 d. Use "Zoom to Fit Window" to set a reference zoom level.
 e. Import a bitmap onto the next highest layer.
 f. Repeat steps c through e until all bitmaps have been imported. They will all be at the same relative pixel size.

You can reposition bitmap images by selecting them and dragging just like any other object.

You can always add another bitmap at any time by repeating steps c through e.

Bitmap Scaling

When you zoom in and out over a bitmap DesignCAD has to convert each pixel in the original image into multiple pixels on the screen. These new pixel groups that represent individual pixels in the image are generated relative to the position of the bitmap image (lower left corner I think), and not relative to the positions of the vector objects in the drawing.

The width of vector lines and curves does not change relative to screen size* when you zoom in and out. Therefore, the width of "lines" in the bitmap drawing changes with zooming, and vector line widths do not.

This has significant consequences.

When you zoom in and out the original pixels in the drawing are scaled accordingly. If the scaling happens to be an even value (2X, 1/2X, etc.) the relative positions of the new pixel groups (that are created to represent the actual pixels in the image) will be positioned more or less correctly relative to the vector parts of the drawing.

If the zoom factor is irrational (1/3 for example) it will be impossible to produce a pixel group that is positioned exactly the same as the vector elements in the drawing. Therefore the visible position of the "pixels" in the bitmap change position relative to the vector objects with different zoom levels.

This means that you cannot trace over lines in bitmap drawings accurately if you zoom in and out. If you do zoom in and out while tracing the vector tracings will not be aligned correctly, the resulting drawing will be inaccurate, and this will drive you nuts.

If you want to trace over a bitmap image you should always work at the same zoom level. You can use the trick described above to establish a zoom reference.

* The "Enable Fixed Lineweight" option in the Info Box will cause vector lilnes to change width when zooming. However, they may still change positions relative to an underlying bitmap.

Image Quality

There are three causes of poor quality bitmap images when you print your drawing.

1. The first is the effect of scaling the bitmap image mentioned above. This can add a coarseness to the bitmap image, depending upon how much you are zoomed into the drawing when you print. If you use screen capture, or "File/Image/Save Image File" with the "Current Display" option, the bitmap image will be reproduced not as the original image viewed in an image viewer, but as it is recreated on the DesignCAD screen. This will be a pretty coarse image with lots of jaggies because screen resolutions are extremely poor compared to print resolutions. If you use the "Wireframe" option and zoom out appropriately (whatever that means) you will get better bitmap images in the print. You will have to experiment to find the best zoom scaling. The best images will result when you print the bitmap in DesignCAD at exactly 1:1 dpi in the print. That may be a bit hard to figure out, and it may result in the rest (the vector part) of the drawing being printed at the wrong size. Nobody ever said life would be easy!

2. The second reason that bitmaps viewed or printed in DesignCAd will not be as "pretty" as when viewed with image viewer programs (Windows Picture and Fax Viewer) is that the image display programs post process the bitmap images to make them look better. The most common trick is "antialiasing" where solid black lines with jaggies are massaged to make the edges "softer" by toning down the points of the jaggies to lighter shades of gray and making the center of the lines darker. The jaggies are still there, but just not as visible. DesignCAD (and other CAD programs) does not do this because it would just make the image fuzzier and harder to trace over.

3. The third cause of poor quality bitmaps is the size of the original bitmap image.

Let's say the bitmap you import is 1000 pixels wide. It will look pretty good on the screen in an image viewer program.

Now let's say you import it and print from DesignCAD. You select a normal paper size, letter or A3, with landscape rotation. If your printer prints at 300 dpi your 1000 pixel wide bitmap will print only 3.3 inches wide at its original resolution.

But if you tell the printer driver to "fit to screen" the bitmap will be expanded about 3.2X to fill the paper width. Now every jaggie is over three times as large as in the original image. Ugly!

If you want good bitmap printouts from DesignCAD you must use a bitmap that has enough pixels to fill a page at the desired print size. Edit the bitmap in a bitmap editor to make it large enough to print full page size at the printer's dpi settings before you import it into DesignCAD. Even so, DesignCAD doesn't do the antialiasing image massaging that image virwers use, so it still may not look as good.

More pixels is better, but really large bitmap images can slow DesignCAD to a crawl. You can't get something for nothing (thermodynamics).

There, in so many words or more, is a lesson about bitmaps and DesignCAD.
DesignCAD user since 1987

paulerens


paulerens