Sequence of images of numbers
May 26, 2016 3:21 AM   Subscribe

I'm looking for a pack of images, each one of a number from 0 to 99. PNG format would be best, but if that's not available I'm not fussy. If there was also a way that I can script this in Photoshop or in Automator (Mac), or some other way to create them. I'd like to download something to test an idea, but eventually will have to make the images to my own specs.

It would be best if they were named regularly too, like this

00.png (an image of "0" or "00")
01.png (an image of a number 1)
...
99.png

This seems like the kind of work that many people on the internet have done, and hopefully uploaded for others to use. (I tried a Google search, but didn't turn up anything).
posted by nevan to Computers & Internet (7 answers total) 1 user marked this as a favorite
 
When I needed this, I just wrote out a suitable TeX file and converted the output pdf to a bunch of pngs using the usual command line pdf manipulation stuff.

You could do the same with whatever word processor you have to hand that will output pdf. OSX used to ship with a tool called sips, you could use that to convert the pdf to a bunch of pngs if it’s still there, or just install imagemagick from MacPorts and use the convert command.

You’ll have to learn to use the Terminal to do all this, but that’s a useful skill to have :)
posted by pharm at 3:28 AM on May 26, 2016 [1 favorite]


Maybe ImageMagick's text drawing functions page would be useful, if combined with a loop in the command line. Mac install instructions.
posted by XMLicious at 4:08 AM on May 26, 2016 [1 favorite]


IM uses Pango for its nicer font effects, so you can use pango-view, too:
for f in {00..99}
do
 pango-view --no-display --background=black --dpi=112 --align=right --foreground='#ff2100' \ 
   --font='TwentyfourSixteen Regular 48' --hinting=full --output="$f.png" -t "$f"
done
Here's the result: numbers.zip. You may not dig obsolete HP alphanumeric LED displays as much as I do, though.
posted by scruss at 5:24 AM on May 26, 2016 [2 favorites]


I had a spare half hour at lunch so I knocked you up a little Mac app. You can choose the font and size, it will then generate the PNG files into a folder on your desktop when you press the button. They will be the same size as the preview, so you can resize the window to make them bigger/smaller.

I've also included the Xcode project if you want to have a play/make sure it's not a virus.

Screenshot: http://i.imgur.com/SXhwbfW.png
App: https://www.dropbox.com/s/2zysewknjtntz3u/Numbers.app.zip?dl=0
Xcode project: https://www.dropbox.com/s/xev0gebdcvwre08/Numbers.zip?dl=0
posted by derbs at 7:18 AM on May 26, 2016 [3 favorites]


Dang, derbs gave you a fish. If you still want to learn how to fish...

Expanding on XMLicious's suggestion, and taking a hint from scruss, here's a command-line for doing this with ImageMagick:
for a in `seq -w 0 99`; do convert -background lightblue -fill blue -font Arial -gravity center -size 165x70 label:$a number_$a.gif ; done
And, like scruss, here's the result: numbers.zip.

Leave out the "-w" if you don't want leading zeroes.
posted by straw at 7:23 AM on May 26, 2016 [2 favorites]


If you want to be able to get it from URLs easily, you could use a dummyimage site and so something like:
for i in {0..99}; do echo 'http://dummyimage.com/300x400/000/fff.png&text='$i; done
to get all the URLs
posted by skynxnex at 8:09 AM on May 26, 2016 [1 favorite]


Thanks everyone for going above and beyond! I'm going to use derbs' Xcode project, because that's what I know, and I can adjust the parameters myself. I should use ImageMagick but I always get nervous about installing things in the Terminal with sudo (I have a separate machine with Ruby installed because of this).
posted by nevan at 1:01 AM on May 30, 2016


« Older How long should insurance take to finalize an auto...   |   Staying with NHS GP when homeless and moving... Newer »
This thread is closed to new comments.