Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
dvipng is not a MiKTeX tool, it is just included there as well as in TeX Live. –  Speravir Apr 23 '13 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 '13 at 18:01
    
@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 '13 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). –  texenthusiast Apr 24 '13 at 4:26
    
somewhat related Whitespace problems with DVIPNG with LaTeX –  texenthusiast Apr 24 '13 at 4:45

1 Answer 1

up vote 3 down vote accepted

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 http://list-archives.org/2012/10/14/dvipng-nongnu-org/does-dvipng-include-the-dpi-information-in-its-output/f/6630375274

share|improve this answer
    
Well...it sounds sadly to me. But anyway thanks to you. –  Popopo Apr 24 '13 at 4:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.