Re: [Matplotlib-users] CMYK images

2010-08-27 Thread Michele De Stefano
Thanks a lot to all of you.

First of all, I have to say that I agree with Benjamin Root.

I'll try the tools some of you suggested (no problem in installing and
trying, as soon as I can ... but it's good to know that there is a way
to generate CMYK images using Python ... as I told it will be useful
to have these suggestions recorded on the Matplotlib web site).

If amongst the readers of this mailing list there are also some
Matplotlib developers, I'd like to say them that to have the CMYK
option incorporated into Matplotlib (for example like it is
incorporated into the MATLAB print command) will be a great
improvement.

I started using Python only because I wanted to stop using MATLAB.
I've found Python a lot more powerful than MATLAB on nearly all
aspects.

When someone like me has to make some publications and does not have a
lot of time to try tools, he will be discouraged in using Matplotlib
(and Python) and he will return to MATLAB again (and this is what
happened to me until now).

So, developers, please seriously consider adding this option to Matplotlib.

The first sentence of the web site is matplotlib is a python 2D
plotting library which produces publication quality figures. This is
true (I think they're better than Matlab figures) ... I only hope it
will be more easy in the future also to actually use those figures in
publications.

Thanks to all of you.

Kind regards,
Michele

2010/8/26 Jae-Joon Lee lee.j.j...@gmail.com:
 While not a full solution, I have been playing with a ps backend that
 saves images (and only images) in CMYK color.
 lcms is required for color transform.

 http://github.com/leejjoon/mpl_ps_cmyk

 For example,

 import mpl_toolkits.ps_cmyk
 plt.savefig(test_cmyk.eps, format=eps_cmyk)

 Regards,

 -JJ



 On Fri, Aug 27, 2010 at 6:12 AM, Robert Kern robert.k...@gmail.com wrote:
 On 8/26/10 3:26 PM, Fernando Perez wrote:
 On Thu, Aug 26, 2010 at 11:39 AM, Eric Firingefir...@hawaii.edu  wrote:
 It's not trivial.  This might help:

 http://www.littlecms.com/

 See the tutorial for some nice background info.

 And this could be a good start for a python-based workflow:

 http://www.cazabon.com/pyCMS/

 *if* it works (it looks old, so it may have bit-rotted in the meantime).

 Another option would be to ctypes-wrap the calls of littleCMS one
 needs just for this and be done with it.  Not very elegant, but it
 might get the OP out of a bind with minimal work, and he'd have a
 little eps2cmyk.py script he could run on his MPL-generated EPS files
 for colorspace conversion.  Just an afternoon hack.  :)

 You can also use my numpy-aware wrappers:

   http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/

 --
 Robert Kern

 I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it 
 had
  an underlying truth.
   -- Umberto Eco


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Michele De Stefano
http://www.linkedin.com/in/micdestefano
http://code.google.com/p/mds-utils
http://micheledestefano.xoom.it

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Michael Droettboom
matplotlib does not have any built-in support for any color spaces other 
than RGB.  You would need to use an external tool (if such a thing 
exists) to convert color spaces.

Mike

On 08/26/2010 10:06 AM, Michele De Stefano wrote:
 Is it possible to export EPS images with the CMYK color scheme ?

 There are several technical journals that require this format (for
 example Geophysiscs, one of the most important geophysical journals,
 The Leading Edge, and, I think, Geophysical Prospecting only to cite
 some of them).




-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Daπid
Image Magick and Inkscape seem to work for this. Probably the first
one is easier to automatize in batch processing.

On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom md...@stsci.edu wrote:
 matplotlib does not have any built-in support for any color spaces other
 than RGB.  You would need to use an external tool (if such a thing
 exists) to convert color spaces.

 Mike

 On 08/26/2010 10:06 AM, Michele De Stefano wrote:
 Is it possible to export EPS images with the CMYK color scheme ?

 There are several technical journals that require this format (for
 example Geophysiscs, one of the most important geophysical journals,
 The Leading Edge, and, I think, Geophysical Prospecting only to cite
 some of them).




 --
 Michael Droettboom
 Science Software Branch
 Space Telescope Science Institute
 Baltimore, Maryland, USA


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Michele De Stefano
Thanks.

