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

Go To StackoverFlow.com

1

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?

2012-04-04 20:03
by Adam Hess


3

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.

2012-04-04 23:55
by Stuart Langley
@Stuard Langley would that mean that I would need to devise some sort of decompression algorithm to get the image data?

Is there any way in the GAE to get the individual pixel values - Adam Hess 2012-04-05 12:49

No nothing is available - I think there is a feature request for something like this on the app engine feature tracker, perhaps you could star it - Stuart Langley 2012-04-06 11:59
I've starred it. Was wondering if there was something else. Do you think all it needs is a decompression algorithm - Adam Hess 2012-04-06 12:46
Something like that - In python 2.7 you could probably use something in PIL, but there's nothing similar in java - Stuart Langley 2012-04-06 12:54
ImageIO .... Le SighAdam Hess 2012-04-06 12:55
With PNGJ you could compress/decompress a PNG in memory, let me know if you need help : http://code.google.com/p/pngj - leonbloy 2012-04-11 17:45
Ads