Start a Project

How we can work with Image Effects in Android

In this article, we will read How we can work with Image Effects in Android. Android provides bitmap classes for handling images.

bitmap

a bitmap is an object, which is an instance of the Bitmap class and this class represents 2D coordinate. Everything that is drawn in android is a bitmap.

The first parameter used for width and the second for height.Third parameter user for types of the pixel. The ARGB_8888 means specify four-channel Alpha, Red, Green, and blue.

You can get pixel from bitmap and process it.

And you can set bitmap pixel from the setPixel method.

Let us start code for it.

MainActivity

We create an ImageView and taken some buttons. while clicking on the button we change the color of the pixels.

activity_main

please check the below images. I have taken an image and click on blue its effect has changed.

 

 

In the below image, we have changed it to green color and you can check its effect changed to green.

 

In the below image, we have changed it to red color and you can check its effect changed to red.

 

 

So here we discussed How we can work with Image Effects in Android.  Thanks for reading this blog and You can get other blogs from here

 

 

Exit mobile version