Game Development Community

[SOFTWARE] Batch PNG to PVRTC and PVR for the iphone

by Edoardo · in iTorque 2D · 07/30/2010 (9:17 am) · 1 replies

As you may know PNG’s look great on the iphone, although they take up allot of memory when you use allot of frames in your animation. There is the option to use PVRTC/PVR images with the trade off that they dont look so great on the iphone but are very small when it comes to there memory usage. The problem is that Apple tells you in their (Technical Q&A QA1611) to use terminal and their “Texturetool” to process each PNG to the PVRTC/PVR format. This can be a bit of an undertaking when there are tons of frames in your animations.

And as a designer I tend to stay away form potentially blowing up my computer trying some crazy image converting in terminal. And I think I can assume that most designer/animators would. So I thought it might be helpful to build an app that can take care of the process for you and BATCH process the PNG’s to PVRTC/PVR images with a PNG preview for each PVRTC/PVR image.

This converter will batch process all PNG images in the selected folder and output them as PVR images with a PNG preview for each PVR image.

It allows you to create four variants of PVR data, the primary difference being tradeoffs between quality and size.
You will have to experiment with these variants to determine which setting is the best compromise for each individual texture image.

Encoders:

–channel-weighting-linear
–channel-weighting-perceptual
–bits-per-pixel-2
–bits-per-pixel-4

IMPORTANT: Source images for the encoder must satisfy these requirements:
• Height and Width must be a power of 2.
• Must be square (height==width).
• Source images must be .png or .PNG
• There CAN NOT be any spaces in the path to the PNG file or the name of the PNG itself.

BEST PRACTICE:
• Place this app in your Applications folder and create a shortcut to it in your dock.
• Create a folder on your desktop called “Converted” or something without spaces.
• Now place your PNG’s in it “image1.png, image2.png, and so on”.
• Finally run this converter on that folder “Converted”.

WARNING: Valid PVR data is at least 32 bytes in size. This means that images that are 8×8 or smaller will be padded to 32 bytes total before being written to the archive. For example, compressing a 4×4 image consumes 32 bytes, even though it only requires 8 bytes of storage.

Here is an example of the command that is ran in terminal:

Encode Image.png into PVR using linear weights and 4 bpp, and saving the output as Image_L4.pvr and a PNG preview as Image_preview_L4.png

user$ texturetool -m -e PVRTC –channel-weighting-linear –bits-per-pixel-4 -o Image_L4.pvr -p Image_preview_L4.png PATH/TO/THE/IMAGE/Image.png


DOWNLOAD:
www.jbullfrog.com/apps/Converter_V1.zip

#1
07/30/2010 (3:28 pm)
Looks like a useful tool. It would be a good idea to add more information about it, though. My first thought was that it was forum spam since all I saw was a link.