My ideal image processing library for android just provides a means to load images into memory in a standard format without any extra lossiness as it is loaded from the file/camera and then allows me to painlessly call my own C or C++ routines that operate on that format and finally allows me to save the result in a standard format to a file (possibly with loss, e.g. jpeg) . This seems to be quite different than the approach taken by most android image processing libraries. Is there such a library that has a good reputation?
Yes, OpenCV (Open Source Computer Vision).
Also recommend taking a look at Tutorial on Using OpenCV for Android Projects.
Related
We are trying to integrate Oboe and the library size seems to be big.We dont need any processing like resampling ,format conversion .This we do in app and would like to know if its possible to significantly reduce library size with our only requirement using Oboe being for Audio IO.
The source to configuring streams with flow graphs where lot of processing code seems to exist.Is there any easy way to take this processing code and use only Audio IO part.
I am planning to create an Android application that will enable users to draw their own font. One similar app I found, they render the drawings online and sends the ttf file via email. What I want in my study is to render offline and saves the ttf directly into the sd card. Do you think Android can possibly do it? I am worried if it can handle all the computations of the first step which is image processing and handle those parameter requirement in rendering into .ttf (TrueType) format.
There's no reason why it wouldn't be able to.
If you can't find a API function that can do this, you can always write a small native library (using NDK), and use the FreeType open source library to do the rendering.
If you need an example of character rendering to OpenCV images, look in this short code:
https://github.com/amirgeva/optmatch/blob/master/src/chrmatch/ftfont.cpp
I am new to using Pygame for Android and I have been trying to convert my This Game to an android game. Here I need to load around 6 images in one screen but when I try to load more than two images, the apk-application closes down abruptly (it works fine on PC). Here is the complete code of what I have done so far.
Is there any way I can load multiple images without making the game unstable for android?
Note : I am using Pygame Subset for Android to convert my .py to .apk
Yes you can, use Picasso library for loading the images. I had the same problem with OutOfMemory exceptions, but this library solved my problem.
Download the Jar file and include it to your project, but before that make sure you read the documentation, it's very short and simple especially the IMAGE TRANSFORMATION part.
I am writing a program to manipulate images,ie change its color,brightness,contrast etc...
The DVM doesn't support the manipulation of images of size beyond a limit...Can any one tell me whether using Open CV will solve the issue(as this seems to be a better option than NDK)?
Or will I have to use NDK?
I have done a lot of search and was not able to find answer..
First of all, there are different options for Image processing in Android, see here for a comparison of the most popular options: see Android Computer Vision JavaCV OpenCV FastCV comparison and Image processing library for Android and Java
Coming back to your question: If the images you deal are really very large so that they do not fit into the memory of the device, you need to process the images in small chunks called tiles.
If your images are not that big, I recommend you to use OpenCv, if you have to do anything more than very simple tasks such as brightness/contrast adjustment.
I have a painting application that is running out of memory on a few devices really quick... :(
The problem is that I have bitmaps that are screen size and I'm loading 2 or 3 images to memory than I create a blank bitmap attached to a canvas for merging the 3 images into it. So yeah lot of bitmaps...
My goal is to use the NDK to load the images from file merge them and return only one Bitmap. Well essentially in java I would create the empty image and pass the object to the NDK. This should alleviate the amount of memory used on the device. At least in theory...
The first problem I'm facing is decoding the png image from file. How can I do this via NDK? Should I use BitmapFactory via JNI?
Than the bigger question how do I merge these ARGB bitmaps?
I am not familiar with what image manipulation abilities are built into the NDK, but the OpenCV library can be included for use in the native code, and that is what I use (largely due to previous familiarity, but it is really nice).
Here's the OpenCV 4 Android project. Here is how you would open a PNG.