Adam Hess
Adam Hess

Reputation: 1449

How does google app engine manipulate image data? How can you manipulate pixel data?

I want to get access to the low level pixel data to complete signal processing algorithms using GAE (which elimiated the use of BufferedImages and Java.awt.image classes)

You can access the Image data by:

ImagesService imagesService = ImagesServiceFactory.getImagesService();       
Image oldImage = ImagesServiceFactory.makeImageFromBlob(blobKey);
byte[] imageData = oldImage.getImageData();

So here is the issue:

Color Images have 4 Bands (aRGB) but when you get the Image Data its a 1D byte array.

1) How does GAE store the image data into the bytes? (I imagine its just taking the 2D data and putting it into a 1D array, is it grayscale?)

2) How would you manipulate the individual color bands and pixels of the image?

Upvotes: 1

Views: 497

Answers (1)

Stuart Langley
Stuart Langley

Reputation: 7054

imageData in this case is the raw bytes of the entire image in whatever format the image is in, including headers, data chunks etc.

It is not the pixel data in uncompressed format.

Upvotes: 3

Related Questions