Writing text for images in Google App Engine (Java)

I am writing code that works in Google App Engine (Java). What I'm trying to do is enlarge an existing image by adding text. GAE does not have text processing in ImageService. Somebody knows?

I want my code to look something like this:

...
// Read image
byte[] pageData = readImage("images/page.png");
Image pageImage = ImagesServiceFactory.makeImage(pageData);

// Add text here
...

return pageImage;
+5
source share
2 answers

If you just need to overlay some plain text, you can combine the Google Graphics API with the Composite image function in the AppEngine Image API to get the desired result.

First create a URL and use urlfetch from your application to get the desired text image through the charting API, for example:

enter image description here

URL: http://chart.apis.google.com/chart?chs=300x50&cht=p3&chtt=hello&chts=FFFFFF,24&chf=bg,s,000000 ( URL-)

API Composite , .

+11

All Articles