开发者

Script to Cut Adobe Illustrator File into Tiles

开发者 https://www.devze.com 2023-01-05 23:28 出处:网络
I\'m creating a Custom Google M开发者_Go百科ap based on an image in an Adobe Illustrator file.I need to cut the file into 256px x 256px PNGs to feed into the Google Maps API.

I'm creating a Custom Google M开发者_Go百科ap based on an image in an Adobe Illustrator file. I need to cut the file into 256px x 256px PNGs to feed into the Google Maps API.

You can write scripts to automate tasks in Illustrator using ExtendScript, a modified version of JavaScript. I found one example of a script for Photoshop that makes tiles for Google Maps (Hack #68 in this book) but I haven't figured out how to port this over to Illustrator.

The main problem is I can't figure out how to tell Illustrator to isolate 256px x 256px portions of an image. The Photoshop script does this by selecting portions of the image of that size and copying them into a new file, but as far as I know you can't do that in Illustrator.

Any ideas?


I've got no experience writing scripts for Adobe products, but since Illustrator handles vector data, the tiling algorithm is slightly different. There is a Python script for MS VisualEarth that tiles a set of GPS points (demo), maybe you can take some ideas from it.

Another choice may be to (programatically?) render .AI files to .PNG or something similar an then tile it into 256x256px tiles using that PS hack you referenced.

0

精彩评论

暂无评论...
验证码 换一张
取 消