How to convert text of an essay into a bunch of images?
May 3, 2015 4:13 PM   Subscribe

A strange request, perhaps: I have a relatively long essay (in PDF form), and for various reasons, I'd like to convert each word of the essay into an individual image, preferably PNG. How?

Ideally, I'd like to automate this process as much as possible. I suspect there's a way to do this by creating a space or comma delineated document of some kind, but I'm not sure what to use to get from a text spreadsheet to a collection of images. I'm on a Mac. I have Adobe CC. I'm willing to invest in other software as well. Any ideas?
posted by Ms. Toad to Computers & Internet (9 answers total) 1 user marked this as a favorite
 
Do you have a bunch of images already? Or are you trying to create images? And do the images need to be in a particular order, or random?

And what do you want the final output to be? A pdf full of sentences made up of tiny images? Or a folder full of images in some sequence? A website?
posted by natteringnabob at 5:02 PM on May 3, 2015


Response by poster: I have no individual images right now, just the text as a PDF. I might also be able to get it as a Word document. It would be very, very good if the words could remain in order.

I'm ultimately going to bring each image into AfterEffects to create a video version of the text.
posted by Ms. Toad at 5:10 PM on May 3, 2015


If I'm understanding this correctly, it should be trivial to write a script to associate each word with an image, provided you had the images. I'm not clear on what the images will be though? An image of each word? Or images of random stuff?
posted by natteringnabob at 5:17 PM on May 3, 2015


Response by poster: Yes, I need to create an image OF each word. Not to associate the word with an image, but to make the text itself an image. So it's like I'm creating movie titles, where each word of the title is an individual PNG, and the only material I have to work with is a PDF of the movie titles. So if there's a way automate an import of text into Photoshop that results in a PNG created of each word, that would be pretty ideal.
posted by Ms. Toad at 5:29 PM on May 3, 2015


I have a script somewhere that splits a given document into individual layers for each word in AE. It's text, but split up and ordered. Would that do the trick?
posted by Nonsteroidal Anti-Inflammatory Drug at 5:45 PM on May 3, 2015


Based on the description, I think it was this guy, but there's a chance that's not the exact one I used. Regardless, it'll split text into words!
posted by Nonsteroidal Anti-Inflammatory Drug at 5:47 PM on May 3, 2015


ImageMagick can generate images from text.
You would need to use additional scripting to split your text into individual words which you then generate with ImageMagick and save to an appropriate place.
posted by Gomez_in_the_South at 9:25 PM on May 3, 2015


If you can get the text in Word, you could copy/replace every space with 'page break' (in the copy/replace dialog in Word are instructions/characters for replacing text with special characters like line feed, page break, etc). After a bit of minor editing (and formatting, say you change the font size to 120 and center everything vertically and horizontally) you would end up with a document that has every word on one page, as large as you want and centered.

Then you could work on turning every page into a graphic file. That could be done a number of ways but the one that comes to my mind first is print/export to PDF and then Adobe Acrobat (and/or some of the free PDF editors) can export PDFs to various graphical files.

When you mentioned showing each word in a video, something like a slideshow of each word individually, the first thing that popped into my mind is importing this into Powerpoint. Once you have split the doc in Word so that each word is a page, you could then import that into Powerpoint (with the master page set up as you'd like) and you'd have a powerpoint with each word on a powerpoint slide. Then there are various ways to turn the Powerpoint into a movie.
posted by flug at 6:15 AM on May 4, 2015 [1 favorite]


Is this the kind of thing you had in mind? Very easily done on a Debian box, using ImageMagick and the following commands in a Terminal window:
mkdir ~/Dropbox/Public/words
cd ~/Dropbox/Public/words
out=100000
pdftotext ~/Documents/Pile/Radical\ Relationism.pdf - |
xargs -n1 |
while read word
do convert -pointsize 72 label:"$word" $((++out)).png
done
The same command sequence should work pretty much identically on a Mac, provided you have the required Poppler (for pdftotext) and ImageMagick (for convert) packages installed. Both are free.

If getting down and dirty with command lines and MacPorts is not something you feel comfortable with, I could easily do the conversion for you if you provide a link to the PDF you want converted, and tell me what font, point size and colors you'd like in the output PNGs.
posted by flabdablet at 9:13 AM on May 4, 2015


« Older How Do You Work For A Canadian Company?   |   Not Getting Distracted by a Work Crush Newer »
This thread is closed to new comments.