PVRTC issues

Good morning!

I come to you with a very urgent request:

Developing an app that is basically an interactive book. This means that there are 1500 pages, each a separate image file, currently imported as a compressed sprite.

PC build? Perfect.
Android build? Perfect
iOS build? Of course it gives headaches.

Instead of using the images at their original size (roughly 100k each), xcode decides to explode them to about 12mb, making the game size go from 100mb to 1.8gb.

After some serious investigation, the issue is that iOS just wants PVRTC. Unfortunately, my images (again, 1500 images) are not scaled to the power of two (1024x768) so a straightforward compression is not possible.

Tried xcode textureTool and even PVRTexTool. Nothing.

What can I do? How can I compress the images (in batches, if possible) without having to redo them one by one?

Thanks!

The image size is not a guide for size on a particular platform (if that’s what you mean when you say 100k original size). And it’s not Xcode, it’s Unity that creates the platform specific representation of an imported texture.

If you switch Unity to the iOS platform you’ll see in the inspector that a single RGB 1024x768 texture without mipmaps takes 2.2Mb at Truecolor format, and 1.5Mb at 16-bit format. If you texture was 1024x1024 then it would take 0.5Mb at PVRTC format.

You could try atlases, and put 20 of your 1024x768 textures into a single 4096x4096 atlas texture, which would then compress to 8Mb with PVRTC.

Trying something similar:

Batched a photoshop action to add white borders to every image (thank the gods all images have a white background) so they end up squared.

Unity removed the compression alert, and now it’s compiling.

Fingers crossed

So, spent the last 15 hours investigating this issue, skipping sleep.

What a waste of time. If only I had read sooner that Unity automatically converts square images to PVR, I wouldn’t have had to get the last 5 coffees :smile:

Issue solved: just had to make the images squared at 1024 per side. App size now under 300mb. Sigh.

Will leave the thread for anyone else that encounters this issue.

I assumed you knew that.

Nope, relatively new to iOS development.

I’m more of a PC guy :slight_smile: