Error converting images to Imagemagick

I use Imagemagick conversion to convert a PDF file to png as follows:

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

This gives me the following warning:

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

And the created png image is completely black. However, converting to a jpg image is fine.

Update: after adding the -define: skip = ICC profile, the image is still dark. But if you convert to jpg and then to png, this is normal, but the background is dark. The same warning still exists. What is the problem? Thank.

+4
source share
3 answers

ImageMagick 7.0.7.22 Q16 Mac OSX Sierra Ghostscript 9.21 libpng @1.6.34_0. PDF -, .

magick -density 300 PointOnLine.pdf -flatten -quality 90 result.png

, - png, , :

magick -density 300 PointOnLine.pdf -quality 90 result2.png

, IM 7 , .

, Ghostscript libpng, .

delegates.xml PS: alpha sDEVICE = pngalpha, pnmraw .

<delegate decode="ps:alpha" stealth="True" command="&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pngalpha&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>

, !

+1

, ImageMagick Windows, ( IM, Win )

Ubuntu 16.04 LTS, , , . ( Win, Magick).

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

, , . , , .

  • PDF RGB, png.

    convert -density 300 -colorspace RGB PointOnLine.pdf PointOnLine_rgb.pdf
    convert -density 300 PointOnLine_rgb.pdf PointOnLine_rgb.png
    
+1

PDF , . , , CMYK, PNG .

magick -quiet -density 300 -colorspace srgb PointOnLine.pdf -quality 90 PointOnLine.png


, IM 7 , . , PNG , JPG. . https://www.imagemagick.org/script/command-line-options.php#quality

0

Source: https://habr.com/ru/post/1693205/


All Articles