因為需要大量將圖片轉檔成較省空間的 rgba4444 格式,研究了一下 TexturePacker command line tool, 只能說,TexturePacker 真的太好用了啊!!!!
轉檔邏輯為將指定檔案夾下所有的 .png 原圖命名加後綴 @2x 順便輸出 0.5 scale 的小圖,所以不需要兩種輸出的可以將最後兩段倍數輸出設定刪除。
轉檔邏輯為將指定檔案夾下所有的 .png 原圖命名加後綴 @2x 順便輸出 0.5 scale 的小圖,所以不需要兩種輸出的可以將最後兩段倍數輸出設定刪除。
--variant 1:@2x \
--variant 0.5:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find <images folder> -name \*.png | sed 's/\.png//g' | \ | |
xargs -I % -n 1 TexturePacker %.png \ | |
--sheet %{v}.png \ | |
--data dummy{v}.plist \ | |
--algorithm Basic \ | |
--allow-free-size \ | |
--max-width 4096 \ | |
--max-height 4096 \ | |
--size-constraints AnySize \ | |
--no-trim \ | |
--opt RGBA4444 \ | |
--dither-fs \ | |
--border-padding 0 \ | |
--shape-padding 0 \ | |
--inner-padding 0 \ | |
--extrude 0 \ | |
--variant 1:@2x \ | |
--variant 0.5: | |
rm -r dummy*.plist |
Comments
Post a Comment