Tuesday, December 29, 2015

My first android app - PixaToon

I wanted to develop some android app for a long time. but wasn't able to find a suitable idea. One day an idea struck me - an app for applying cartoon filter to camera and images. It seemed interesting and accessible, as I had worked on image processing before. I expected that there would be few such apps on android, making the idea somewhat unique.

A quick search through Play Store was enough to crush my expectation. The search revealed that there were hundreds (or maybe more!! never got to the end of list) of apps already published; almost same or similar to my 'unique' idea. I tried some of the top rated free apps, and found most of them to be mediocre. With millions of apps available for all types and flavors, its very difficult to think of a truly unique idea. Even if an app idea is not unique, its interface and implementation is what differentiates from the rest. With this realization, I decided to continue working on my idea with the goal to create a better implementation.

I used OpenCV image processing library for assistance, because of my previous experience using it and its support for Android platform. Now, the first thing was to get the cartoon effect right. Soon, I found out that getting the perfect effect is easier said than done. The main issues were handling illumination variations, and real-time processing (for camera preview). With some research and mostly trial-and-error, I was able to get a fairly good cartoon effect. But then it was my perception, which everyone may not share. Hence, I worked on adding more filters like sketch, oil-paint and pixel-art; to add more variation and use-cases for my app. 

Once the effects were finalized, the next task was to design the android app and integrate the image filters (as the filters were originally developed in C++ using OpenCV). My previous android experience was attending a college workshop, when I had no knowledge of Java or XML, and the entire presentation was flying over my head. It meant I had to start now from scratch, with the difference that now I was proficient in Java and XML. This proficiency eased my android journey, with lots of help from Google and Stack Overflow. The app layout was designed as simple as possible, to avoid any unnecessary complication. For performance reasons, I kept the image filter implementations in C++ and integrated it using Android NDK (Native Development Kit). 

Finally, the app is now ready and published on Play Store with name 'PixaToon' (mash up of picture and cartoon). PixaToon lets you apply six different image filters - Color Cartoon, Gray Cartoon, Color Sketch, Pencil Sketch, Pixel Art and Oil Paint; over camera and gallery pictures. You can preview the filters over camera in almost real-time, fine tune each filter's settings for the perfect effect, and save it. Find below some screenshots showing the implemented filter effects. Please visit PixaToon's Play Store page, for additional information. The source code is available on https://github.com/ajscape/PixaToon. I will continue working on the app, to improve it further and adding new filters. Any feedback or suggestions for improvement would be very helpful.

          

3 comments:

  1. HI, i added you pixatoon project in my project. i rename the package name. Now it sows java.lang.UnsatisfiedLinkError: No implementation found for void com.test.pencilsketch.imageFilter.lib.Native.setSketchFlip(boolean) (tried Java_com_test_pencilsketch_imageFilter_lib_Native_setSketchFlip and Java_com_test_pencilsketch_imageFilter_lib_Native_setSketchFlip__Z)

    Please, help me to fix this issue. thanks

    ReplyDelete
  2. Hi Atul, I tired implementing your project, i am facing rendering issue while using filter

    ReplyDelete
  3. Please continue development and publish to Google Play Store. I find a version 1.2 and side load because no more on Google Play Store. This is most amazing app ever. I use on my Pixel 5. Perfect.

    ReplyDelete