Domanda

Which image format will allow my application startup faster, BMP or JPG?

È stato utile?

Soluzione

Most of the time goes to disk activity to load the image. Then for this JPEG can be smaller and hence faster. However, for the presentation the pixel values are needed, and the BMP (if it's not compressed) has those directly, while the JPEG needs to be unpacked. I suspect those that there's at least an order of magnitude difference between those times, so that disk access time completely overshadows the unpacking/presentation time.

That said,

  • this time is likely so fast anyway that the user won't be able to see any difference, and

  • if you want more than hunches and gut-feeling (even if based on experience), MEASURE!.

Altri suggerimenti

JPG - smaller faster better. WHY? Because its smaller and decompression occurs in memory(which is faster than hard-disk). BMP file is much larger, and uncompressed.

ON the other hand, if the CPU is slow, and disk is substantially fast. BMP will be a better option. Also this would depend on the type of BMP(16/24/32 bit per pixel) and quality of JPEG. Since its very hard to guess either size of the image file or speed of the questioner's computer. Its hard to answer ACCURATELY. Both conditions seem valid.

Measuring is the only way ahead.

Hard disk reads chunks of storage so if it slow is it will affect jpg and bmp so try to use small bmp to avoid decompression and avoid reading two chunks of storage. Or use one jpg that fits into one chunk and when decompressed will give you more bmp equivalent image size.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top