Not able to convert AI to PNG with transparent background with original image quality

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
9_ahmad
Posts: 4
Joined: 2015-12-14T05:58:28-07:00
Authentication code: 1151

Not able to convert AI to PNG with transparent background with original image quality

Post by 9_ahmad »

Hi Every One,

Please help me out to convert AI to file to PNG with original image quality, I checked many blog in that few can convert transparent background but it also down image quality.

So please help me…  :(
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by fmw42 »

Please do not post the same question to multiple forums.

You are not helping with such little information.

What IM version and platform? Post your results from

Code: Select all

convert -version
Post your AI file to some place such as dropbox.com and put the URL here.

Please read viewtopic.php?f=1&t=9620
9_ahmad
Posts: 4
Joined: 2015-12-14T05:58:28-07:00
Authentication code: 1151

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by 9_ahmad »

IM version - 6.8.6
platform - windows

file link : https://www.dropbox.com/s/c1n2ndv1uju5j ... AI.ai?dl=0


i got following script when used - verbose command
  • [ghostscript library] Files/gs/gs9.18/bin/gswin64c.exe" -q -dQUIET -dSAFER -dBAT
    CH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-
    sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFi
    le=D:/Users/afsarahmad.k/AppData/Local/Temp/magick-8412oxFrqg1onLcj%d" "-fD:/Use
    rs/afsarahmad.k/AppData/Local/Temp/magick-8412L7oxM3hfQxvW" "-fD:/Users/afsarahm
    ad.k/AppData/Local/Temp/magick-8412bVVs1Dru0cq3"D:/Users/afsarahmad.k/AppData/Lo
    cal/Temp/magick-8412oxFrqg1onLcj1 PNG 595x842 595x842+0+0 8-bit sRGB 46.7KB 0.01
    6u 0:00.019
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by magick »

Try this command:
  • convert -colorspace sRGB TEST\ AI.ai test.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by fmw42 »

I renamed your file to TEST_AI.png to avoid the space in the filename and the following works fine for me on IM 6.9.2.8 Q16 Mac OSX with Ghostscript 9.10

Code: Select all

convert -colorspace sRGB TEST_AI.ai TEST_AI.png

What is your version of Ghostscript?

gs --version


This also works by quoting the filename.

Code: Select all

convert -colorspace sRGB "TEST AI.ai" "TEST AI.png"

Note your file is CMYK and should be converted to sRGB as above or with profiles, since PNG does not support CMYK
9_ahmad
Posts: 4
Joined: 2015-12-14T05:58:28-07:00
Authentication code: 1151

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by 9_ahmad »

thanks it work for me :-)
should i use same for PSD file?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by fmw42 »

Yes, if the PSD file is CMYK, then use the same -colorspace sRGB before reading in the PSD file.
9_ahmad
Posts: 4
Joined: 2015-12-14T05:58:28-07:00
Authentication code: 1151

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by 9_ahmad »

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

Re: Not able to convert AI to PNG with transparent background with original image quality

Post by fmw42 »

Actually if the ai or pdf file is already sRGB, it should not hurt to add colorspace sRGB before reading in the file. Same for any vector format file.
Post Reply