Can Android handle computations in image processing and ttf rendering? - android

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

Related

I have a map that's a vector image. Whats the best way of showing this in android?

I want to add a vector that's a map. I want to show this to the user, but I'm unsure of the best way to do this.
The only requirements I have are:
Show a vector
Start "zoomed" in (start at a specific point of the the map)
Work on 4.0 and up
I'm up for suggestion on which file type to use
Ah, that is definitely not how I interpreted "I don't want to specify one".
SVG is probably the lightest-weight solution. There are libraries that can display SVG in an ImageView as a Drawable, though these will only handle a subset of SVG. WebView on Android 3.0+ is supposed to be able to handle SVG files, though I haven't tried it.
Many, perhaps most, Android users have a PDF viewer, so if you're willing to open up a third-party app, you can do that easily enough. There are PDF libraries as well, though PDF is a more complex file format than is SVG, and therefore the libraries suffer.
I am not aware of any easy way to show an AI file directly, and those are the primary 2D vector formats in use today.

Open CV Vs NDK for Image processing

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.

Is there any way to synthesis image in Android native API or using HTML5

I want to build a mobile app with the following function:
Let user choose an image, then we generate a picture base on that picture.
The generated picture has some specified text with specified font.
There is another picture, which may be a PNG file, used as foreground.
Output that generated picture to user's device.
Is there any way to synthesis image in Android API or using HTML5?
I prefered use some Javascript way to do this, so I can easily build the app cross platform, but I don't know whether JS can do that.
For this purpose you can use HTML5 canvas https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas
If you want to code this using Android API you can use Canvas:
http://developer.android.com/reference/android/graphics/Canvas.html
By the way there is a good guide "Displaying Bitmaps Efficiently" http://developer.android.com/training/displaying-bitmaps/index.html

PDF reading on Android

I have to make an application that should capable of reading PDF documents on Android device. Actually I do not want my app to be dependent on other apps to read the PDF file.
I had gone through the questions that are asked here and at some other places also. They all directly or indirectly using third party app.
Is there any API or something similar is available through which I can implement reading of PDF files directly in my app? How about converting the PDF document to PNG image? But the PDF-PNG method wont let users select the texts.
Any suggestions?
Thanks
There exists an library from Adobe that you can use. Its based on the NDK and you need to do the wrapping all by yourself. Its also extremely expensive, basically nothing for a small firm/single developer but for bigger companies. Afaik the license is not only expensive but also annual based, so you need to pay for it in every year...
There are other libraries, basically open source. Some of them have good performance but a lack of functionality (most of them based on NDK, too). I found only one pure "java" library but the performance was more than worse (loading time 10sec for a page and more).
There are three possibilities you should consider:
Using an external application, so you just need to implement the library of your PDF documents
You write everything by yourself including a pdf reader part
You create a middle "tier" where you convert your PDF into PNGs or JPG (I prefer PNG for better quality). The much better performance comes with a lack of features.
I'm currently developing a complex application like mentioned in 3. but I can't go into details, sorry.
I would definitely recommend the Qoppa stuff on Android.

Architectural conundrum between Android, the server and image creation

I have a project and I'm curious what the community would recommend as the best approach to implementing it.
Process:
On an android device allow the user to assemble an image composite that includes a background, some clip art (positioned and/or rotated/sized by the user), maybe a photo, and some text.
do some stuff...
print the image on the server.
The only mandatory requirement is that the server HAS to be a PC Laptop machine, though I can replace Windows with linux, if I need to (don't ask).
Should I go down the road of attempting to construct a finished JPG right on the Android device and delivering that to the server for printing? If so, what Java image library is best for such a task?
Or should I try to implement imagemagik on the server (is that even possible if I kept the Windows that's pre-installed on it?) or some other image automation?
I could build this as an Adobe AIR app and run it on Android, but am worried about the 100% portability of Air onto Android and don't have the time to get stuck 1/2 way into something that involved only to have to start from scratch with a totally different approach.
All ideas welcome.
Well Android actually comes with a Jpeg codec installed and a png codec. As for the UI work to overlay the images into the correct locations that's up to you. But to construct the final version of the image, you can simply grab your main raster (android.graphics.Bitmap) and use Bitmap.CompressFormat (JPG or PNG) to save it to a stream somewhere. Then the file can be sent to the server. I mean if the raster is relatively small (which I assume it is or else you wouldn't really be able to provide a simple UI for them to composite the image) this will work.
Hope this helps.

Categories

Resources