colorspace won't change

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
sebastien.mengin

colorspace won't change

Post by sebastien.mengin »

Hi,

I have to convert a batch of PDF files from RGB colorspace to Grayscale colorspace.

With the following command line,

Code: Select all

mogrify -compress None -type Grayscale -colorspace gray -density 600 *.pdf
I still see Colorspace: RGB in the output of identify -verbose (whereas Type and Base Type are ok) :

Type: Grayscale
Base type: Grayscale
Colorspace: RGB

Any hint to force Colorspace?

Thanks in advance,
S.
sebastien.mengin

Re: colorspace won't change

Post by sebastien.mengin »

Sorry, forgot to say, I'm running

Version: ImageMagick 6.5.7-8 2009-11-26 Q16

on ubuntu lucid lynx.

Cheers,
S.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: colorspace won't change

Post by Drarakel »

I think that "RGB" is correct. It always shows "RGB" for type grayscale. (But I hate to say that you can't take 'Type' and 'Base Type' as a clear indicator whether it's really stored as e.g. Grayscale or Truecolor.)
sebastien.mengin

Re: colorspace won't change

Post by sebastien.mengin »

Thanks for your answer.
What I want is to be sure at 100% that the files processed this way will be ok at the printshop, who prints my books in grayscale.
Any risk that the RIP complains because this "Colorspace: RGB" infos?

Cheers,
S.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: colorspace won't change

Post by snibgo »

I think the "identify -verbose" field "colorspace" refers to the meaning of the three or four colour channels that IM uses, so this will be "RGB", "CMYK", etc.

You should check your files with your printshop. They may be fussy and want CMYK files, even for greyscale.
snibgo's IM pages: im.snibgo.com
sebastien.mengin

Re: colorspace won't change

Post by sebastien.mengin »

snibgo wrote:I think the "identify -verbose" field "colorspace" refers to the meaning of the three or four colour channels that IM uses, so this will be "RGB", "CMYK", etc.

You should check your files with your printshop. They may be fussy and want CMYK files, even for greyscale.
Good idea, thanks for this advice.

Still, the point is that I think there's a mismatch between the -colorspace option for the convert command and the field Colorspace we can see with the identify command.

To my opinion, if I ask

Code: Select all

convert -colorspace Gray
, identify should return

Code: Select all

Colorspace: Grayscale
.

If not, what is the purpose of the Gray keyword proposed in the doc?
http://www.imagemagick.org/script/comma ... colorspace

Thanks again.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: colorspace won't change

Post by snibgo »

Yes, the "colorspace" command and "colorspace" verbose output are two different things. It is confusing. Ideally they would have different names.

"convert in.png -colorspace Gray out.png" will create a greyscale PNG. When that file is read by "identify -verbose out.png", IM will create 3 channels, which will be RGB.
snibgo's IM pages: im.snibgo.com
codymparnell
Posts: 1
Joined: 2011-10-27T12:44:40-07:00
Authentication code: 8675308

Re: colorspace won't change

Post by codymparnell »

convert original.jpg -colorspace Gray new-new.jpg

The above command works great for me as long as I have cd'd into the dir I want to make the conversions in
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: colorspace won't change

Post by fmw42 »

the important information from the verbose info is the TYPE. As long as type=grayscale even if colorspace is RGB, you should be fine, as I understand it. Though I could be wrong.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: colorspace won't change

Post by anthony »

sebastien.mengin wrote:With the following command line,

Code: Select all

mogrify -compress None -type Grayscale -colorspace gray -density 600 *.pdf
WARNING: IM should not generally be used to convert PDF to PDF as these are vector images!!!

A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply