bitmap export has extra white space

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

bitmap export has extra white space

Post by slcasner » Wed May 08, 2019 12:24 am

I have a drawing that is a filled rectangle approximately 33 inches wide by 1 inch tall. I want to export it as a 600 DPI bitmap with no margin, so in the export dialog I set the DPI to 600 (resulting in a width of 19740 and height of 615), I set the margin value to zero and unchecked the box for extra margin to compensate for line weight (and I have set the line weight to zero), but the result has an extra white background around the desired image and the aspect ratio is not correct.

My computer is a Macbook Pro running macOS 10.14.4. I was running QCAD-Pro 3.15 which added white on all four sides, but I just now paid to update to the current QCAD-Pro 3.22.0 in the hope that would fix it, but it still adds white on the left and bottom.

The actual dimensions of the drawing are 32.899184 x 1.024624 because the drawing is scaled from an image that I am recreating. The result should be 19740 x 615 pixels. If I trim off the white the result is 19403 x 605 pixels, so 336 pixels of white background on the left and 10 pixels on the bottom. But that aspect ratio is also wrong: for the original drawing it would be 32.1085432, for 19740 x 615 it would be 32.097561, but 19403 x 605 is 32.0710744.

I also tried to scale the drawing very slightly so it would be exactly 19740 x 615 pixels rather than 19739.5102 x 614.774568 pixels, but the scale operation did not change the size of the drawing elements. I thought I had successfully done fine scaling tweaks like that in the past, but I tried multiple times now with no success.
Attachments
trimmed.png
Bitmap with excess white bacground trimmed
trimmed.png (441.4 KiB) Viewed 8485 times
reduced.png
Bitmap as exported
reduced.png (269.36 KiB) Viewed 8485 times
reduced.dxf
Drawing file
(140.38 KiB) Downloaded 527 times

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: bitmap export has extra white space

Post by andrew » Wed May 08, 2019 9:55 am

I've opened a bug report at:
https://qcad.org/bugtracker/index.php?d ... sk_id=1884

There's no easy workaround but a fix will be included in the next snapshot release.

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: bitmap export has extra white space

Post by slcasner » Wed May 08, 2019 5:31 pm

Thanks. Are snapshot releases made on a regular schedule?

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: bitmap export has extra white space

Post by slcasner » Wed May 08, 2019 5:33 pm

Also, should I be able to scale the drawing by a very small amount as I described in my last paragraph of the original post?

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: bitmap export has extra white space

Post by andrew » Wed May 08, 2019 8:24 pm

Are snapshot releases made on a regular schedule?
Usually every 1-3 weeks.
Also, should I be able to scale the drawing by a very small amount as I described in my last paragraph of the original post?
Yes, you can scale by any desired factor.

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: bitmap export has extra white space

Post by slcasner » Thu May 09, 2019 6:08 am

I tried scaling again and there was no change. I selected all (TA), modifymenu, scale, snapintersection and selected the drawing origin as the focus point, then in the scaling dialog just clicked OK because the scaling factors we still as previously entered. There was no change.

Then I repeated this procedure but this time I clicked twice on the button showing a cursor arrow to make sure my factors were enabled (they were) and then clicked twice on the button showing a chain to make sure x and y were separate (they were). This time when I clicked OK the scale operation was effective. So it seems there is a bug there somewhere but its hard to say where.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: bitmap export has extra white space

Post by andrew » Thu May 09, 2019 1:12 pm

FYI: QCAD Snapshot 3.22.0.11 is now available.

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: bitmap export has extra white space

Post by slcasner » Thu May 09, 2019 10:49 pm

Thanks. The snapshot fixes the bitmap export problem.

Regarding the scaling, please open the file reduced.dxf attached to the initial post and try scaling with an x factor of 1.00036696 and a y factor of 1.0000248 which would change the dimensions from 32.899184 x 1.024624 to 32.9 x 1.025. When I try this there is no change in the size of the drawing. I verified that all the layers are visible and none are locked.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: bitmap export has extra white space

Post by andrew » Fri May 10, 2019 12:12 pm

Thanks for the details. I can confirm that this does not work (non-uniform scaling of hatches is actually not supported / implemented currently).

Since you're only trying to adjust the size slightly, I'd recommend to stretch the hatches at the ends instead using the Modify > Stretch tool.

slcasner
Junior Member
Posts: 21
Joined: Tue May 07, 2019 10:23 pm

Re: bitmap export has extra white space

Post by slcasner » Sat May 11, 2019 2:02 am

Thanks. I don't really need to do this minor size adjustment now since the bitmap export gives the desired result even without an exact size match to pixels.

It would be great if an error message would appear in the command line output saying that this non-uniform scaling of hatches is not supported.

Post Reply

Return to “QCAD Troubleshooting and Problems”