An open source Android library that allows the visualization of large images with gesture capabilities

Overview

ByakuGallery

ByakuGallery is an open source Android library that allows the visualization of large images with gesture capabilities. This lib is based on AOSP Camera2.

Sample Screenshot Sample Animation

The name was inspired by the Byakugan from Naruto series :)

Features

  • The image is split in small tiles and only the visible portion is allocated on memory, avoiding OutOfmemoryError.
  • Full gesture capabilities: Click, LongClick, DoubleTap, Pan, Fling and Pinch Zoom.
  • Smooth animations.
  • Can easily be placed inside a parent View with scrolling (e.g. GalleryViewPager).

Sample Application

Get it on Google Play

The sample app project code is also included on this repository.

Usage

The ByakuGallery was designed to be the simplest possible to use. Also, the two main classes TileBitmapDrawable and TouchImageView were designed to be independent. That means you can use them separately if you want to :)

Here are the few steps needed to setup:

  1. Add the TouchImageView to your xml file:

    <com.diegocarloslima.byakugallery.lib.TouchImageView
    android:id="@+id/my_image"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  2. Them add these lines to your java code (usually on your Activity.onCreate() or Fragment.onCreateView() method):

    TouchImageView myImage = (TouchImageView) findViewById(R.id.my_image);
    InputStream is = getResources.openRawResource(R.raw.image);
    TileBitmapDrawable.attachTileBitmapDrawable(myImage, is, null, null);
  3. And that's all! For a complete implementation, you can take a look at the sample project.

Gradle

Add the following dependency to your build.gradle file:

dependencies {
    compile 'com.diegocarloslima:byakugallery:0.1.+@aar'
}

Used by

Let me know if you are using this lib in your app. I'll be glad to put your app name here :).

Contributing

Pull requests with bug fixes or new features are always welcome :), but please, send me a separate pull request for each bug fix or feature. Also, you can contact me to discuss a new feature before implementing it.

Developed By

Diego Carlos Lima: [email protected]

License

Copyright 2013 Diego Carlos Lima

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • OutOfMemoryError

    OutOfMemoryError

    When i use GalleryViewPagerSampleActivity (with fast scroll and zoom in) on Galaxy S3, it show error:

    02-05 15:49:29.094: E/AndroidRuntime(20628): FATAL EXCEPTION: AsyncTask #4 02-05 15:49:29.094: E/AndroidRuntime(20628): java.lang.RuntimeException: An error occured while executing doInBackground() 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.os.AsyncTask$3.done(AsyncTask.java:299) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.FutureTask.setException(FutureTask.java:124) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.lang.Thread.run(Thread.java:856) 02-05 15:49:29.094: E/AndroidRuntime(20628): Caused by: java.lang.OutOfMemoryError 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.graphics.Bitmap.nativeCreate(Native Method) 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.graphics.Bitmap.createBitmap(Bitmap.java:640) 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.graphics.Bitmap.createBitmap(Bitmap.java:586) 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:466) 02-05 15:49:29.094: E/AndroidRuntime(20628): at com.diegocarloslima.byakugallery.lib.TileBitmapDrawable$InitializationTask.doInBackground(TileBitmapDrawable.java:389) 02-05 15:49:29.094: E/AndroidRuntime(20628): at com.diegocarloslima.byakugallery.lib.TileBitmapDrawable$InitializationTask.doInBackground(TileBitmapDrawable.java:1) 02-05 15:49:29.094: E/AndroidRuntime(20628): at android.os.AsyncTask$2.call(AsyncTask.java:287) 02-05 15:49:29.094: E/AndroidRuntime(20628): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 02-05 15:49:29.094: E/AndroidRuntime(20628): ... 5 more 02-05 15:49:29.144: D/skia(20628): ---- fAsset->read(757392) returned 0

    bug 
    opened by mangareader 7
  • fix crash bug on black rectangle.

    fix crash bug on black rectangle.

    Hi. ByakuGallery is very useful for me. Thank you, Thank you!!

    In some cases, the crash bug occurs. I had to add a test case to bug. And add a code for fix it. Please review my code.

    opened by azki 3
  • Don't throw exception on failure

    Don't throw exception on failure

    • Instead of throwing the exception when BitmapRegionDecoder.newInstance fails, trigger an onError(Exception) callback.
    • Update compile SDK and grade version
    • Add a way to clear the bitmap cache as it can fill up rather quickly

    Most of the conflicts are due to the formatter be run.

    opened by Kennyc1012 2
  • Display image from bitmap

    Display image from bitmap

    Thanks you for awesome library. But I have a question. Do this library support load image from a bitmap.

    Because I have a use case : download image from universal image loader, and get a bitmap from it. But I can't use your library to display from bitmap

    question 
    opened by luckymancvp 1
  • fix of memory leaking

    fix of memory leaking

    Using your library I found an issue of memory leak. That's because ViewPager does not remove ImageView from FragmentManager. You can see that printing dump of FragmentManager. So I remove a link between ImageView and Bitmap. Please check it. Best Regard.

    opened by denys-kravchuk 0
  • Scale Type FitCenter and Extra zoom required

    Scale Type FitCenter and Extra zoom required

    I am making an application with a requirement of initial scale as fitCenter and ability to zoom beyond actual pixel size of image,

    Unfortunately since this library throws exception if any scale type other than matrix is selected plus it does not let zoom beyond pixel limit

    opened by noumantahir 1
  • How to use for Eclipse project

    How to use for Eclipse project

    I use MuPDF library, in which we provide pdf's to the library and it gives me bitmaps.Now I need to tile this bitmaps.How to use this library according to my requirement in Eclipse.Thank you

    opened by saipavan1223 0
  • How to limit imageview's min scale in x

    How to limit imageview's min scale in x

    Now i have a picture, it's size is 990 X 18464 , when first load picture into imageview, it's's very small. I onDoubleTap it ,it looks better. I had seen mMaxScale in TouchImageView, but no mMinScale , please help me , thank you

    opened by t2314862168 1
  • Images are sampled too much and look grainy

    Images are sampled too much and look grainy

    I am passing image paths from my photo gallery to this library, when it loads them in gallery view in the sample provided, the image is not sharp it is down sampled too much.

    How can I stop it from making the image too low quality?

    I played around with InitializationTask in TileBitmapDrawable and set options.inSampleSize = 1 as well as other things but it made no difference

    opened by Brblol 0
Releases(0.1.0)
Owner
Diego Lima
Learning a bit every day.
Diego Lima
Android library (AAR). Highly configurable, easily extendable deep zoom view for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.

Subsampling Scale Image View A custom image view for Android, designed for photo galleries and displaying huge images (e.g. maps and building plans) w

null 7.4k Jan 8, 2023
Android library project for cropping images

I guess people are just cropping out all the sadness An Android library project that provides a simple image cropping Activity, based on code from AOS

Jamie McDonald 4.5k Dec 29, 2022
Custom view for circular images in Android while maintaining the best draw performance

CircularImageView Custom view for circular images in Android while maintaining the best draw performance Usage To make a circular ImageView, add this

Pkmmte Xeleon 1.2k Dec 28, 2022
Android ImageView that handles animated GIF images

GifImageView Android ImageView that handles Animated GIF images Usage In your build.gradle file: dependencies { compile 'com.felipecsl:gifimageview:

Felipe Lima 1.1k Mar 9, 2021
A gallery used to host an array of images

ImageGallery Overview A gallery used to host an array of images You can add one or more images to the gallery Support for using Palette to set the bac

Etienne Lawlor 645 Dec 18, 2022
DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator.

DexMovingImageView DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope o

Diego Grancini 310 Feb 7, 2022
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
RasmView - an Android drawing view; it provides a view that allows users to draw on top of a bitmap.

RasmView RasmView is an Android drawing library; it provides a view that allows users to draw on top of a bitmap. Demo https://www.youtube.com/watch?v

Raed Mughaus 39 Dec 23, 2022
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice

AvatarImageGenerator Generate first letter avatar Image like gmail's contact avatar. It generates an drawable that can be be set to an ImageView. Inst

Korir Amos 61 Sep 25, 2022
Android library written in kotlin that add a noise effect to image.

NoiseView With NoiseView you can easily add a noise effect to your image. See demo on YouTube Setup The library is pushed to jCenter() as an AAR, so y

Przemek 46 Sep 8, 2022
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
This is a library for make auto slide image in android

Auto Image Slider Screenshot Image Slider Default Image Slider With Custom Adapter Usage Add ImageSlider to your layout

Afdhal_FA 17 Dec 1, 2022
Android Blurred ImageSwitcher Library

Android Blurred ImageSwitcher Library

Chrisvin Jem 48 Jul 2, 2022
Android Library for cropping an image at ease.

Cropper - Android Image Cropper Android Image Cropper Powerful (Zoom, Rotation, Multi-Source); Customizable (Shape, Limits, Style); Optimized (Async,

Akshat Tiwari 24 Aug 24, 2022
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

Vivek Verma 163 Dec 31, 2022
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

Albert Grobas 531 Dec 25, 2022
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

Baseflow 18.4k Dec 30, 2022
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Henning Dodenhof 13.8k Mar 29, 2021