0

We recently installed the latest version of ImageMagick onto our Linux server. I seem to be having issues performing the most basic of tasks.

I am running this command line:

/usr/bin/convert /location/to/source/design.ai /location/to/save/output.jpg

Unfortunatly is saves design.jpg as an illustrator file (if I rename the file to output.ai it opens). Even if I do this:

/usr/bin/convert /location/to/source/design.ai -rotate 90 /location/to/save/design.jpg

It rotates the file and saves again as an illustrator document. This happens with all filetypes (e.g. png, bmp, etc...)

It appears ImageMagick cannot figure out what I want it converted to and just saves as the same file type.

Any ideas on fixing this?

Regards:

John

4 Answers4

1

Are you sure ImageMagick supports Illustrator files? That's a proprietary format that isn't supported by any programs outside of the the Adobe family AFAIK. I would be very surprised if ImageMagick supported it. It's also not listed on the ImageMagic supported formats page.

Try saving as a PDF, SVG, or any of the supported formats before you pass it to ImageMagick.

Edit:

There appears to be a way to read/manipulate AI files using ImageMagick, but this comes with the proviso that the AI file must be saved with PDF compatibility. If not, it will not work, as ImageMagick by default is configured to read AI files using its PDF coder. Though that isn't to say that someone can't write a custom AI coder for it. However, I've yet to see one and it would be difficult given that AI itself is a closed format (even the latest version of QuarkXpress has imperfect AI support).

Lèse majesté
  • 359
  • 1
  • 2
  • 11
  • That's probably the problem. Apparently Adobe Illustrator files look like PDF files , but are not. That's why ImageMagick does not complain when reading them, but fails to convert them properly. – sleske Jun 20 '10 at 23:15
  • That makes sense. Illustrator files do have a PDF compatibility mode, but it's not a standardized format and changes from version to version. It also supports a super-set of features that are not present in the PDF specification. – Lèse majesté Jun 21 '10 at 00:47
  • ImageMagick does support AI files. – Unkwntech Aug 13 '10 at 22:49
  • @Unkwntech: upon more research, it does seem that people are successfully using ImageMagick to manipulate illustrator files, despite the fact that it's not listed in the supported formats page. At first I thought maybe someone wrote a custom coder for it, but looking at the sample `coder.xml`, it looks like they're just using the PDF coder (see sleske's comments). However, this only works with AI files that are saved with PDF compatibility. So either the OP did not save his AI file with PDF compatibility, or he is missing the AI entry in his `coder.xml`. – Lèse majesté Aug 24 '10 at 05:43
0

Try with the density option:

/usr/bin/convert -density 150 /location/to/source/design.ai /location/to/save/output.jpg

You can play with the density (72, 300...) and see if it gives you any result.

Also you can try:

/usr/bin/convert /location/to/source/design.ai[0] /location/to/save/output.jpg
/usr/bin/convert -density 150 /location/to/source/design.ai[0] /location/to/save/output.jpg
Weboide
  • 3,275
  • 1
  • 23
  • 32
0

Make sure you have the latest version of Ghost Script and double-check the method you're using to save the Illustrator Documents. They should be PDF-compatible. You might also want to try saving them to PDFs and EPS files directly, running the conversion process on those documents and seeing what happens.

rooney
  • 156
  • 5
  • Thanks Pender: It is the same with trying to convert png to jpg files. Would this fact eliminate your GhostScript suggestion? –  Nov 23 '09 at 22:44
  • Yes, since GhostScript is related to the PDF portion. – rooney Nov 24 '09 at 00:57
0

Try this:

/usr/bin/convert /location/to/source/design.ai JPEG:/location/to/save/output.jpg

As per http://www.imagemagick.org/Usage/files.

Massimo
  • 68,714
  • 56
  • 196
  • 319
  • I just tried that and it does not output anything at all when added. –  Nov 23 '09 at 22:44