Wednesday, July 21, 2010

~ Casting out the Colors

Salam alaik,

MATLAB generates cool looking colored ps-files.
Unfortunately thoguh, most of the conferences & periodicals ask for gray scale images instead.
It gives you a big pain_in_the_neck tryna find suitable colors that could be distinguished at gray-scale level, esp in cases when markers don't serve the purpose well enough.

So..
I've discovered a simple Color to gray scale trick.
How to get around it is a little more tricky.
& by the end of the toil u'll get MATLAB generated PS-files, by editing the ps file directly.

First off, search for lines similar to;

/c8 { 1.00000 0.000000 0.000000 sr} bdef

Now lets dissect down this piece by piece..

/c8: According to my calculations '/c' means color here and '8' is numbering that may vary.

{1.00000 0.000000 0.000000 sr}: The RGB values; all values should be same & less than one for grey-scale. Note that all 'zeros' mean black, and all 'ones' mean white. Darker values are harder to distinguish, so I suggest giving more gap in values chosen between 0-0.5. While, less gaps can be afforded for values between 0.5-1.0.

That little doo-dad will clear the remainder of the picture. Like so;
Here is an example of a color image;


Now ,we require 6 gray-scale values. I used [0 0.3 0.55 0.65 0.75 0.85], & VOILA!
Here is the result;


aint that a neat trick right there?
It actually isn't much of a trick..
see if u could come up with more trix.

~*~*~*~*~~*~*~*~*~
blog comments powered by Disqus