Based on the ImageFilterForAndroid source code