convert black PNG to JPG forces a wrong colorspace (grayscal

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
Kenan

convert black PNG to JPG forces a wrong colorspace (grayscal

Post by Kenan »

When I try to convert a PNG file (completely black, but as RGB 24bit)
I always get a JPG in grayscale:

my command line:

convert test.PNG -type TrueColor test.JPG

I also tried:
convert test.PNG -colorspace RGB test.JPG

IM 6.3.5 Q16 on WinXP / WinXP64


The verbose line:

test.png=>Z:\test.jpg PNG 4096x4096 4096x4096+0+0 DirectClass 8-bit 64.1563kb 1.188u 0:02

Is this a bug, or am I to stupid to figure out the right options for the conversion?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert black PNG to JPG forces a wrong colorspace (grayscal

Post by anthony »

No IM is just trying to be 'smart'. Perhaps too smart when a -type has been defined!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Kenan

Re: convert black PNG to JPG forces a wrong colorspace (grayscal

Post by Kenan »

.. and is there a way to bring IM to do what I want ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert black PNG to JPG forces a wrong colorspace (grayscal

Post by magick »

We include logic to produce a JPEG RGB image type when the -type option is used but we had an extraneous break statement probably due to a cut-n-paste error that prevented the code from being exercised. The problem is fixed in ImageMagick 6.3.5-4 Beta available sometime tommorrow.
Post Reply