2 ms·
Actually here you go: I took the first image from here: http://www.dwellable.com/h/8559/Cape-Cod/Upper-Cape-Cod/Falmouth/East-Falmouth/155-Teaticket-Path http:
by kstenerud 14y ago
Actually here you go:
I took the first image from here: http://www.dwellable.com/h/8559/Cape-Cod/Upper-Cape-Cod/Falmouth/East-Falmouth/155-Teaticket-Path http://www.dwellable.com/h/8559/Cape-Cod/Upper-Cape-Cod/Falm...
Cropped it to 1024x1024 (you'd of course make a sprite sheet instead). Then shrank it to 512x512 just for demonstration purposes.
I then converted it using texturetool, also back-converting it to make a png with exactly the pixels produced in the PVRTC image:
$ texturetool -e PVRTC --channel-weighting-perceptual --bits-per-pixel-2 -p converted2.png -o converted2.pvrtc original.png
$ texturetool -e PVRTC --channel-weighting-perceptual --bits-per-pixel-4 -p converted4.png -o converted4.pvrtc original.png
The PVRTC images are significantly smaller, both on disk and in memory:
$ ls -l original.png
-rw-r--r-- 1 kstenerud staff 571225 Jul 27 15:10 original.png
$ ls -l converted*.pvrtc
-rw-r--r-- 1 kstenerud staff 65536 Jul 27 15:12 converted2.pvrtc
-rw-r--r-- 1 kstenerud staff 131072 Jul 27 15:12 converted4.pvrtc
Here's the quality:
Original image: http://i.imgur.com/flT7c.png http://i.imgur.com/flT7c.png
4bpp image (converted back to png): http://i.imgur.com/Itz4F.png http://i.imgur.com/Itz4F.png
2bpp image (converted back to png): http://i.imgur.com/tzqlw.png http://i.imgur.com/tzqlw.png
- gurgeous 14y agoOoh, cool! We're using JPGs, though. At quality 75: 67K flT7c.jpg 558K flT7c.png Once those JPGs make it across the network and arrive on the device, we're stuck with plain old CGImages, right?
- kstenerud 14y agoYeah. When you load a JPEG image, it gets decoded to a 32bpp image in memory on the device. PVRTC images, on the other hand, stay the same size (2bpp or 4bpp) when loaded into memory. Plus they don't need to be decoded. So this 512x512 image would take 64k of RAM using 2bpp pvrtc, 128k using 4bpp pvrtc, and a whopping 1MB using JPEG or PNG.