Android: Bitmap resizing using better resampling algorithm than bilinear (like Lanczos3) -


is there way or external library can resize image using lanczos (ideally) or @ least bicubic alg. under android? (faster better of course, quality priority, processing time secondary)

everything i've got far this:

bitmap resized = bitmap.createscaledbitmap(yourbitmap, newwidth, newheight, true); 

however uses bilinear filter , output quality terrible. if want preserve details (like thin lines or readable texts).

there many libraries java discussed example here: java - resize image without losing quality

however it's depended on java awt classes java.awt.image.bufferedimage, can't used in android.

is there way how change default (bilinear) filter in bitmap.createscaledbitmap() method or library morten nobel's lib able work android.graphics.bitmap class (or raw representation, @tron in comment has pointed out)?

the promising imo use libswscale (from ffmpeg), offers lanczos , many other filters. access bitmap buffer native code can use jnigraphics. approach guarantees nice performance , reliable results.

edit

here can find rough demo app, uses proposed approach. @ moment performance frustratingly bad, should investigated decide if improve it.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -