type-conversionpvrtc

Convert PVRTC graphics to PNG/TGA


I have around 2000 PVRTC graphics which are used to make a bigger image by combining them. To process this with my script, I need to convert this graphics into TGA or PNG format but keeping the original filenames. I know that PVRTexTool can convert it by saving images as a new type, but manual processing of 2000 graphics is impossible. Is there a way to convert multiple PVRTC graphics at once?


Solution

  • An answer that's an update to my comment above, kindly supplied by a colleague:

    With a bit of coaxing, the command line tool, PVRTexToolCLI.exe will do the decompression. Assuming your input PVRTC file is ABC.pvr (it might also work with .dds but I've not tried), and you want to decompress to ABC.png, use

    PVRTexToolCLI -f R8G8B8A8 -d ABC.png -i ABC.pvr
    

    It seems it also produces an extra .pvr file (probably ABC.Out.pvr) so just delete these afterwards.

    How you create the script to do all of them is up to you but perhaps you could use cygwin.

    You also mentioned "...with TexturePacker (oddly image size became 516x516 from 512x512)".
    By coincidence, I asked almost the same question to Andreas Loew. He said that a 2 pixel border is placed around all the images and so if there's only one and, I guess, it's completely opaque, it'll become 4 pixels taller and wider.

    Finally - and excuse the blatant plug - you might be better off asking this sort of question on the PowerVR Insider forum. :-)