Bittoo February 2016

How to show Blurred image before downloading(like in whatsapp) in ios?

I am making a Chat application for image sending and downloading. I want to do some animation like in WhatsApp. So, how to show the blurred image? My image is downloaded from server. Please help me.

Answers


Evil Tak February 2016

Scale the image down to a very small size like say 8x8 pixels. Send that data to the client. It should not be more than 4 * 8 * 8 = 256 B or 0.25 KB in size, so sending it to the client will not be a problem no matter how slow the client's connection speed is.

Then scale the received 8x8 image to the resolution of the preview box (for example 256x256). You shouldn't need to upsample the 8x8 image if the preview box is a UIImageView (see the link below). This downsampling and successive upsampling of an image "blurs" the image.

To understand how you can resample/rescale an image in iOS, check this link. (I can't help you much in performing this task specifically for iOS, since I am not an iOS developer.)


Omal Perera February 2016

I think that process is done using the server... As I konw, there ara 2 images for a one image..

  • one image with full quality
  • other image is a thumbnail of original image.. (low size in capacity )

So.. before downloading the original picture client app calls for the URL of the thumbnail & it downloads very quickly since its size is less.. Meanwhile you can use an async function to download original file in the same time..

That is the process...

Hope it will be help for you!!

Post Status

Asked in February 2016
Viewed 2,763 times
Voted 10
Answered 2 times

Search




Leave an answer