Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Margin problems when exporting as PNG

0 votes
Hello!

I have noticed one bug when exporting as PNG with margins set to 0.

If you set margins to 0, your png image will miss one pixel on right and one pixel on bottom.

If you set margins to 1, there will be one pixel margin at the top and left, but there will be no margin at right and bottom.

Best regards and thanks for this great software!

Aleksandar
in Help by

2 Answers

0 votes
The margin setting is not meant to create pixel-perfect free space around your diagram, but is a simple way to ensure that visual features (such as thick border lines or drop shadows that are not taken into account when calculating the geometrical size of your diagram) are not cut off when exporting.

If you need pixel-perfect free space, I suggest exporting with a fairly large margin and trimming the exported image to the desired size in a dedicated image manipulation program such as the GIMP or Adobe Photoshop.
by [yWorks] (160k points)
0 votes
Just to add to the answer, margin issues are not specific to PNG, and vary according to arrow thickness: thick arrows on the image edges usually lead to pixel loss if using small margins.

For PDF images, the safe solution is to add a reasonable margin and then apply pdfcrop on the result.
by (170 points)
Legal Disclosure | Privacy Policy
...