Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Creating your own backgrounds with Adobe Photoshop Scripting

Some Photoshop versions ago (actually I can’t tell which Photoshop version featured scripting first) Adobe developed the capability of executing scripts inside Photoshop.

A script is a series of commands that tells Photoshop to perform a set of specified actions, such as applying different filters to selections in an open document. These actions can be simple and affect only a single object, or they can be complex and affect many objects in a Photoshop document. The actions can call Photoshop alone or invoke other applications.

Scripts automate repetitive tasks and are often used as a creative tool to streamline tasks that might be too time consuming to do manually. For example, you could write a script to generate a number of localized versions of a particular image or to gather information about the various color profiles used by a collection of images.

My case was a bit different: I was looking for a background full of numbers to use in the enhanced version of my Flash math game in less than 2KB so I started googling a bit until I stumbled upon a series of images like these ones:

I wanted something like that but all images I found were taken from sites like Depositphotos or similar sites so I told to myself: “are they really charging for some stuff I can do in a couple of minutes”? And I decided to create a Photoshop script to do something similar on my own.

Let me show you how i managed to do a background with numbers:

First, Photoshop lets you choose the language you prefer among VBScript, AppleScript and JavaScript. I used JavaScript because it’s the only one working both on Windows and Apple machines.

Then, Adobe provides a tool called ExtendScript Toolkit you can find in your Program Files -> Adobe -> Adobe Utilities folder and which allows you to test your scripts on the fly, but you can use your favourite text editor as long as you save your scripts with jsx extension then load them in Photoshop with File -> Scripts -> Browse.

So, I made a script to write 1000 random numbers in random positions with a random color and a random alpha, with this script:

And once executed here’s an example of what I got:

numberz

Now I am able to make virtually any kind of numbers-letters background in a matter of seconds.

Download the source code and the resulting PSD.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.20 out of 5)
Loading...Loading...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 3 comments

  1. Bojan

    on November 12, 2013 at 9:07 am

    Thanks for the script. I tested it and it works but also it takes some time. Scripted Patterns is one of amazing features in Photoshop which is usually overlooked by users. I am about to go beyond actions and variables and scripting patterns can be good starting point. Thanks for highlighting this feature and Photoshop capabilities.

  2. CoderGuy

    on December 6, 2013 at 9:58 am

    Thanks for the script, i have linked to the article on my new blog :)

  3. John

    on April 26, 2014 at 8:30 pm

    Thank you for the script Mr. Emanuele. Im still new in photoshop and this article helped me.

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×