1. 程式人生 > >*.pvr.ccz與png格式的互轉

*.pvr.ccz與png格式的互轉

這兩天在看一個安卓遊戲,資源挺不錯的,解壓後發現animation裡的圖片格式全是pvr.ccz,查了下,這是做2D遊戲spirit圖打包後的格式,用的軟體是TexturePacker,知道了軟體那就知道如何解回去了。

  1. 安裝TexturePacker

  2. 將如下程式碼存成批處理

    @echo off
    path %path%;"C:\Program Files (x86)\TexturePacker\bin"
    for /f "usebackq tokens=*" %%d in (`dir /s /b *.pvr *.pvr.ccz *.pvr.gz`) 
    do (TexturePacker.exe "%%d" --sheet "%%~dpnd.png" --data "%%~dpnd.plist" 
        --opt RGBA8888 --allow-free-size --algorithm Basic --no-trim --dither-fs)
    pause
  3. 將上面的批處理放在你的資料夾目錄下,執行即可(支援遍歷子目錄)

將圖片打包成pvr.czz,同樣是需要一個批處理

@echo off
path %path%;"C:\Program Files (x86)\CodeAndWeb\TexturePacker\bin"
for /f "usebackq tokens=*" %%d in (`dir /s /b *.png`) do (
TexturePacker.exe "%%d" --sheet "%%~dpnd.pvr" --data "%%~dpnd.plist" 
  --opt PVRTC4 --allow-free-size --algorithm Basic --no-trim --dither-fs
)
pause