Color profile for Gray images

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
HaroldWindt
Posts: 11
Joined: 2015-06-02T05:04:29-07:00
Authentication code: 6789

Color profile for Gray images

Post by HaroldWindt »

Currently in my conversion I am using the below profile based on color mode

RGB to CMYK (when the input image also doesnt have any color profile)
convert -alpha off -units pixelsperinch 300 Test_RGB_2901_1.jpg[0] -profile "sRGB Color Space Profile" -profile USWebCoatedSWOP.icc Test_CMYK_2901_1.jpg

Default RGB Color Profile - sRGB Color Space Profile.icm
Default CMYK Color Profile - USWebCoatedSWOP.icc
Default Gray Color Profile - ??

For RGB or CMYK converstion to Gray instead of color mode I want to use a color profile as I mentioned above in RGB to CYMK conversion

Does Gray color has a ICC color profile that I can use ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color profile for Gray images

Post by snibgo »

Any color profile can be used with grayscale images. Does that answer the question?
snibgo's IM pages: im.snibgo.com
HaroldWindt
Posts: 11
Joined: 2015-06-02T05:04:29-07:00
Authentication code: 6789

Re: Color profile for Gray images

Post by HaroldWindt »

snibgo wrote:Any color profile can be used with grayscale images. Does that answer the question?
Let me rephrase my question

convert -alpha off -units pixelsperinch 300 Test_RGB_2901_1.jpg[0] -profile "sRGB Color Space Profile" -profile <GrayProfile??> Test_Gray_2901_1.jpg

So which color profile I can use to convert my rgb image to gray instead of using -colorspace I want to use -profile
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color profile for Gray images

Post by snibgo »

I haven't seen color profiles that will convert to CMYK grayscale. I have seen profiles that will convert to sRGB grayscale, so you could convert via one of these and then to CMYK.

Or you could use one of the many other methods to convert to sRGB grayscale, then convert the profile to CMYK.
snibgo's IM pages: im.snibgo.com
HaroldWindt
Posts: 11
Joined: 2015-06-02T05:04:29-07:00
Authentication code: 6789

Re: Color profile for Gray images

Post by HaroldWindt »

snibgo wrote:I haven't seen color profiles that will convert to CMYK grayscale. I have seen profiles that will convert to sRGB grayscale, so you could convert via one of these and then to CMYK.

Or you could use one of the many other methods to convert to sRGB grayscale, then convert the profile to CMYK.
Let me try rephrasing my question...

Requirement is to convert a file from RGB to GRAY

Input file Name - Test_2901_1.jpg (It can be RGB or CMYK image)
Output file Name - Test_Gray_2901_1.jpg (output should be GRAY)

The below command works
convert Test_2901_1.jpg[0] -colorspace GRAY Test_Gray_2901_1.jpg

But is there a way to use -profile instead of -colorspace to get the desired GRAY output image

convert Test_2901_1.jpg[0] -profile <GrayProfile?> Test_Gray_2901_1.jpg
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Color profile for Gray images

Post by snibgo »

If you want the image to be sRGB grayscale, yes, you can use a profile that will convert to sRGB grayscale. I have seen these around, but I don't have any links. Sorry.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Color profile for Gray images

Post by fmw42 »

Post Reply