dvipng color trouble
I still have yet to find a fix to the dvipng discoloration mystery I ran into back at The Academic Approach, even with the latest MacTeX version, so I’m going to repost the problem here.
In May 2007, I wrote the following to the OS X TeX listhost:1
Hi all,
I’ve recently run into what I believe is a rare bug in
dvipng: here’s the setup. (To play along, you can get my test files: http://mitcho.com/discolor.zip .) I am using MacTeX… in fact, it’s today’s release.The LaTeX source file (
discolored.tex) loads just two packages:colorandgraphicx. The body does two things: an\includegraphicswith a local PNG file (with thebboption to specify theBoundingBoxexplicitly) and a\textcolorcommand introducing some green text, using the green defined there.
pdflatexproduces the expected result: the figure and the green text.But when you run the following commands…
latex discolored.tex
dvipng -D 200 discolored.dviyou get a PNG (discolored1.png) which shows the text in a brownish color… the green is gone!!
There are two quick ways to fix this that I’ve found: one is to not include the image… if you comment the
\includegraphicscommand out, the color comes out fine. The second is to not specify a-D(output resolution) parameter in thedvipng… this also gives you the expected output. However, in my current project, neither of these are available options…I am frankly not very familiar with the inner workings of
dvipng… does anyone have any thoughts? Can this bug be reproduced?Any hints or suggestions are welcome!
Ditto.
-
Inline cropped images added to this web version, just to spice things up. ↩
Related posts:
- Markdown for WordPress and bbPress: Markdown for WordPress and bbPress 1.0 30 kb - zip...
関連記事は Yet Another Related Posts Plugin によって表示されています。
Tags: bug, code, LaTeX, The Academic Approach
If you enjoyed this post, make sure you subscribe to my RSS feed (optionally with tweets from my Twitter)!
2 月 6th, 2008 at 7:51 am
I know quite a lot about the inner workings of dvipng; I wrote it.
The MacTeX distribution uses a really really outdated version of libgd: the truecolor-incapable libgd1.x which has been replaced by the truecolor-capable libgd2.x, I dunno, 5-6-7 years ago.
The best course of action would be to rebuild dvipng against libgd2. And to recommend the distributor of MacTeX to do so too. (Perhaps I should just remove the libgd1-compatibility code in dvipng and force everyone to go libgd2.)