MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Export graph to vector format
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Export graph to vector format

 Post Reply Post Reply
Author
Message
bram.bolder View Drop Down
Contributor
Contributor


Joined: 09.Dec.2021
Location: Germany
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote bram.bolder Quote  Post ReplyReply Direct Link To This Post Topic: Export graph to vector format
    Posted: 06.Nov.2023 at 17:00
Hi,

I would like to insert a graph into a publication where the publishers have specific requirements on the image quality (300dpi). I have tried exporting a graph to PNG, then taking the width in pixels and rescale the image in cm until it matches the dpi requirements. Unfortunately this leaves the image a bit too narrow, as it's only roughly 1.5k pixels wide = 5 inch -> roughly 60% of an A4 paper.

I have also tried the code generator to Word, but that also creates an image with a certain resolution.

What I wanted to ask: is there is maybe some way to export the graph into a vector format (like SVG)? This would allow arbitrary scaling and is very efficient with respect to file size.
Or as a fallback: is there a way to set the image width when exporting to a pixel format?

Thanks.
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 06.Nov.2023 at 18:01
The ideal for publishers is often vector graphics, and MetaEdit+ supports that by printing to PDF. The details vary somewhat by platform (see e.g. Linux readme) and what printer drivers are on offer, and the results will vary similarly. We tell each 'printer' the same things to draw, but they choose how to draw it.

In my experience, publishers are looking for a decent level of quality in bitmaps in terms of the dpi resolution of the image itself, rather than the actual dpi of the image in its published form. It's better not to scale it yourself first, as that will reduce the quality when they scale it again. 

In some cases, the correct dpi is what is on the screen, e.g. if you also want to show the window around the diagram. That of course is easy, a simple screen shot.

In other cases, what is wanted is a bitmap at a higher resolution. One way is then to zoom in, and (unless you have a very large screen) probably make the image as a composite of several screenshots. (Note that at least on Windows, font scaling isn't always accurate, so you will probably need to resize some elements slightly if you have particular requirements for how text wraps etc.) When we wrote the DSM book we had to make a lot of screenshots, so we made a patch to MetaEdit+ to scale up PNG output by a factor of 4; here's an updated version for any MetaEdit+ 5.5: png55_400.mep

Below is an example of the output from both PDF and scaled-up PNG with the above patch: click to open at full size.



Edited by stevek - 09.Nov.2023 at 22:16
Back to Top
bram.bolder View Drop Down
Contributor
Contributor


Joined: 09.Dec.2021
Location: Germany
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote bram.bolder Quote  Post ReplyReply Direct Link To This Post Posted: 07.Nov.2023 at 09:32
Unfortunately, in our Linux environment (where I run MetaEdit+) we don't have a printer installed that writes to PDF since everyone can just use the command line tools to do the conversions.

I tried the factor 4 PNG patch, and that works fine. Thanks!
Back to Top
bram.bolder View Drop Down
Contributor
Contributor


Joined: 09.Dec.2021
Location: Germany
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote bram.bolder Quote  Post ReplyReply Direct Link To This Post Posted: 07.Nov.2023 at 10:16
Small update: when I do not provide a printer name, the output PostScript file is just saved to the current directory. Perfect!

Only drawback is that the "gradient fill" and the dashed line features seem not to be supported. For the gradient it is just the mean value of the gradient components.

[I wanted to include screenshots, but I get a permission denied when trying to upload the tiny images]

Edited by bram.bolder - 07.Nov.2023 at 10:21
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 09.Nov.2023 at 22:28
Thanks for pointing out that image upload problem. Looks like an update at the service provider lost the rights on the upload directories: now fixed. I added an example picture above.

The PostScript is really just a fallback, for when there are no printers installed. I'll have a look if we can add dashed lines (and dotted etc.); gradient fills are unlikely to be added.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.055 seconds.