Android image memory computing

Source: Internet
Author: User

There are four types of Android:

Alpha_8: each pixel occupies 1 byte of memory

Argb_4444: each pixel occupies 2 bytes of memory

Argb_8888: each pixel occupies 4 bytes of memory

Rgb_565: each pixel occupies 2 bytes of memory

The default color mode for Android is argb_8888. This color mode features the most delicate colors and the highest display quality. However, the memory is also the largest.

For example, if a 32-bit PNG (argb_8888) pixel is 1204*1024, the occupied space is:

1024x1024 * (32/8)

Because 8bit = 1 byte, 32-bit is 4byte. We recommend that you use the argb_4444 mode to parse the image in OOM mode, which saves half of the memory space.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.