I have a program generating multiple plots daily. To view them on the screen easily, I have black and grey backgrounds, with light-color foreground elements. But now I want to print some of them, without wasting a lot of ink or creating duplicate plot configurations. I've tried using ImageMagick's display -negate feature, but the greys stay grey, and blues turn into reds, and other undesirable things. Is there a way I can automatically (or through a short series of manual actions) transform images into something printable?

What I think I want is:

  • black -> white
  • gray -> white
  • white -> black
  • light blue/green/red/etc -> dark blue/green/red/etc

You can use display -gamma 0.2 +negate: gamma will darken the image, while +negate will inverse only grayscale pixels. Gamma value might require adjusting to better suit your needs

  • Thanks! This is looking better, but cyan in particular is hard to see against the light gray background. Any ideas? – Nate Parsons May 11 '12 at 20:39
  • You can try to play with -contrast, or, if you are very desperate, -color-matrix option of convert (I have no idea how to use it, but it looks terribly promising). Actually, I'd recommend to replot your graphs, since it's really difficult to get good result, especially if you use antialiasing. – aland May 11 '12 at 20:45
  • Thanks. I'll play around with those options, and if that fails, autogenerating print-friendly plot configurations. I just don't want to remake everything manually in the WSYWIG editor and then have to maintain dozens of plots like that. – Nate Parsons May 11 '12 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.