4

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.

5

The documentation says this:

PNG RW Portable Network Graphics Requires libpng-1.0.11 or later, libpng-1.2.5 or later recommended. The PNG specification does not support pixels-per-inch units, only pixels-per-centimeter. To avoid reading a particular associated image profile, use -define profile:skip=name (e.g. profile:skip=ICC).

So try adding -define profile:skip=ICC (or skip="*") before the outfile name.

See also: documentation on the define command

  • No, after setting -define profile:skip=ICC, image is still dark. But if convert to jpg and then to png, it is ok, but background is dark. The same warning happens. – Math Wizard Feb 7 '18 at 18:19
1

Try adding -colorspace RGB before the outfile name.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.