Image Processing on Kotlin Multiplatform

Hello,

I would like to use some image operations in a Kotlin multiplatform project and ask for your experience to get a performant implementation.

My target platforms are Android, Java Script, iOS and Native C. Besides some standard operations like color conversion (rgb to gray) or generation of histograms, I need a blur filter and a convolution operation.

It would be best if I could integrate opencv to use hardware acceleration.
Unfortunately, this doesn’t seem to work on iOS at the moment because of the C++ code (https://youtrack.jetbrains.com/issue/KT-47713/Kotlin-Native-cant-use-openCV-pod-as-it-contains-C-headers)

Another solution would be to integrate the korim library, which is part of korge, and extend it for native C (GitHub - korlibs/korge: KorGE Game Engine. Multiplatform Kotlin Game Engine). With korge I can process the native image (like BufferedImage or UiImage), but I can’t use the hardware acceleration.

Do you have any other ideas how to work performant on photos?

Best regards

1 Like