Automatic Image Creation

Events happening in the community are now at Drupal community events on www.drupal.org.
sockah's picture

I'm working on something for a project involving automatically generated images and am at the conceptual stage. I would appreciate input on modules, tools, or code I should look into to implement the below. Thanks!

I would like to to automatically generate images from information from nodes. The source information will come from CCK fields in those nodes and will include both text and images.

For example, let's say a node includes the following information (---denotes an image file):
Title: A Node
Image: ---Picture 1---
Image 2: ---Picture 2---

I would like for my site to somehow automatically process this information and then create a single jpg, or single picture in some other image format, that includes and attractively arranges the pictures and text.

Any ideas?

Comments

Weather maps are an example

peterx's picture

Hello sockah, automated image creation is relatively easy when you have a defined source and target. Weather maps are an example. I presented a way to do it some time ago at a conference. Creating a combined image with 100000 steps was quick using basic PHP image handling. The assembly of an image is more difficult when free form. How fixed is your format?

Defining your sources and how they will fit in the final result is the first. A classic problem is expanding an image without resizing the current content. I suggest you provide a little more information about the "processing". Will elements overlap? Will you place bits on top of each other? Are you just connecting images edge to edge?

I started with code to create an empty template layout for each result. There were only a few in my case. Some had plain coloured backgrounds. Some had maps. The final bits to go on the images were icons and I made them all in a limited range of sizes. The bits that went onto the background before the icons were the problem. I wrote a an image assembly language to process the middle bits then place them on the background. The script could then pick up parts, crop, resize, and place each bit in the right sequence. Do you need cropping, resizing?

Are you looking at a lot of components or a few? If it is a lot of components, you might want to cache intermediate steps for reuse or move the processing to cron. Weather maps work well with cron because the input data might be updated once per hour. If your requirement is adhoc and free form, there are people working on Javascript based applications and connections to external image editing applications.

Image

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: