tiff -> jpeg colorspace issue (-type option ignored)

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
kjbbb
Posts: 3
Joined: 2012-11-28T09:37:13-07:00
Authentication code: 6789

tiff -> jpeg colorspace issue (-type option ignored)

Post by kjbbb »

The input image is a grayscale TIFF file. I am trying to convert it to a 3 channel RGB JPEG.

Reproducible in these two versions on both Darwin and Linux:

Code: Select all


Darwin 12.1.0 Darwin Kernel Version 12.1.0: root:xnu-2050.9.2~1/RELEASE_X86_64 x86_64

Version: ImageMagick 6.8.0-2 2012-11-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:  OpenCL   

Code: Select all


Linux 2.6.39-gentoo-r3-ps #3 SMP x86_64 Intel(R) Xeon(R) CPU E31220 @ 3.10GHz GenuineIntel GNU/Linu

Version: ImageMagick 6.7.8-7 2012-07-31 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

Input image:

Code: Select all

Image: in.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 4781x3942+0+0
  Resolution: 500x500
  Print size: 9.562x7.884
  Units: PixelsPerInch
  Type: Grayscale
  Base type: Grayscale
  Endianess: MSB
  Colorspace: Gray
  Depth: 8-bit
  Channel depth:
  gray: 8-bit
Convert command:

Code: Select all

convert in.tif -type truecolor out.jpg
Output image:

Code: Select all

Image: out.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: PseudoClass
  Geometry: 4781x3942+0+0
  Resolution: 500x500
  Print size: 9.562x7.884
  Units: PixelsPerInch
  Type: Grayscale
  Base type: Grayscale
  Endianess: Undefined
  Colorspace: Gray
  Depth: 8-bit
  Channel depth:
    gray: 8-bit
The colorspace should be RGB with 3 channels, but instead it is still grayscale.

If I convert it to another tiff with -type TrueColor, it produces the expected RGB image with 3 channels.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff -> jpeg colorspace issue (-type option ignored)

Post by fmw42 »

just an untested suggestion since you have not posted your image to test. try

convert image.tif -set colorspace RGB -type truecolor output.jpg

or

convert image.tif -colorspace RGB -type truecolor output.jpg
Post Reply