How to split an Image into Arrays

103 views
Skip to first unread message

AkS

unread,
Feb 18, 2016, 8:06:01 PM2/18/16
to MIT App Inventor Forum
Hi..need a help with some tips if possible:

Want to split a image (picture) placed on a canvas into smaller images of 2x2, 3x3 and so on.
Then store the smaller images into 2D arrays for further use...


Taifun

unread,
Feb 19, 2016, 7:51:09 AM2/19/16
to MIT App Inventor Forum
unfortunately this is not possible in MIT App Inventor
probably you can find an API which splits the image for you http://www.programmableweb.com/apis/directory

or you could write your own extension and create a block yourself...
see this Android solution http://stackoverflow.com/a/24138014/1545993

more information about how to create an extension see here https://groups.google.com/d/msg/mitappinventortest/Ip2AX036d0U/5NJlAEbFCgAJ
however that will be more advanced and will require some Java skills...

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

AkS

unread,
Feb 20, 2016, 3:31:03 AM2/20/16
to MIT App Inventor Forum
Hi Taifun,

Thanks for answering and providing the links.
As you suggested, probably it is a good idea to dig into creating extensions, which will enhance the usefulness of using AppInventor for custom tasks.

Taifun

unread,
Mar 22, 2016, 5:17:04 PM3/22/16
to MIT App Inventor Forum
meanwhile I prepared an image extension, which is also able to create chunks of images, see here https://puravidaapps.com/image.php

The App Inventor Extensions are currently in testing. See the announcement for more information about how to use an App Inventor Extension. 


For example rows=4 and columns=3 will create 12 chunks of the original image, see screenshot

The chunks will be stored in the same directory as the original image file. The following name convention will be used: imageFileName_rowNumber_columnNumber.jpg.



         
Taifun
Reply all
Reply to author
Forward
0 new messages