CMYK images

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).

···

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

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

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 <mdroe@...86...> 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
matplotlib-users List Signup and Options

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 <davidmenhur@...287...>:

···

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 <mdroe@...86...> 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
matplotlib-users List Signup and Options

------------------------------------------------------------------------------
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
matplotlib-users List Signup and Options

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

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.

Ben Root

···

On Thu, Aug 26, 2010 at 9:39 AM, Daπid <davidmenhur@…2015…87…> wrote:

Image Magick and Inkscape seem to work for this. Probably the first

one is easier to automatize in batch processing.

    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:

See the tutorial for some nice background info.

Eric

···

On 08/26/2010 05:49 AM, Benjamin Root wrote:

On Thu, Aug 26, 2010 at 9:39 AM, Daπid <davidmenhur@...287... > <mailto:davidmenhur@…287…>> wrote:

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
matplotlib-users List Signup and Options

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. :slight_smile:

Regards,

f

···

On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing <efiring@...202...> wrote:

It's not trivial. This might help:

http://www.littlecms.com/

See the tutorial for some nice background info.

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/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

You can also use my numpy-aware wrappers:

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

···

On 8/26/10 3:26 PM, Fernando Perez wrote:

On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<efiring@...202...> 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:

pyCMS - ICC Color Management interface for the Python Imaging Library (PIL)

*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. :slight_smile:

--
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

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.

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.kern@...287...> wrote:

On 8/26/10 3:26 PM, Fernando Perez wrote:

On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<efiring@...202...> 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:

pyCMS - ICC Color Management interface for the Python Imaging Library (PIL)

*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. :slight_smile:

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
matplotlib-users List Signup and Options

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.joon@...287...>:

···

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.

GitHub - leejjoon/mpl_ps_cmyk: matplotlib postscript backend w/ images in cmyk colorspace.

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.kern@...287...> wrote:

On 8/26/10 3:26 PM, Fernando Perez wrote:

On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing<efiring@...202...> 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:

pyCMS - ICC Color Management interface for the Python Imaging Library (PIL)

*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. :slight_smile:

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
matplotlib-users List Signup and Options

------------------------------------------------------------------------------
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
matplotlib-users List Signup and Options

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