Http://blog.sina.com.cn/s/blog_6fbe210701015j7z.html
The spritesheet generated by zwoptex can export images in PNG format but also in PVR format. The PVR format can be directly read by the IOS display chip and can be directly displayed without parsing. Therefore, the rendering speed is faster and the memory is saved.
I specifically tested cocos2d 2.0 RC1:
The memory occupied by an empty cocos2d template project is about 4 MB.
After a 2048*1024 PNG Image in the format of rgba565 is displayed with ccsprite, the memory usage reaches 20 mb. In the same case, the memory usage is 16 MB after the format is changed to PVR. That is to say, images in PNG format occupy 20-4 = 16 MB, while those in PVR format occupy 16-4 = 12 Mb. Reduced by 25%. Zwoptex also has an option called "CCZ compression". After selection, the image size can be reduced by almost half. The file format is XXX. PVR. CCZ, which can be recognized by cocos2d.
Pvrtc2 And
Pvrtc4 They are two PVR compression image formats, both of which are PVR files. These two image formats provide faster loading speed and smaller memory usage than normal images.
Pvrtc4:
Compressed Format, 4 bits per pixel, OK Image Quality
Pvrtc2:
Compressed Format, 2 bits per pixel, poor image quality Generally, the image formats of PVR files include:
Rgba8888:
32-bit texture with alpha channel, best image quality
Rgba4444:
16-bit texture with alpha channel, good image quality
Rgb565:
16-bit texture without alpha channel, good image quality but no alpha (transparency) The formula for memory usage of images is:
Numbytes
= Width * height * bitsperpixel/8 That is to say, 2048*2048 of rgba8888 occupies 16 MB of memory, while pvrtc4 only occupies 2 MB.