Trouble with Bitmap Export Add Extra Margin
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Newbie Member
- Posts: 5
- Joined: Mon Jan 28, 2019 2:22 pm
Trouble with Bitmap Export Add Extra Margin
Hi!
I'm trying to export my .DXF file to a .TIFF files using QCAD in command line mode, but i don't know how to disable this check: "Add extra margin to compensate for line weight" with command line parameter.
I want to create tiles of this file and i need to create TIFF file with exact precision but this margin is moving my photo.
As example, I'm trying to export this square:
But when I export my TIFF file, we only saw the lower-left corner:
It's possible to call command line QCAD with this check disabled?
Thanks!
I'm trying to export my .DXF file to a .TIFF files using QCAD in command line mode, but i don't know how to disable this check: "Add extra margin to compensate for line weight" with command line parameter.
I want to create tiles of this file and i need to create TIFF file with exact precision but this margin is moving my photo.
As example, I'm trying to export this square:
But when I export my TIFF file, we only saw the lower-left corner:
It's possible to call command line QCAD with this check disabled?
Thanks!
Re: Trouble with Bitmap Export Add Extra Margin
Please post the exact parameters you are using for dwg2bmp along with the DXF/DWG file, thanks.
-
- Newbie Member
- Posts: 5
- Joined: Mon Jan 28, 2019 2:22 pm
Re: Trouble with Bitmap Export Add Extra Margin
Hi Andrew,
I'm calling Qcad with:
-allow-multiple-instances
-no-gui
-autostart
ExportBitmapWorldFile.js (format file that exports TIFF and generates TIFFW too)
-f
-o My output path
-p 0.02
-t "tiff"
In ExportBitmapWorldFile.js i'm just changing properties of:
"width", "height", "resolution" and "margin" (= 0 trying to solve this problem).
Thanks
I'm calling Qcad with:
-allow-multiple-instances
-no-gui
-autostart
ExportBitmapWorldFile.js (format file that exports TIFF and generates TIFFW too)
-f
-o My output path
-p 0.02
-t "tiff"
In ExportBitmapWorldFile.js i'm just changing properties of:
"width", "height", "resolution" and "margin" (= 0 trying to solve this problem).
Thanks
- Attachments
-
- ExportBitmapWorldFile.js
- (8.85 KiB) Downloaded 460 times
-
- C_M1_P1_0_ARQ.dwg
- (496.41 KiB) Downloaded 490 times
Re: Trouble with Bitmap Export Add Extra Margin
OK.. perhaps a rounding error? If your lines are 1 pixel wide and you use a margin of 0 the line might just be inside or outside the pixel depending on the values being rounded up or down.
-
- Newbie Member
- Posts: 5
- Joined: Mon Jan 28, 2019 2:22 pm
Re: Trouble with Bitmap Export Add Extra Margin
I tried doing it manually with "Bitmap Export" in QCAD using the same parameters and when i uncheck this: "add extra margin to compensate for line weight", the TIFF files fits well.
(And obviously, with this check i have the same problem).
(And obviously, with this check i have the same problem).
Re: Trouble with Bitmap Export Add Extra Margin
Strange.. QCAD uses the same routines and parameters.
Perhaps you could create a bitmap with double or four times the required resolution and then scale it down accordingly (e.g. using imagemagick command line tools). Switching on antialiasing in QCAD might also have a similar effect (properties["antialiasing"] = true).
Perhaps you could create a bitmap with double or four times the required resolution and then scale it down accordingly (e.g. using imagemagick command line tools). Switching on antialiasing in QCAD might also have a similar effect (properties["antialiasing"] = true).
-
- Newbie Member
- Posts: 5
- Joined: Mon Jan 28, 2019 2:22 pm
Re: Trouble with Bitmap Export Add Extra Margin
And which is the propertie to change this "extra margin"? I mean, something like: "properties["ExtraMargin"] = false "
i can't create bitmaps with high resolution cause we're doing an automatic procedure that generates tiles like every hour.
i can't create bitmaps with high resolution cause we're doing an automatic procedure that generates tiles like every hour.
Re: Trouble with Bitmap Export Add Extra Margin
That switch for adding line weight margin is reflected in the bitmap exporter through parameter "noweightmargin":
Code: Select all
properties["noweightmargin"] = true;
-
- Newbie Member
- Posts: 5
- Joined: Mon Jan 28, 2019 2:22 pm
Re: Trouble with Bitmap Export Add Extra Margin
This solves my problem.
Thanks Andrew!
Thanks Andrew!