4

There is a useful tool in MikTeX called dvipng, which can transform dvi file to png file.

My question is about the useage of this command. I usually use it with options

-T tight -D 120 -z 9 -bg Transparent

,

but sometimes pictures output are not clear enough when printed on papers,

enter image description here

so I increased the dpi to 1200 in order to make them more clear:

-T tight -D 1200 -z 9 -bg Transparent

.

Despite of it goes more clear indeed, the size of the picture, out of my expectation, increased 99 times at the same time.

enter image description here

I want to increase the dpi without increasing the size of the picture, so how to realize it?

7
  • 1
    dvipng is not a MiKTeX tool, it is just included there as well as in TeX Live.
    – Speravir
    Apr 23, 2013 at 17:12
  • Could you explain what the goal of making PNG from DVI is? Then someone might suggest an alternative solution.
    – amorua
    Apr 23, 2013 at 18:01
  • 1
    @amorua Okay, no problem. My goal is paste formulae as png into doc files, but I found 120dpi is not clear enough, 1200dpi is much better but needs to have a shrinking manually. So what I'm seeking is to make high quality pictures with standard size.
    – Popopo
    Apr 24, 2013 at 4:04
  • @Popopo Option 1: Retype in .doc with inbuilt math or mathtype incase of few equations Option 2: Check 200/300 dpi png compromising quality over size(math in png is not recommended choice last resort). Apr 24, 2013 at 4:26
  • somewhat related Whitespace problems with DVIPNG with LaTeX Apr 24, 2013 at 4:45

1 Answer 1

6

A short (non-technical) answer is: it is impossible to do with dvipng

A longer (technical) answer is: the problem is that dvipng does not include a so called pHYs chunk in the PNG file it makes. This chunk contains the information about the size (in meters) of the pixel.

So, if your vector image is 1in x 1in and you render it to PNG with an option "-D 120", you'll get an image with dimensions of 120 x 120 pixels and there'll be no further information about resolution included in the PNG file.

See also https://web.archive.org/web/20130512151707/http://list-archives.org/2012/10/14/dvipng-nongnu-org/does-dvipng-include-the-dpi-information-in-its-output/f/6630375274

1
  • Well...it sounds sadly to me. But anyway thanks to you.
    – Popopo
    Apr 24, 2013 at 4:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .