On Mon, Sep 20, 2010 at 9:22 AM, Jonathan Slavin <jsla...@cfa.harvard.edu>wrote:

> A non-matplotlib way to do this is to use ImageMagick or GraphicsMagick:
> gm convert -colorspace Gray color_image.png bw_image.png
> in GraphicsMagick or using the ImageMagick routine "convert":
> convert -colorspace Gray color_image.png bw_image.png
>
> I think it works on a wide variety of image formats.
>
> Jon
>
>
A word of warning on this approach though...  If the graphics formats are
vector-based (ps, eps, svg, etc...), then ImageMagick will destroy the
vector information in the process, even if the output format is also vector
based.  This is because ImageMagick is a raster-based library and all of its
algorithms operate upon raster data.

So, if this is for a publication, ImageMagick is not advised.

I also have another approach that allows you to convert a colormap into a
greyscale version of itself, but wouldn't work on colored lines or anything
like that.  I suggest going with Friedrich's approach.

Ben Root
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to