TIFF-CMYK to TIFF-GRAY is distorted

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
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

TIFF-CMYK to TIFF-GRAY is distorted

Post by Carter J »

Hi All,

When I'm trying to convert TIFF-CMYK to TIFF-GRAY, the output image is distorted.

Command used:

convert -alpha off -strip -colorspace GRAY Original_CMYK.tif CMYK_TO_GRAY.tif

Below are the links for both input Image and output Image.

https://www.dropbox.com/s/002duowjsq7ga ... l_CMYK.tif

https://www.dropbox.com/s/jr4oqfde6k1qo ... O_GRAY.tif


ImageMagick Version:
ImageMagick 6.8.7-4 2013-10-26 Q16

Identify -verbose Original_CMYK.tif:

Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: PixelsPerInch
Type: ColorSeparation
Base type: TrueColor
Endianess: MSB
Colorspace: CMYK
Depth: 8-bit
Channel depth:
cyan: 8-bit
magenta: 8-bit
yellow: 8-bit
black: 1-bit
Channel statistics:
Cyan:
min: 0 (0)
max: 255 (1)
mean: 148.148 (0.580972)
standard deviation: 67.6683 (0.265366)
kurtosis: -1.41625
skewness: -0.415359
Magenta:
min: 0 (0)
max: 255 (1)
mean: 148.731 (0.583257)
standard deviation: 67.9919 (0.266635)
kurtosis: -1.44443
skewness: -0.430224
Yellow:
min: 0 (0)
max: 255 (1)
mean: 144.706 (0.567475)
standard deviation: 84.6112 (0.331809)
kurtosis: -1.55148
skewness: -0.465318
Black:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 110.396 (0.432926)
standard deviation: 63.955 (0.250804)
kurtosis: 2.17671
skewness: 0.0443737
Total ink density: 300%
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: cmyk(255,255,255,0)
Border color: cmyk(223,223,223,0)
Matte color: cmyk(189,189,189,0)
Transparent color: cmyk(0,0,0,0)
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 640x480+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Orientation: TopLeft
Properties:
date:create: 2014-01-16T18:20:17+06:00
date:modify: 2014-01-16T18:19:40+06:00
jpeg:sampling-factor: 2x2
signature: 6cc5c517a88d8dbf17a69d07a4ff5c4f922eaafddcb08663770d6c208b768df6
tiff:document: D:\12242013\Input\dec19mano2_CMYK.tif
tiff:endian: lsb
tiff:photometric: separated
tiff:rows-per-strip: 16
Artifacts:
filename: D:\16012014\TestCases\TestCase5\5_1_TIF_CMYK.tif
verbose: true
Tainted: False
Filesize: 94.6KB
Number pixels: 307K
Pixels per second: 15.36MB
User time: 0.016u
Elapsed time: 0:01.020
Version: ImageMagick 6.8.7-4 2013-10-26 Q16 http://www.imagemagick.org

Please suggest what is cause and how to resolve.

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

Re: TIFF-CMYK to TIFF-GRAY is distorted

Post by snibgo »

Try it with the commands in the correct order: read an image, process it, save it.

Code: Select all

convert Original_CMYK.tif -alpha off -strip -colorspace GRAY CMYK_TO_GRAY.tif
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: TIFF-CMYK to TIFF-GRAY is distorted

Post by Carter J »

Hi snibgo,

I tried with changing order of commands as you suggested, but still the output image is distorted.

Please suggest.

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

Re: TIFF-CMYK to TIFF-GRAY is distorted

Post by snibgo »

On v6.8.8-0 and v6.8.7-0, on Windows 8.1, this works fine for me. It isn't "negative". Is that what you mean by "distorted"?

Code: Select all

convert Original_CMYK.tif -alpha off -colorspace gray x.tif
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: TIFF-CMYK to TIFF-GRAY is distorted

Post by Carter J »

Previously I have uploaded some part of my tiff image. Please look into the below link for complete file.

https://www.dropbox.com/s/gtx0s1ew72nn1 ... F_CMYK.tif

Please try for this Tiff file

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

Re: TIFF-CMYK to TIFF-GRAY is distorted

Post by snibgo »

There is something funny about that file. IM thinks it is CMYK, but it isn't really. The pixels seem to be encoded as sRGB. This changes the metadata, and converts to gray:

Code: Select all

convert 5_1_TIF_CMYK.tif -set colorspace sRGB -colorspace Gray x.tif
snibgo's IM pages: im.snibgo.com
Post Reply