The Cellar  

Go Back   The Cellar > Main > Technology
FAQ Community Calendar Today's Posts Search

Technology Computing, programming, science, electronics, telecommunications, etc.

Reply
 
Thread Tools Display Modes
Old 11-11-2003, 03:19 PM   #1
hot_pastrami
I am meaty
 
Join Date: Dec 2001
Location: Salt Lake City, UT
Posts: 1,119
Question Utility to automatically insert positioned text into a bitmap

Hey guys,

For a work-related task I need a simple utility I can use to insert text into a bitmap, to automate the process of building InstallShield splash screens. All of our products require a splash screen with our logo, the product name, and the release date, and right now I have to edit these bitmaps by hand. It is the only portion of the build process I haven't found a way to automate yet.

Anybody know of a command-line utility that accomplishes this? Or alternatively, does anyone know of a code snippet in Perl or Java which could be adapted to do this? I need to be able to place black text of a specific font (Arial Unicode MS) on top of a white-background bitmap centered under our logo.

Most of my devlopment has been back-end and web stuff, so I know little about bimap manipulation in Perl and Java. I queried Google, the Perlmonks search, and CPAN, and didn't find much to help me.

Thanks for any help.
__________________
Hot Pastrami!
hot_pastrami is offline   Reply With Quote
Old 11-12-2003, 07:35 AM   #2
Beestie
-◊|≡·∙■·∙≡|◊-
 
Join Date: Feb 2003
Location: Parts unknown.
Posts: 4,081
I don't have the answer.

I looked in my favorite download site, Major Geeks and came up empty (not even close).

But, I really like the question - I do a lot of automating in MS Office and this is a good challenge.

All I can figure is to have two images (the background) and the foreground (or two layers of a single image). Then, all you have to do is figure out how to create an image with the text only then merge it with the background image.

I suspect you could write some sort of routine that could run in Photoshop (or even Paint Shop Pro) that would do this. I think one key is NOT preparing the images in bitmat form but the native format of either program where the text really is text (and is manipulatable as such) and not reduced to a bitmap yet. You can save the merged image as a bitmap.

Even if it doesn't work the way you hoped, keeping the text as a distinct layer in your template image should make the entire task take no more than 2 minutes to complete.


Another off-beat thing I thought of is to store the image in MS Word and create a text-field placed over the image. You can feed the parameters of the text-field to Word via VB simultaneous with opening Word. Take a screen shot, save as bitmat and you are all set. Easier said than done, tho.

If you do figure it out, pls reply with how you did it.

Again, not the answer you were looking for but my best shot.
__________________
Beestie is offline   Reply With Quote
Old 11-12-2003, 08:31 AM   #3
insoluble
developmentally disabled rear end headwear
 
Join Date: Oct 2003
Location: syracuse, ny
Posts: 207
if all of the bmp images are the exact same size, you can probably do a java hack that will add the text at a pre specified X,Y coordinate. Alternatively, I believe Adobe Illustrator has an internal utility/macro type thing that is designed specificallly for this task.
insoluble is offline   Reply With Quote
Old 11-12-2003, 11:59 AM   #4
hot_pastrami
I am meaty
 
Join Date: Dec 2001
Location: Salt Lake City, UT
Posts: 1,119
Well, in order to be useful for what I'm doing, I need it to be hands-off. The way I'm doing it right now takes only thirty seconds or so, but the fact that I have to do it by hand prevents me from completely automating the task.

What I hope to accomplish is the ability to set the build process to automatically start each morning as a scheduled task, but if I have to update these files by hand, it can't just run automatically. Not only that, but all of our products use splash screens like this one, so once I get around to making those processes fully automated, this same utility will be helpful.

If apps like PSP or Photoshop can do this hands-off, that might work, but I think my employers would be loathe to pay the pricetag on such software for once single task such as this.

Perl seemed like a bit of a dead end in this regard, so I'm looking at some ways to do it in Java right now... but my lack of graphics experience in Java is hanging me up a little. If I figure something out though, I'll post my solution.
__________________
Hot Pastrami!
hot_pastrami is offline   Reply With Quote
Old 11-13-2003, 09:51 PM   #5
Uryoces
2nd Covenant, yo
 
Join Date: Dec 2002
Location: Pugetropolis
Posts: 583
You might want to check out the Gimp's scripting abilities. I haven't scratched the surface at all, but they can definitley be automated.
__________________
The party's over ... the drink ... and the luck ... ran out.
Uryoces is offline   Reply With Quote
Old 11-13-2003, 10:05 PM   #6
Bitman
cellar smellar
 
Join Date: Oct 2001
Location: californy, baby!
Posts: 403
How about the PBM tools? Free with every order of Linux, should be available for everything else. pbmtext looks promising, though font selection is limited.

You might also look into SVG, though I dunno if you can stick bitmaps inside.

Also, (since you mentioned Java) you could just write some custom code to do the job. Bitmap libs are available for lots of formats, and Java2D does beautiful drawing.
Bitman is offline   Reply With Quote
Old 11-14-2003, 05:13 AM   #7
juju
no one of consequence
 
Join Date: Jun 2001
Location: Arkansas
Posts: 2,839
Looks like ImageMagick could do the trick.

Something like:

convert -font helvetica -fill blue -draw "text 100,100 Blah" image.bmp new_image.bmp

Last edited by juju; 11-14-2003 at 05:28 AM.
juju is offline   Reply With Quote
Old 11-14-2003, 12:16 PM   #8
hot_pastrami
I am meaty
 
Join Date: Dec 2001
Location: Salt Lake City, UT
Posts: 1,119
Quote:
Originally posted by juju
Looks like ImageMagick could do the trick.
Dude, ImageMagick is just what I was looking for. I knew about the Perl module version, but I don't have "make" to compile the module... but this command-line version should be exactly what I need.

Thanks!
__________________
Hot Pastrami!
hot_pastrami is offline   Reply With Quote
Old 11-14-2003, 01:21 PM   #9
juju
no one of consequence
 
Join Date: Jun 2001
Location: Arkansas
Posts: 2,839
Open source saves the day again!
juju is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 05:40 AM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.