0

I have tried the following methods,

  • normal image upload.
  • encoding and decoding.

these two methods are taking long time to upload the image.

Any suggestion?

sasikkumar
  • 216
  • 2
  • 11

1 Answers1

1

There are some simple ways:

  1. Reduce the size of the image. From 1000x1000 to 500x500
  2. Reduce the bpp of the image. For example instead of RGBA representation (32 bits per pixel) use RGB_565 (16bits per pixel) or even gray level image (8bits)
  3. Reduce the quality of the image. Save it as .jpg. This will make the image much smaller. You can play with the quality parameter of jpeg. 100% means very high quality and large files, 1% means extremely tiny images (~40 times smaller) but all the details will be lost.
  4. Save the image in Jpeg200 format. It reduces the size even further. Not every browser supports this format, so you might need to convert it to regular jpeg.
    1. Use pyramids of images. For example. You have 1000x1000 image. Reduce its size by 2 to get 500x500, reduce again and again. Now you got 4 images 1000x1000, 500x500, 250x250, 125x125. You upload the 4 of them. Starting from the smallest to the largest. The smallest image will be uploaded very quick and you will be able to display it (though it is in lower resolution). Next when a better image arrives you update the display and resolution enhances. The effect would be that the basic image is loaded extremely fast and over time the resolution is enhanced. The transfer time of the 4 images will take only 30% more time than the original but the first one will arrive 64 times faster than the original

These are the basic solutions. If they are not what you needed please refine the question

DanielHsH
  • 4,287
  • 3
  • 30
  • 36