Error in converting a PDF to a PNG in ImageMagick


I use Imagemagick convert to convert pdf file to png as follows:

Magick convert -density 300 PointOnLine.pdf -quality 90 PointOnLine.png

It gives warning:

convert: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `PointOnLine.png' @ warning/png.c/MagickPNGWarningHandler/1744.

And png image created is all black. However, convert to jpg image is fine. What is the problem? Thanks.

Best Answer

Try adding -colorspace RGB before the outfile name.

convert -density 300 PointOnLine.pdf -quality 90 -colorspace RGB PointOnLine.png
Related Question