Skip to main content
nanui10361275
Participant
August 10, 2017
Question

Saving non-Anti-Aliased PNGs from Illustrator

  • August 10, 2017
  • 1 reply
  • 2357 views

We have many EPS files which we want to process into very precise bitmap formats.

I have a square artboard (and man, was generating that automatically a scripting exercise far in advance of how complex it should be...) that I would like to export with no anti-aliasing.

Doing this via File-->Export-->Save For Web (Legacy) generates a correctly non-anti aliased bitmap provided that you set the anti-aliasing dropdown to "none".

Doing the same thing by seting pngExportOptions.antiAliasing to false, then calling doc.exportFile demonstrably produces an anti-aliased image.

You can waste more time by messing around with ExportOptionsTIFF in the misguided belief that it's "AntiAliasingMethod.None" might do the trick. It doesn't appear to do anything either.

There is, of course, an unanswered, 2 year old question about this as the top hit on google.

Side note, we have experimented for some time over the past years with using the "professional" tools photoshop and illustrator to handle our scripted bitmap and vector image processing, instead of using ghostscript, pyimage, imagemagick, etc, and I have to conclude that their scripting support is just a complete joke.

What am I missing, aside from the fact that I'm wasting my time trying to use a "professional" solution?

This topic has been closed for replies.

1 reply

nanui10361275
Participant
August 10, 2017

I see you can also waste your time playing with doc.imageCapture() and ImageCaptureOptions, which will get you a non-antialiased PNG, but if you want to output, say, a 16384-sq PNG from a relatively small image, you'll exceed the supported resolutions. I'm sure I could rescale the image, but really, this has been an extended experiment in using an adobe-based pipeline for our images that I consider a failure.

nanui10361275
Participant
August 11, 2017

I tried using Photoshop instead, just for shits and giggles and because I thought shouting into a manhole was fun, and realized that since you can't explicitly specify final image dimensions on the PDFOpenOptions, you get some incorrectly sized images. E.g. attempting to open an image into a 16384-sq image resulted in 16381-sq image being generated in photoshop, eventhough I'm pretty sure I've calculated the resolution correctly based on the document's width (I open the document once up front to check that.)

I don't think using Adobe tools in an engineering workflow is a very good idea.

Silly-V
Legend
August 11, 2017

Okay we feel your pain, yes this seems to be quite an issue. The SFW dialog seems to not really persist with its options either, between AI sessions.

Anyway, but not all hope is lost! Using writing of dynamic actions, you can keep writing actions for Illustrator to use in its Actions panel, so that your SFW format that works for you may work!

Check this thread out for the description of the cumbersome-yet-necessary dynamic Actions workaround:

Creating a dynamic action to use with app.doScript() method.