The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Saving external data in image files

Hi all,

I have a question that I hope is not too off topic in this forum.

I have a small advertising agency that specialises in leasing outdoor billboards. Part of our normal proposal to clients are mockups - pictures of our billboards (the location photo) with clients' logos or ads keyed in to the position of the billboard, to let clients have a better idea of how their visuals would appear in real life.

Now since most of our sales staff (myself included) are "artistically challanged", we have these mockups made by an outside graphic artist. But the turnaround time is long and miscommunication is not too infrequent. So I am considering to develop an application that can automate these processes.

One particular problem that needs to be solved is that these location photos were taken from many different angles, so there would be perspective issues to be considered. In order to correctly key the logos onto the billboards in the image, I would need to record the co-ordinates of the four corners of the billboard in the image in order to resize/skew/distort the logos to match the perspective.

Now of course one way to do it is to record these co-ordinates and save them in database and associate them with particular location photographs, and recall them when the keying process is performed. But I wonder if it would be more efficient if the location photo file itself can contain these co-ordinates, so when my application reads these files the co-ordinates will also be read automatically?

So after all this long winding, my question is: do any of you guys know or aware of any image file formats that can save other types of data in the file itself?

Any suggestions or comments are much welcomed.
Monday, December 12, 2005
This (scaling & skewing of images) is actually a pretty simple problem, given the availability of good graphics libraries today.  I've done something similar myself, so send me a mail if you want more detail.  I'd recommend GraphicsMagick or if you're on windows, the CXImage library (try google for both).

As for embedding text, that's included in the JPEG specification.  PNG format also has some space for embedded text, but it's limited.  Once again, consult google for the specifications on both.
Duncan Werner Send private email
Monday, December 12, 2005
You can definitely embed data in the image files, but it can easily get stripped away if someone decides to "touch up" one of your photos in a paint program that doesn't respect the embedded data.
Don Send private email
Monday, December 12, 2005
Like Don and Duncan say, there are provisions for storing your own data inside the image, but it's fragile and probably more trouble than it's worth (in terms of embedding and extracting).  I agree with you that it seems like a better idea to have that metadata stored inside the image, but the practicalities would make me store it separately.
a unique name lets you know it's me Send private email
Monday, December 12, 2005
I don't know.

The graphic designers you're working with probably do more than just scaling/skewing a logo onto the billboard image.

They probably also pay attention to details like matching the background texture of the billboard, the lighting conditions of the photo, etc. Are you sure that cutting them out of the loop will really be beneficial?
BenjiSmith Send private email
Tuesday, December 13, 2005
You could always skew the billboard photos back to normal in photoshop before using them.
Zach M.
Tuesday, December 13, 2005
Hi Lawrence

Due to the difficulty in reading and writing metadata in image files, and the problems others have mentioned with possibly losing the data if someone modifies the file, I used text files for my application to store data about images. They are easily read/written without special software, and it is easy to use the information from another application.


If you were interested, I could possibly modify it for you so you could select the area you're interested in with the mouse and save the coordinates in the text file.
It might even be feasible to do a function to scale and paste your image into the selected area.

Email me if you would like to discuss it further.
Andrew Rowley Send private email
Wednesday, December 14, 2005
PNG format supports having metadata in the chunks and includes some rules which allow you to say things like "you won't understand this chunk but you MUST copy it as it is" to editors of the image.

These are based on the upper/lower caseness of the 4 letters in the chunk tags.
Katie Lucas
Wednesday, December 14, 2005
TIFF and EXR have the same kind of meta-data support. It works but you can't count on third-party applications retaining all the meta-data when saving images after editing.
Dan Maas
Thursday, January 05, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz