Display Large Image on Android

314 views
Skip to first unread message

Jorge Carrillo

unread,
May 2, 2016, 10:56:24 PM5/2/16
to Kivy users support
I am trying to display jpeg images from my dslr camera onto a Kivy Image widget. I have discovered the images will only load if the length of any side is <= the gl-max-texture-size of the android device. The photos I'm trying to display are 6000x4000 pixel images. The gl-max-texture-size of my Android Tablet is 4096 and the photos will not display. On my development box the gl-max-texture-size is 8192 and the pictures display fine. I can show the pictures just fine with the Google Camera app or other software that displays photos on Android.

How can I display pictures of this size with the Kivy Image widget on my Android tablet?

Thank your very much and keep up the great work! Kivy is wonderful!

Kovak

unread,
May 3, 2016, 9:34:28 PM5/3/16
to Kivy users support
One of 2 things is probably done:

1. Resize the image so it is smaller, I know there are some android camera functionalities to do such a thing.

2. Break the image into multiple images that do fit, display them at the right positions. This is done on Android with something like http://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html

but you could probably do it with pillow

Jorge Carrillo

unread,
May 4, 2016, 1:09:43 AM5/4/16
to Kivy users support
Thanks very much for your response. I was hoping there was some magic way of cramming a large photo into a kivy image widget. You verified my plan to either break the photo up into smaller pieces or resize it is the way to go!

Alexander Taylor

unread,
May 4, 2016, 6:43:06 AM5/4/16
to Kivy users support
The Image widget just won't do this right now, since it works with a single Texture. It *would* in principle be possible to add to Kivy some automatic handling of oversized images (as multiple Textures), but there isn't anything like that right now. You could probably work it out manually if this is very desirable, or alternatively it may be good enough to resize the image dynamically before making the Texture (e.g. with pillow).
Reply all
Reply to author
Forward
0 new messages