Scriptable/automatic image manipulation?

0

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

Nate Parsons

Posted 2012-05-11T19:35:40.410

Reputation: 1 425

Answers

1

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

aland

Posted 2012-05-11T19:35:40.410

Reputation: 2 644

Thanks! This is looking better, but cyan in particular is hard to see against the light gray background. Any ideas? – Nate Parsons – 2012-05-11T20:39:27.587

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 – 2012-05-11T20:45:44.177

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 – 2012-05-11T20:50:36.760