Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am converting a PDF (which I made with R) to a PNG with a command like this:

convert -density 200 foo.pdf bar.png

This generates a PNG allright, but the white background is transparent in the resulting PNG. This is not what I want, I want the background to be white in the PNG as well. How can I achieve this?

Notes:

  • I am using Xubuntu.
  • What is weird, I did the same sequence on a different linux and computer: first generate picture with R in PDF format, then convert from PDF to PNG, and on that installation it does not convert the white background into transparency, just as I want it. But, I do not know where the difference is caused (R, convert or what).
share|improve this question
up vote 6 down vote accepted

Try to add this setting:

-flatten

Source

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .