DVIPNG(1)
π dvipng β A DVI-to-PNG translator π
DVIPNG(1) Β· User commands Β· dvipng
β¨ NAME β¨
dvipng β A DVI-to-PNG translator
π SYNOPSIS π
dvipng [options] filename
dvipng [options] [filename] -
πΈ DESCRIPTION πΈ
okay bestie, sit down, because this one is a serve. This program makes PNG and/or GIF graphics from DVI files as obtained from TeX and its relatives. π
If GIF support is enabled, GIF output is chosen by using the dvigif binary or with the --gif option.
π¦ the benefits, because there are <em>so many</em> π¦
- Speed. It is a very fast bitmap-rendering code for DVI files, which makes it suitable for generating large amounts of images on-the-fly, as needed in
preview-latex,WeBWorKand others. speed queen behavior fr fr β‘ - It does not read the postamble, so it can be started before TeX finishes. There is a
--followswitch that makes dvipng wait at end-of-file for further output, unless it finds thePOSTmarker that indicates the end of the DVI. impatient bestie friendly - Interactive query of options. dvipng can read options interactively through stdin, and all options are usable. It is even possible to change the input file through this interface. not me talking back to my own renderer π
- Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e., as used in CJK-LaTeX), color specials, and inclusion of PostScript, PNG, JPEG or GIF images. iconic range, honestly
- and more... π
π OPTIONS π
Many of the parameterless options listed here can be turned off by suffixing the option with a zero (0); for instance, to turn off page reversal, use -r0. Such options are marked with a trailing *.
π«Ά so if you see a little star*next to an option, that's your cue that it can be switched off with a0at the end. iykyk
-β Read additional options from standard input after processing the command line.--helpβ Print a usage message and exit. (bestie behavior)--versionβ Print the version number and exit.-bd num,-bd color_spec,-bd 'num color_spec'β Set the pixel width of the transparent border (default0). Using this option will make the image edges transparent, but it only affects pixels with the background color. Giving acolor_specwill set the fallback color, to be used in viewers that cannot handle transparency (the default is the background color). The color spec should be in TeX color\specialsyntax, e.g.,'rgb 1.0 0.0 0.0'. Setting the fallback color makes the default border width1px. cute little see-through edges, we love β¨--bdpi numβ This option only has an effect when using bitmapped (PK) fonts. The option sets the base (Metafont) resolution, both horizontal and vertical, tonumdpi (dots per inch). This option is necessary when manually selecting Metafont mode with the--modeoption (see below).-bg color_specβ Choose background color for the images. This option will be ignored if there is a background color\specialin the DVI. The color spec should be in TeX color\specialsyntax, e.g.,'rgb 1.0 0.0 0.0'. You can also specify'Transparent'or'transparent'which will give you a transparent background with the normal background as a fallback color. A capitalized'Transparent'will give a full-alpha transparency, while an all-lowercase'transparent'will give a simple fully transparent background with non-transparent antialiased pixels. The latter would be suitable for viewers who cannot cope with a true alpha channel. GIF images do not support full alpha transparency, so in case of GIF output, both variants will use the latter behaviour. capital-T vs lowercase-t is NOT the same thing, read it twice bestie π-d numβ Set the debug flags, showing what dvipng (thinks it) is doing. This will work unless dvipng has been compiled without the"DEBUG"option (not recommended). Set the flags as you need them, use-d -1as the first option for maximum output. maximum yapping mode π-D numβ Set the output resolution, both horizontal and vertical, tonumdpi (dots per inch).
One may want to adjust this to fit a certain text font size (e.g., on a web page), and for a text font height of font_px pixels (in Mozilla) the correct formula is
<dpi> = <font_px> * 72.27 / 10 [px * TeXpt/in / TeXpt]
The last division by ten is due to the standard font height 10pt in your document, if you use 12pt, divide by 12. Unfortunately, some proprietary browsers have font height in pt (points), not pixels. You have to rescale that to pixels, using the screen resolution (default is usually 96 dpi) which means the formula is
<font_px> = <font_pt> * 96 / 72 [pt * px/in / (pt/in)]
On some high-res screens, the value is instead 120 dpi. Good luck! π (the manpage itself said good luck and honestly, same)
--depth*β Report the depth of the image. This only works reliably when the LaTeX stylepreview.styfrompreview-latexis used with the active option. It reports the number of pixels from the bottom of the image to the baseline of the image. This can be used for vertical positioning of the image in, e.g., web documents, where one would use (Cascading StyleSheets 1)
<IMG SRC="<filename.png>" STYLE="vertical-align: -<depth>px">
The depth is a negative offset in this case, so the minus sign is necessary, and the unit is pixels (px). do NOT lose the minus sign π
--dvinum*β Set this option to make the output page number be the TeX page numbers rather than the physical page number. See the-oswitch.-fg color_specβ Choose foreground color for the images. This option will be ignored if there is a foreground color\specialin the DVI. The color spec should be in TeX color\specialsyntax, e.g.,'rgb 1.0 0.0 0.0'.--follow*β Wait for data at end-of-file. One of the benefits of dvipng is that it does not read the postamble, so it can be started before TeX finishes. This switch makes dvipng wait at end-of-file for further output, unless it finds thePOSTmarker that indicates the end of the DVI. This is similar totail -fbut for DVI-to-PNG conversion. it's giving stalker but make it fonts π--freetype*β Enable/disable FreeType font rendering (default on). This option is available if the FreeType2 font library was present at compilation time. If this is the case, dvipng will have direct support for PostScript Type1 and TrueType fonts internally, rather than usinggsftopkfor rendering the fonts. If you have PostScript versions of Computer Modern installed, there will be no need to generate bitmapped (PK) variants on disk of these. Then, you can render images at different (and unusual) resolutions without cluttering the disk with lots of bitmapped fonts. One reason to disable FreeType font rendering would be to generate identical output on different platforms, since FreeType uses the native renderer and therefore can give slightly different output on each platform. same vibe everywhere vs. pretty everywhere... choose your fighter--gamma numβ Control the interpolation of colors in the greyscale anti-aliasing color palette. Default value is1.0. For0 < num < 1, the fonts will be lighter (more like the background), and fornum > 1, the fonts will be darker (more like the foreground).--gif*β The images are output in the GIF format, if GIF support is enabled. This is the default for thedvigifbinary, which only will be available when GIF support is enabled. GIF images are palette images (see the--paletteoption) and does not support true alpha channels (see the--bgoption). See also the--pngoption.--height*β Report the height of the image. This only works reliably when the LaTeX stylepreview.styfrompreview-latexis used with the active option. It reports the number of pixels from the top of the image to the baseline of the image. The total height of the image is obtained as the sum of the values reported from--heightand--depth.-l [=]numβ The last page printed will be the first one numberednum. Default is the last page in the document. Ifnumis prefixed by an equals sign, then it (and the argument to the-poption, if specified) is treated as a physical (absolute) page number, rather than a value to compare with the TeX\count0values stored in the DVI file. Thus, using-l =9will end with the ninth page of the document, no matter what the pages are actually numbered. the=is doing the heavy lifting here, don't skip it--mode modeβ This option only has an effect when using bitmapped (PK) fonts. Usemodeas the Metafont device name for the PK fonts (both for path searching and font generation). This needs to be augmented with the base device resolution, given with the--bdpioption. See the file<ftp://ftp.tug.org/tex/modes.mf>for a list of resolutions and mode names for most devices.-M*β This option only has an effect when using bitmapped (PK) fonts. It turns off automatic PK font generation (mktexpk).--nogs*β This switch prohibits the internal call to GhostScript for displaying PostScript specials.--nogs0turns the call back on.--nogssafer*β Normally, if GhostScript is used to render PostScript specials, the GhostScript interpreter is run with the option-dSAFER. The--nogssaferoption runs GhostScript without-dSAFER. The-dSAFERoption in Ghostscript disables PostScript operators such asdeletefile, to prevent possibly malicious PostScript programs from having any effect. β οΈ this one turns off a safety net, bestie β read that again before you use it--norawps*β Some packages generate raw PostScript specials, even non-rendering such specials. This switch turns off the internal call to GhostScript intended to display these raw PostScript specials.--norawps0turns the call back on.-o nameβ Send output to the filename. A single occurrence of%dor%01d, ...,%09dwill be exchanged for the physical page number (this can be changed, see the--dvinumswitch). The default output filename isfile%d.pngwhere the input DVI file wasfile.dvi.-O x-offset,y-offsetβ Move the origin byx-offset,y-offset, a comma-separated pair of dimensions such as.1in,-.3cm. The origin of the page is shifted from the default position (of one inch down, one inch to the right from the upper left corner of the paper) by this amount.-p [=]numβ The first page printed will be the first one numberednum. Default is the first page in the document. Ifnumis prefixed by an equals sign, then it (and the argument to the-loption, if specified) is treated as a physical (absolute) page number, rather than a value to compare with the TeX\count0values stored in the DVI file. Thus, using-p =3will start with the third page of the document, no matter what the pages are actually numbered.--paletteβ bestie, when you drop an external image in,dvipngis gonna β¨automaticallyβ¨ flip itself into truecolor mode, because otherwise you get unnecessary delay and quality reduction, and it also lets the EPS translator draw on a transparent background and outside of the boundingbox. This switch says "no ma'am" and forces palette (256-color) output instead, makingdvipngrevert to opaque clipped image inclusion. It also overrides the--truecolorswitch if that one's hanging around. π--pickyβ literally zero images get output when a warning happens. Normallydvipngwill output an image in spite of a warning, but ngl there may be something missing in that image. One reason you'd use this is if you have a more complete but slower fallback converter. Mainly it's useful for failed figure inclusion and unknown\specialoccurrences, but heads up: warnings also happen for missing or unknown color specs and missing PK fonts. π--pngβ the images come out in the PNG format. This is the default for thedvipngbinary, so it's giving "default behavior, no thoughts needed." See also the--gifoption. π-ppfirstpage-lastpage β print pages firstpage through lastpage; but it's not quite equivalent to-p firstpage -l lastpage. Okay so picture this: when you're rendering a book, there may be several instances of a page in the DVI file (one in\frontmatter, one in\mainmatter, and one in\backmatter). In case of several pages matching,-pp firstpage-lastpagewill render all pages that match the specified range, while-p firstpage -l lastpagewill render the pages from the first occurrence of firstpage to the first occurrence of lastpage. This is the (undocumented) behaviour ofdvips. Indvipngyou can give both kinds of options, in which case you get all pages that match the range in-ppbetween the pages from-pto-l. Also multiple-ppoptions accumulate, unlike-pand-l. The-separator can also be:. Note that-pp -1will be interpreted as "all pages up to and including 1", so if you want a page numbered-1(only the table of contents, say) put-pp -1--1, or more readable,-pp -1:-1. π-qβ run quietly. Don't chatter about pages converted, etc. to standard output; report no warnings (only errors) to standard error. She's silent, she's mysterious, she's serving. π€«-Qnum β set the quality to num. That is, choose the number of antialiasing levels for bitmapped fonts (PK), to benum*num+1. The default value is4which gives 17 levels of antialiasing for antialiased fonts from these two. If FreeType is available, its rendering is unaffected by this option. β-rβ toggle output of pages in reverse/forward order. By default, the first page in the DVI is output first. Flipping the whole vibe. π¦--strictβ the program exits when a warning occurs. Normally,dvipngwill output an image in spite of a warning, but there may be something missing in this image. One reason to use this option would be if you have a more complete but slower fallback converter. See the--pickyoption above for a list of when warnings occur. It's giving strict parents energy, but for your DVI. π-Timage_size β set the image size to image_size, which can be either ofbbox,tight, or a comma-separated pair of dimensionshsize,vsizesuch as.1in,.3cm. The default isbbox, which produces a PNG that includes all ink put on the page and in addition the DVI origin, located 1in from the top and 1in from the left edge of the paper. This usually gives whitespace above and to the left in the produced image. The valuetightwill makedvipngonly include all ink put on the page, producing neat images. β¨--truecolorβ this will makedvipnggenerate truecolor output. Note that truecolor output is automatic if you include an external image in your DVI, e.g., via a PostScript special (i.e., thegraphicsorgraphicxpackage). This switch is overridden by the--paletteswitch. π-vβ enable verbose operation. This will currently indicate what fonts is used, in addition to the usual output. She's telling you everything, no secrets, main character energy. π--widthβ report the width of the image. See also--heightand--depth. π-xnum β > okay bestie, warning time: this option is deprecated; it should not be used. It is much better to select the output resolution directly with the-Doption. This option sets the magnification ratio tonum/1000and overrides the magnification specified in the DVI file. Must be between10and100000. It is recommended that you use standard magstep values (1095,1200,1440,1728,2074,2488,2986, and so on) to help reduce the total number of PK files generated. num may be a real number, not an integer, for increased precision. π-znum β set the PNG compression level to num. This option is enabled if yourlibgdis new enough. The default compression level is1, which selects maximum speed at the price of slightly larger PNGs. For an olderlibgd, the hard-soldered value5is used. The include filepng.hsays "Currently, valid values range from 0 - 9, corresponding directly to the zlib compression levels 0 - 9 (0 - no compression, 9 - "maximal" compression). Note that tests have shown that zlib compression levels 3-6 usually perform as well as level 9 for PNG images, and do considerably fewer calculations. In the future, these values may not correspond directly to the zlib compression levels."
πΈ NOTES πΈ
The full manual is accessible in info format, on most systems by typing:
info dvipng
π COPYRIGHT π
This program is released under the GNU Lesser General Public License version 3, see the COPYING file in the dvipng distribution or <http://www.gnu.org/licenses/gpl.html>.
Copyright (c) 2002-2015, 2019 Jan-AAke Larsson
and that's the whole page, bestie!! π«Ά this is from dvipng 1.18, dated 2025-02-02 β go forth and render your DVI files, you absolute icon π β¨π§
π¦ where this page comes from
- alpine 3.24: texlive-doc 2026.0-r0 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian trixie: dvipng 1.18-1 Β· LGPL-3.0-or-later
- fedora 44: texlive-dvipng 12:svn77830-105.fc44 Β· LGPL-3.0-only
- fedora 44: texlive-dvipng 12:svn77830-111.fc44 Β· LGPL-3.0-only
- opensuse-leap 16.0: texlive-dvipng 2025.221.1.18svn73848-160000.3.1 Β· LGPL-2.1-or-later
- ubuntu questing: dvipng 1.18-1
- ubuntu resolute: dvipng 1.18-1build1 Β· LGPL-3.0-or-later
- ubuntu stonking: dvipng 1.18-1build1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms