Importing bitmaps

Started by Dr PR, March 27, 2014, 08:58:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

When you bring a bitmap image into DesignCAD it will be scaled relative to the screen image. I really don't know exactly what this means but let me explain.

1. If you open a blank file and then import an image the program puts the image into the drawing according to some mysterious relationship to the area visible on the screen.

2. Now zoom out (-).

3. Import the same image and it will go into the drawing with the same relationship to the visible area, and not to the objects in the drawing. In other words, the second image will be larger than the first.

4. Zoom in quite a way (++).

5. Import the same image again and it will go into the drawing with the same relationship to the visible area. In other words, the third image will be smaller than the second, and probably smaller than the first.

All three bitmaps will be different sizes, even though they are from the same image file!

****

If you want to import multiple images and have them come into the drawing at the same scale (say you want to import multiple scan images of parts of a map, or parts of a larger drawing):

1. Start with an empty file (best choice)

OR

Select an empty layer and disable all visible layers.

2. Draw a line. Any length will do. This line will be the import reference, and the layer will be the "reference layer." It is a good idea to name this layer "REFERENCE LAYER" in the "Layers" dialog.

3. Use "View/Fit to Window" (CTRL W) to zoom the screen so the line fits the display area.

4. Import a bitmap. Either select an empty layer first, or move the image to another layer after importing WITHOUT ZOOMING.

5. Return to the "reference" layer.

6. Repeat steps 3, 4 and 5 until all bitmaps have been imported.

IF all of the bitmaps were created at the same pixel density (dots per inch) this method will bring them all into DesignCAD at the same relative scale. However, the bitmap scale will not be at a predictable scale to any objects in the drawing before you imported the bitmaps - this is why it is better to start with a blank drawing and import before you try to draw anything.

7. Use the "Dimensions/Units" (U) function to set the drawing units relative to the bitmap image(s). Find a part of the bitmap image(s) that is a known distance. Press "U" to start the "Units" function, point the cursor to one end of the known distance and left click, then point at the other end of the known distance and left click again.

Now enter that distance into the "Drawing Units" dialog box. This scales the drawing units relative to the features in the bitmaps.

****

That isn't the end of the story! If you are tracing over the bitmap image(s) DO NOT change the zoom level. Before starting to draw. select a zoom level suitable for tracing the bitmap AND DO NOT CHANGE IT!

It is a very complex issue,  but when you change the zoom level DesignCAD has to recalculate the displayed pixel density of the bitmaps. Each pixel in the bitmap has to be displayed larger or smaller when you change the zoom level, and mathematical roundoff errors will occur. However, the locations of other (non-bitmap) objects do not suffer scaling issues. The result is that when you zoom in/out the visible location of the bitmap may change relative to the visible location of the other objects in the drawing.

You can use the same "reference layer" trick described above to reset your zoom level so you are always at the same relative zoom level when you trace over a bitmap.

Phil
DesignCAD user since 1987

Lar

Not too many years ago DT explained how an imported bitmap relates to screen pixels but I can't remember how it works. Maybe you can try searching for it, or DT can repost it.

Lar

prl

#2
Quote from: Dr PR on March 27, 2014, 08:58:41 PM
In other words, the third image will be smaller than the second, and probably smaller than the first.  . . . All three bitmaps will be different sizes, even though they are from the same image file!

I tried your experiment and of course ended up with the different bitmap sizes you mentioned. Very interesting.   I remember Lar does some sort of keep-your-viewport-center trick with paperspace similar in technique to what you are describing with the line and fit to window method.  Your solution resulting in a consistent bitmap calibration technique.  Thanks.

Bob P

I learn something new every day...  :o  I've always assumed that a bitmap would be brought in with its pixels matching the screen pixels, so I always pre-resized the bitmap to fit the screen.  Once it was imported, I scaled everything to match my real-life dimensions.  Looks like I was trying too hard.  :-[

Lar

#4
Quote by Lar:
QuoteNot too many years ago DT explained how an imported bitmap relates to screen pixels but I can't remember how it works
.

Well, I still don't remember exactly what DT explained back then but I think this is the case:
   When you import a bitmap it comes in at pixels, ie, relative to your overall screen. For example, if your import was captured via the 'print screen' button then it is the same pixel size as you full screen. Since it would be impossible to paste the bitmap exactly at the left bottom corner of your screen (since dcad does not allow the drawing windows to ever get to that part of the screen) then you may never realize that the *print screen* image is exactly the same size as the screen.

Once the bitmap is placed in the drawing then it takes on a size relative to your drawing. So, once you place the *print screen* image you would naturally zoom back to see the full image. If you should then immediately paste in another copy of the image the 2nd one would be larger than the first, since it is the same pixel size as the screen but now the 1st one is smaller than the full screen.

To get them both the same size I would then place the 2nd on top of the first and use resizing handles or point select mode to make it fit to the 1st. To get an almost-accurate size I would find a line of a known distance on the bitmap and trace over it with a vector (by zooming in real close to the ends of the bitmap line). I would then group the vector and the bitmap, set 2 sticky handles at the endpoints of the vector and use the 'move' command with 'use original scale' unchecked to resize the group the required distance.

I have also experienced pixels *shifting* when tracing over bitmaps in dcad but I find this to not be the case in images created in Cinema 4D. I sometimes create 3d models of structures in dcad, export to cinema 4d, render a photo realistic non-perspective floor plan or elevation with shadows, reflections, etc. Cinema 4d does not create bitmaps to a drawing unit size (the way dcad can) but I have a formula to convert c4d's pixels to feet. After saving the rendering I import it into dcad then use my sticky handle technique mentioned above to size it to its proper drawing size. I then place the bitmap on top of a simple 2d vector outline (that was derived from the 3d model) and can then snap dimensions to the bitmap/vector combo, resulting in a photo realistic architectural floor plan/elevation with accurate dimensions. While dimensioning I often have to zoom in and the vectors and the lines of the bitmap always coincide.

Note that bitmaps may not look too pleasant in the dcad work environment but dcad prints them beautifully. Also, the drawing size of a bitmap in dcad has no impact on its image quality (by that I mean shrinking or enlarging a bitmap in dcad does not alter its pixels the way it does in a graphics program).

Lar