I think it will be useful to have cookbook instructions to perform
this task on the Matplotlib web site.

Meanwhile, is there anyone that can provide those instructions, please
(I've not any of these tools installed yet, and I don't know them). ?

2010/8/26 Daπid davidmen...@gmail.com:
 Image Magick and Inkscape seem to work for this. Probably the first
 one is easier to automatize in batch processing.

 On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom md...@stsci.edu wrote:
 matplotlib does not have any built-in support for any color spaces other
 than RGB.  You would need to use an external tool (if such a thing
 exists) to convert color spaces.

 Mike

 On 08/26/2010 10:06 AM, Michele De Stefano wrote:
 Is it possible to export EPS images with the CMYK color scheme ?

 There are several technical journals that require this format (for
 example Geophysiscs, one of the most important geophysical journals,
 The Leading Edge, and, I think, Geophysical Prospecting only to cite
 some of them).




 --
 Michael Droettboom
 Science Software Branch
 Space Telescope Science Institute
 Baltimore, Maryland, USA


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Michele De Stefano
http://www.linkedin.com/in/micdestefano
http://code.google.com/p/mds-utils
http://micheledestefano.xoom.it

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Jonathan Slavin
This is starting to get off topic from matplotlib, but it is relevant to
creating good EPS figures...

When using ImageMagick to transform from to an EPS, your results will be
much improved by using the parameter -density 288.  This increases the
resolution (and thus results in a much bigger file).  I find this is
adequate for producing publication quality plots.

  Quick warning about ImageMagick and EPS files (and any other
  vector-based graphics format)...
  
  ImageMagick is a raster-based system.  When it loads a vector-based
  graphic, it implicitly rasterizes it, performs the requested
  operations, and then outputs the file format.  So, even if you
  output the result as a EPS file, you would have lost all
  vector-based info (like text and lines).  The result looks horrible.



--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Benjamin Root
On Thu, Aug 26, 2010 at 11:27 AM, Jonathan Slavin
jsla...@cfa.harvard.eduwrote:

 This is starting to get off topic from matplotlib, but it is relevant to
 creating good EPS figures...

 When using ImageMagick to transform from to an EPS, your results will be
 much improved by using the parameter -density 288.  This increases the
 resolution (and thus results in a much bigger file).  I find this is
 adequate for producing publication quality plots.


This is getting off-topic, but this is also something that I feel quite
strongly about.  There is no point in submitting an EPS file that comes from
ImageMagick for publication.  Because of the rasterization, you might as
well send them a PNG file.

There are a few reasons why publishers request vector-based graphics
formats.  First, they can change the font properties and the text of the
figure as needed.  If the image has been rasterized, they then have to edit
out the rasterized text and put in their own text.  Second, there are
various anti-aliasing techniques that can be utilized for text and lines as
one scales the image for different publishing mediums.  If you take your
high resolution rasterized eps file and try viewing the text when the figure
is scaled to a small size, and then try the same for an unrasterized eps
file, so long as your viewer is decent, the unrasterized image will remain
readable at smaller sizes than the high-resolution rasterized version.

Don't rasterize your vector images... your publications will thank you for
that!

/rant

On a related note, you *should* rasterize your pcolor() and imshow() using
rasterize=True in those function calls.  This will allow the image to be
rasterized to its native resolution, while still letting everything else in
the figure remain vector-based.  This results in beautiful plots with sane
file sizes.

