Grayscale image view

      No Comments on Grayscale image view

Creating a grayscale image is not a problem in iOS, but I wanted to be able to animate an image view from grayscale to full color.

It turned out to be a pretty simple operation, all you have to do is create a grayscale image, and fade-in the original image. Kind of a hack, I know, but it does the job 🙂 So if you start with this image:

grayscale-img1

By increasing saturation to around 50% you would get something like this:

grayscale-img2

And finally you would get this:

grayscale-img3

When we leave out the boilerplate code this is all you need:

Pretty simple. If you want to play around with this code, or use it in your own projects, feel free to download it from github: DAGrayscaleImage

Have a nice day 🙂

0

Leave a Reply