dwg2bmp with 1 unit = pixel

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

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

dwg2bmp with 1 unit = pixel

Post by andrew » Thu May 26, 2022 4:25 pm

From a QCAD user:
How can I convert a DXF/DWG to a bitmap (PNG, TIFF, etc.) with one drawing unit being exported as exactly one pixel?

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

Re: dwg2bmp with 1 unit = pixel

Post by andrew » Thu May 26, 2022 4:28 pm

Use -r 1 (resolution of 1) to export a drawing unit to one pixel.
Use -m 0 to remove any margins.
Use -no-weight-margin to avoid adding additional margins to compensate for line weight.
Optional: use -a for antialiasing (to make sure lines along the borders are still visible)

To summarize, you can use a command like this:

Code: Select all

dwg2bmp -f -r 1 -m 0 -a -no-weight-margin -o output.png input.dxf

Post Reply

Return to “QCAD 'How Do I' Questions”