JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.96k stars 1.16k forks source link

How to decode region of an image and downsample it on a desktop platform? #3782

Open panpf opened 11 months ago

panpf commented 11 months ago

I'm currently developing a zoomable Image component for Compose Multiplatform and I'm running into a tricky problem.

On the desktop platform I need an API similar to BitmapRegionDecoder on Android, which can decode the region of the image and downsample it.

I searched google and stackoverflow but couldn't find the answer I wanted. Is there a similar API on the Compose Multiplatform platform?

pjBooms commented 11 months ago

Compose Multiplatform does not have a similar API out of the box and unfortunately I am not aware about third party solutions.

m-sasha commented 11 months ago

There's probably a Java API (possibly 3rd party) that does this.

panpf commented 11 months ago

There's probably a Java API (possibly 3rd party) that does this.

Great. What's your name, please?

elijah-semyonov commented 11 months ago

There's probably a Java API (possibly 3rd party) that does this.

Great. What's your name, please?

Does this help?

panpf commented 8 months ago

The ImageReader class that comes with JDK can decoding region and downsample, but it can only be used on the desktop. I still need a kotlin multiplatform dedicated image decoding library.

okushnikov commented 3 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.