ai 2 jpg
May 31, 2006 9:27 PM   Subscribe

Is there anyway to batch convert Adobe Illustrator CS2 files into hi-res RGB Jpg files?

I have, oh, 100-200 ai files I'd like to convert into 300dpi Jpeg files.

I've scoured the net on seeing if there is an action I could write in Pshop (cs2) or in Illustrator but I've had no success.

Does anyone know how to write a command to do this AND/OR a piece of software that would do this?
posted by Hands of Manos to Computers & Internet (21 answers total)
 
You could make a droplet.
posted by tumult at 9:33 PM on May 31, 2006


Are you on Mac or Windows? Either way, Illustrator can be automated with outside software that uses the Illustrator Scripting API to programmatically do the batch conversion. I have something like that that I wrote for work in my office, as a matter of fact. It may even be exactly what you're asking for. Let me go look for it.
posted by evariste at 9:34 PM on May 31, 2006


I've never used it with Illustrator files, but for batch image format conversions I use Debabelizer.
posted by subtle_squid at 9:37 PM on May 31, 2006


Best answer: Here's a tiny (20k) exe that will prompt you for a folder of AI files, and then convert them to JPEGs. You should start Illustrator before you run it, or else Illustrator will run invisibly in the background and you won't see what's happening. Source code available on request (it's only about 10 lines of code), but you need MS Visual Basic to run it so I figured I'd save you the trouble by compiling it into an exe. Let me know when you have it so I can delete it.
posted by evariste at 10:08 PM on May 31, 2006


It works with Illustrator CS2 only, so users of earlier versions, this is no use to you.
posted by evariste at 10:09 PM on May 31, 2006


Best answer: You might need to install this as well if the Microsoft Scripting Runtime (scrrun.dll) isn't present on your machine.
posted by evariste at 10:12 PM on May 31, 2006


Response by poster: I'm on windows. Man, I really really wanted that droplet to work but alas, it didn't work.
posted by Hands of Manos at 10:24 PM on May 31, 2006


Response by poster: Evariste, other than NOT converting it to hi-res, this is ace! thanks man!
posted by Hands of Manos at 10:40 PM on May 31, 2006


And here's the Illustrator CS2 Scripting Guide, so you can learn how to write this kind of one-off tool for yourself if you're so inclined. You don't need to spend any money on it, just time and willingness to learn (and the free Windows Scripting Host).
posted by evariste at 10:43 PM on May 31, 2006


Hands of Manos-ah, so it needs a bit of tweaking. 300 dpi, eh? I don't have time tonight to tweak it because I have a few things I need to get done, so I can either: give you the source code so you can experiment for yourself tonight, or if this isn't a pressing matter, I can work on it tomorrow a bit more.
posted by evariste at 10:46 PM on May 31, 2006


Response by poster: Evariste,

Yes I'm patient and am in now hurry. Since questions get buried quickly, you can email me here:

scott.thigpen AT gmail

Thank you again, this is MOST appreciavtive

(and 300dpi RGB not CMYK)
posted by Hands of Manos at 10:55 PM on May 31, 2006


Response by poster: now = no.

my brain went poo for a moment
posted by Hands of Manos at 10:56 PM on May 31, 2006


Excellent, will email you tomorrow!
posted by evariste at 11:00 PM on May 31, 2006


Tumult: That droplet feature is great, never seen that before. Re: "I'm not changing the resolution because I'm going to save it out as a JPEG, which is automatically converted to 72dpi"
Is it just my photoshop that does not convert res automatically to 72 dpi when doind "save as" jpeg, or is this statement just plain incorrect?
posted by 5bux at 11:19 PM on May 31, 2006


I'll post the finished code in this thread tomorrow for the benefit of anyone who might come across this in the future, I guess.
posted by evariste at 11:22 PM on May 31, 2006


5bux, you're right, that statement is incorrect. PS can save JPGs at any res, and I for one have never been able to save a JPG using "Save" or "Save As" without being prompted for a resolution, so I doubt there's some default feature I'm not aware of. Now, if you "Save for web" it automatically saves at 72 dpi, but it doesn't look like that's what he's done there.

evariste and tumult - thanks for the tips. it's always amazing to me how much more there is to learn in PS and Ill, despite the fact that I've been using them almost daily for over 12 years...
posted by ab3 at 5:31 AM on June 1, 2006


From what I can tell, illustrator uses a tweaked but well-documented EPS for its file format. So you should just be able to do it with Image Magick (With Ghostscript of course).
posted by KirkJobSluder at 8:30 AM on June 1, 2006


Just a follow-up: this did the trick for a directory of .ai files I had.

for f in `basename -s .ai *.ai`; do
convert -verbose -density 150 $f.ai $f.png ;
done


The -density flag lets you set the pixels per inch. ImageMagick identifies Illustrator CS files as pdf. However, my version does not capture complex shading and effects.

Photoshop will also do the trick as a batch job with more accurate rendering of effects. Just record an action to save for web and let it rip. Photoshop batch automation skips the save file dialog.
posted by KirkJobSluder at 10:59 AM on June 1, 2006


KirkJobSluder-I'm well versed in ImageMagick but it would never have occurred to me to try that! (Even though identify might have told me that ImageMagick thinks AIs are PDFs, it just never occurred to me to try it). Fantastic, thanks!

Hands of Manos, if you want to run ImageMagick on your Windows PC, it runs very well in Cygwin. I'll still hook you up later today with the other thing though, since as KJS mentioned, imagick doesn't capture some more complex effects very well.
posted by evariste at 2:29 PM on June 1, 2006


Whoops. My link above goes to the Photoshop CS2 Scripting Guide. Here's a link to the Illustrator one. There's a different guide for each of the languages JavaScript, AppleScript, and VB.
posted by evariste at 4:50 PM on June 1, 2006


Hands of Manos: here's a new version with a few more options. Unfortunately, contrary to Adobe's documentation, the Document.OutputResolution property is read-only, not read-write, so I had to disable that part of the tool. I only discovered this through trial and error. However,
if you leave the new Quality slider I added at 100%, the strange artifacts of the compression vanish. I didn't really test at any other Quality settings, but feel free to experiment until you're happy. Another thing I added to it is a rescaling slider; this way you can create thumbnails (or alternatively, blow it up; up to 400% at the moment, but I can increase that).

All the other new options I added were pretty self-explanatory, but if you have any questions feel free to ask me.
posted by evariste at 8:26 PM on June 1, 2006


« Older Are there live webcasts for the World Cup?   |   Frequent flyer miles on the Vomit Comet. Newer »
This thread is closed to new comments.