0

I am struggling to find a good library, free to use even commercially, where i could convert an image to 8 bit gray.

I did try using OpenCV, but in the end it add up a lot to the weight of the apk, which is a constraint unfortunatly!

The image file i am trying to convert is a Android.Graphics.Bitmap.

Thanks in advance!

SlashJ
  • 687
  • 1
  • 11
  • 31
  • Is the image a file? Or a Android.Graphics.Bitmap? Or a System.Drawing.Bitmap? You might need to clarify in order to get help. If performance isn't a concern, do it pixel by pixel using this answer: http://stackoverflow.com/a/2265990/1099111 – matthewrdev Feb 11 '16 at 01:04
  • It is actually a Android.Graphics.Bitmap. – SlashJ Feb 11 '16 at 01:10
  • Ok. And do you need to export the grayscale image or just apply the grayscale onto an image displayed in a view? – matthewrdev Feb 11 '16 at 01:13
  • I try to take a bitmap, make it grayscale 8 bit and then save it. – SlashJ Feb 11 '16 at 01:16
  • Using GL/ES2 is a quick way for the cpu/gpu to convert an image to grayscale (on or off screen) if performance is an issue, using a shader (texture based) you can handle average grayscale, decomposition grayscale, luminosity grayscale, desaturation greyscale, etc... Which type of grayscale conversion are you looking for? Is the bitmap currently displayed? Do you need to visualize (show on screen) the grayscale version before saving? What is the desired file type (image container format)? – SushiHangover Feb 11 '16 at 01:32
  • 1
    Bear in mind that the OP said 8-bit grayscale. So that implies also a limited palette. – Doug Stevenson Feb 11 '16 at 02:58

0 Answers0