eZpublish is able to use ImageMagick command. Maybe you could use the -caption operator to add this text. You'll need to override the image.ini and add some filters in the [ImageMagick].Filters array and then create an alias that use this filter.
I didn't use kind of filters and don't know If it works, but this would looks like this :
image.ini.append.php
# Adding the new image alias
[AliasSettings]
AliasList[]=mynewalias
...
# Alias settings
[mynewalias]
Filters[]
Filters[]=caption=My text
....
# ImageMagick settings
[ImageMagick]
Filters[]=caption=-caption %1
...
Then you'll have to create your own template operator which will be called on a image variation and will return a modified image. I think this is quite simple.
Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com