I want to use the beamer package with a white on black style to create presentations. I included a simple switch to choose black on white for printout. Is there any possibility to also invert the colors of included graphics (maybe only black on white) or define some substitution rules for colors in included graphics?

I don't think you can change all colors of an included PDF or PNG. Maybe there is some color filter setting available in the PDF standard, but I would simply invert the images manually and then use conditionals to include either the one set of the other.
–
Martin Scharrer♦Nov 8 '11 at 14:33

I guess you can do some imageMagick magic by calling the externam tool if some switch is set. From what I know LaTeX uses pictures without actually doing anything with them so picture manipulations are not possible internally
–
Martin HNov 8 '11 at 14:36

3 Answers
3

If you use PNG or another bitmap file, you can preprocess your file with Imagemagick.

convert -negate in.png out.png

This also works for PDFs. However, the vector data is rasterised and that's not what you aim for.

Edit:

You can preprocess the file with inkscape. Load the pdf file, then select Extensions → Colour → Negative, and the paper size of the size of your imported PDF. This yields a non-rasterised, inverted PDF.

Using convert for png's works just fine but what Inkscape does with my imported PDFs is not useable.
–
bnordNov 9 '11 at 7:54

You don't describe what unusable is. But keep in mind that a white parts in PDFs are often not white, but transparent. They have to be transformed to black.
–
MarcoNov 9 '11 at 10:18

Yes sorry, as a test I imported a PDF generated by graphviz (dot) and one by mathematica, all the text was replaced by some cryptic symbols, changing the import settings didn't help. Of course I can change that in dot but I was looking for a robust way working with more or less arbitrary input.
–
bnordNov 9 '11 at 14:33

Not a LaTeX solution but AFAIK FoxIt Reader can change colors at the preferences: edit → preferences → document colors.
Adobe Reader has Edit → Preferences → Accessibility → Replace Document Colors.
And at the internet I found that Mac OSX can invert the whole sceen with CTRL-OPT-CMD-8.

If you use METAPOST to generate graphics, then you can use metafun to change the color. See Section 8.5 of the metafun manual, which has an example of converting a colored image to black and white at the end of the section (on page 205).

Some time ago I tried to use this mechnism to process files converted to mp by pstoedit, but the compilation failed with errors (I don't recall what the issue was). Seems that mp is picky about the input.
–
MarcoNov 9 '11 at 11:41

@Marco: I have only rried this with hand written metapost. If you can find the offending image that failed, it might be worthwhile to file a bug report.
–
AdityaNov 9 '11 at 14:32