Question about color-type command ?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Posts: 1
Joined: 2019-03-09T00:49:17-07:00
Authentication code: 1152

Question about color-type command ?

Post by jupitersea »

What commands can I use in Imagick to replicate this:

-define png:color-type=2


User avatar
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Question about color-type command ?

Post by fmw42 »

It depends upon the image you have. If it is already RGB color, then nothing. If it is grayscale and you want to make it RGB, then simply add PNG24: as a preface to your output image.

Code: Select all

convert grayscale.suffix ...  PNG24:rgb.png


Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at ... f=1&t=9620

If using Imagemagick 7, then see

For novices, see ... f=1&t=9620 ... essing.php