Ben Root
--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Eric Firing
On 08/26/2010 05:49 AM, Benjamin Root wrote:
 On Thu, Aug 26, 2010 at 9:39 AM, Daπid davidmen...@gmail.com
 mailto:davidmen...@gmail.com wrote:

 Image Magick and Inkscape seem to work for this. Probably the first
 one is easier to automatize in batch processing.


 Quick warning about ImageMagick and EPS files (and any other
 vector-based graphics format)...

 ImageMagick is a raster-based system.  When it loads a vector-based
 graphic, it implicitly rasterizes it, performs the requested operations,
 and then outputs the file format.  So, even if you output the result as
 a EPS file, you would have lost all vector-based info (like text and
 lines).  The result looks horrible.

 I have been contemplating adding some sort of functionality like this
 for the various formats.  I recently ran into issues like this for an
 IEEE publication and had to resort to obtaining a copy of Adobe Acrobat
 Pro to fix up my images.  It would be nice if I could pass an option to
 .savefig() like 'use_cmyk=True' or something and be done with it.

It's not trivial.  This might help:

http://www.littlecms.com/

See the tutorial for some nice background info.

Eric


 Ben Root



 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d



 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Fernando Perez
On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing efir...@hawaii.edu wrote:
 It's not trivial.  This might help:

 http://www.littlecms.com/

 See the tutorial for some nice background info.

And this could be a good start for a python-based workflow:

http://www.cazabon.com/pyCMS/

*if* it works (it looks old, so it may have bit-rotted in the meantime).

Another option would be to ctypes-wrap the calls of littleCMS one
needs just for this and be done with it.  Not very elegant, but it
might get the OP out of a bind with minimal work, and he'd have a
little eps2cmyk.py script he could run on his MPL-generated EPS files
for colorspace conversion.  Just an afternoon hack.  :)

Regards,

f

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Christopher Barker
Fernando Perez wrote:
 http://www.littlecms.com/

PIL optionally uses littlecms -- so it may have what you need built in.

-Chris

NOTE: I haven't read the rest of this thread, to sorry if this is 
redundant information.



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Robert Kern
On 8/26/10 3:26 PM, Fernando Perez wrote:
 On Thu, Aug 26, 2010 at 11:39 AM, Eric Firingefir...@hawaii.edu  wrote:
 It's not trivial.  This might help:

 http://www.littlecms.com/

 See the tutorial for some nice background info.

 And this could be a good start for a python-based workflow:

 http://www.cazabon.com/pyCMS/

 *if* it works (it looks old, so it may have bit-rotted in the meantime).

 Another option would be to ctypes-wrap the calls of littleCMS one
 needs just for this and be done with it.  Not very elegant, but it
 might get the OP out of a bind with minimal work, and he'd have a
 little eps2cmyk.py script he could run on his MPL-generated EPS files
 for colorspace conversion.  Just an afternoon hack.  :)

You can also use my numpy-aware wrappers:

   http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth.
   -- Umberto Eco


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Jae-Joon Lee
While not a full solution, I have been playing with a ps backend that
saves images (and only images) in CMYK color.
lcms is required for color transform.

http://github.com/leejjoon/mpl_ps_cmyk

For example,

import mpl_toolkits.ps_cmyk
plt.savefig(test_cmyk.eps, format=eps_cmyk)

Regards,

-JJ



On Fri, Aug 27, 2010 at 6:12 AM, Robert Kern robert.k...@gmail.com wrote:
 On 8/26/10 3:26 PM, Fernando Perez wrote:
 On Thu, Aug 26, 2010 at 11:39 AM, Eric Firingefir...@hawaii.edu  wrote:
 It's not trivial.  This might help:

 http://www.littlecms.com/

 See the tutorial for some nice background info.

 And this could be a good start for a python-based workflow:

 http://www.cazabon.com/pyCMS/

 *if* it works (it looks old, so it may have bit-rotted in the meantime).

 Another option would be to ctypes-wrap the calls of littleCMS one
 needs just for this and be done with it.  Not very elegant, but it
 might get the OP out of a bind with minimal work, and he'd have a
 little eps2cmyk.py script he could run on his MPL-generated EPS files
 for colorspace conversion.  Just an afternoon hack.  :)

 You can also use my numpy-aware wrappers:

   http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/

 --
 Robert Kern

 I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth.
   -- Umberto Eco


 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users
 worldwide. Take advantage of special opportunities to increase revenue and
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users