dvipng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dvipng] does dvipng include the dpi information in its output?


From: jfbu
Subject: Re: [Dvipng] does dvipng include the dpi information in its output?
Date: Mon, 15 Oct 2012 08:56:09 +0200

Le 15 oct. 2012 à 07:48, Jan-Åke Larsson <address@hidden> a écrit :

> 2012-10-14 16:00, jfbu skrev:
>> But with dvipng I get the behavior I have described: the natural size
>> rather than remaining invariant changes with the setting of the -D
>> option.
> 
> Yes, this is what I would suspect. dvipng uses the Graphics Draw library 
> (libgd), and there was no way to include this kind of information in a saved 
> PNG back when I wrote dvipng. Perhaps there is now, I'll need to check.
> 
> The -D switch does select the resolution in "natural" units, relative to the 
> TeX dimensions, so it would be the correct thing to do.
> 
> /JÅ

Thanks for your reply: the png images I produced were for
inclusion in a web page and as far as I could determine firefox
displays the png images with the correspondence 1 image pixel
equals 1 screen pixel, thus does not take into account the
(possible) information of the real dpi used in the image. 
Hence it is the number of pixels in the image which decides 
of its size on screen. By experiments I understood that to
produce with gs some images (from pdf) that would display in
a coherent manner in firefox alongside the images obtained
via dvipng, I add to use gs -r96, or equivalent, to get 96dpi.
If I use another dpi the size in firefox changes accordingly.
I went through a confusing stage because Preview.app confirmed
that the gs produced images were at 96dpi, but kept telling
me that the older dvipng images had been at 72dpi. In fact these images
were also at 96dpi but that information is either not in the file
or not understood by Preview. 

gs has a useful option -dDownScaleFactor so that for example
gs -r480 -dDownScaleFactor=5 
produces images at 96dpi that are internally treated at 480dpi
hence the final result is far better than with gs -r96.
(I am talking about images containing only text and math formulas)

The quality and the number of kilobytes 
is then about comparable to the quality and size of the dvipng
produced images, in my experiments, (I did not try to see if 4 or 6
were better than 5)

thanks again, best wishes
Jean-François


reply via email to

[Prev in Thread] Current Thread [Next in Thread]