Automate Photoshop to insert text from file

狂风中的少年 提交于 2019-12-03 00:29:47

You can use "Data Driven Design" to do this. There is also a concept of data driven design in computer science, but as far as I can see this is not not related to the use of the word in Photoshop.

Here is how to proceed:

Load your image in Photoshop and define your variables with Image > Variable > Define.

Then convert your csv to a format Photoshop can read. I had the best experiences with tab delimted text.

Finally load the text file in Photoshop with Images > Variables > Data Set and let Photoshop save all iterations.

When I tried this first, I found that the Photoshop help file didn't provide enough details. I searched the Internet for photoshop "data set" and found some good tutorials, e.g. this one from digitaltutors.

It might be little bit off too much, but I have used Adobe AlterCast/Grphics server to handle exactly same issue.

Also if its just Text GIF/JPG image, you can use Python+PIL (Python Imaging Library). Here is a sample code (works on Windows OS with Arial and Osaka fonts installed.)

#!/usr/bin/python
# -*- coding: utf-8 -*-
import ImageFont, ImageDraw, Image
#font = ImageFont.truetype("/usr/share/fonts/bitstream-vera/Vera.ttf", 24)
#font = ImageFont.truetype("futuratm.ttf", 18)
font = ImageFont.truetype("arial.ttf", 18)
im = Image.new("RGB", (365,20), "#fff")
draw = ImageDraw.Draw(im)
draw.text((0, 0), "Test Images", font=font, fill="#000")
im.save("TestImg_EN.gif", "GIF")


font = ImageFont.truetype("osaka.ttf", 18)
im = Image.new("RGB", (365,20), "#fff")
draw = ImageDraw.Draw(im)
draw.text((0, 0), u"テストイメージ", font=font, fill="#000")
im.save("TestImg_JP.gif", "GIF")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!