ASTC
## https://github.com/ARM-software/astc-encoder
## 建议用astcenc-sse2, astcenc-avx2在laya会反转
## 压缩
astcenc -cl example.png example.astc 6x6 -medium
## 解压
astcenc -dh example.astc example.tga
## 测试
astcenc -tl example.png example.tga 5x5 -thorough
## 压缩 预乘Alpha
astcenc -cl example.png example.astc 6x6 -medium -pp-premultiply
PVRTexTool
D:\Program Files\Unity-2018.4.0f1\Editor\Data\Tools\PVRTexTool.exe
PVRTexTool Command Line Options (imgtec.com)
| -square + | 正方形, 取大的值 |
|---|---|
| -square - | 正方形, 取小的值 |
| -pot + | 幂大小, 取大值 |
| -pot - | 幂大小, 取小值 |
| -r [width],[height] | 缩放,设置大小, -r 512,256 |
| -rfilter [nearest|linear|cubic] | 采样方式 |
| -f PVRTC1_2 | |
| -f PVRTC1_2_RGB | 无Alpha通道 |
| -i 输入文件路径 | |
| -o 输出文件路径 prv | |
| -d 输出文件 png, [可选] |
PVRTexTool.exe -f PVRTC1_2,UBN,lRGB -i 2.png -o 2.pvr -d 2_pvr.png -square +
## 正方形 取小的值
PVRTexTool.exe -f PVRTC1_2 -i 2.png -o 2.pvr -d 2_pvr.png -square -
ETC
D:\Program Files\Unity-2018.4.0f1\Editor\Data\Tools\etccompress.exe
## ETC1, 无Alpha通道
etccompress.exe -i 2.png -o 2_etccompress.ktx -q fast -e numeric -c etcpak -f etc1_rgb -y noflip
## ETC2, 有Alpha通道
etccompress.exe -i 2.png -o 2_etccompress.ktx -q fast -e numeric -c etcpak -f etc2_rgba -y noflip
DDS
ImageMagick – Command-line Tools: Convert
(10条消息) 关于dds文件和3dc技术的一点知识_cslie的专栏-CSDN博客
D:\Program Files\ImageMagick-7.1.0-Q16-HDRI\convert.exe
convert 2.png -format dds -define dds:compression=dxt5 2.dds
PVRTexTool.exe -f DXT4 -i 2.png -o 2.dds -p
Convert -resize 缩放图片
| 1334x750 | |||
|---|---|---|---|
| scale% | 高度和宽度均按指定百分比缩放。 | convert 3.png -resize ‘200%’ 3_resize_200.png | 2668x1500 |
| scale-x%xscale-y% | 按指定百分比分别缩放高度和宽度。(只需要一个%符号。) | convert 3.png -resize ‘50%x200%’ 3_resize_50_200.png | 667x1500 |
| width | 给定宽度,自动选择高度以保持纵横比。 | convert 3.png -resize ‘1024’ 3_resize_1024.png | 1024x576 |
| xheight | 高度给定,宽度自动选择以保持纵横比。 | convert 3.png -resize ‘x512’ 3_resize_x512.png | 911x512 |
| widthxheight | 给定高度和宽度的最大值,保留纵横比。 | convert 3.png -resize ‘1024x512’ 3_resize_1024x512.png | 1024x576 |
| widthxheight^ | 给定宽度和高度的最小值,保留纵横比。 | convert 3.png -resize ‘1024x512^’ 3_resize_1024x512_2.png | 911x512 |
| widthxheight! | 着重给出了宽度和高度,忽略了原始纵横比。 | convert 3.png -resize ‘1024x512!’ 3_resize_1024x512_3.png | 1024x512 |
| widthxheight> | 收缩尺寸大于相应宽度和/或高度参数的图像。 | convert 3.png -resize ‘1024x512>’ 3_resize_1024x512_4.png | 911x512 |
| widthxheight< | 放大尺寸小于相应宽度和/或高度参数的图像。 | convert 3.png -resize ‘1500x1024<’ 3_resize_1024x512_6.png | 1500x843 |
| area@ | 调整图像大小,使其具有以像素为单位的指定区域。宽高比保持不变。 | convert 3.png -resize ‘10000@’ 3_resize_1024x512_7.png | 133x74 |
| x:y | 这里x和y表示长宽比(例如,3:2=1.5)。 | convert 3.png -resize ‘1:4’ 3_resize_1024x512_8.png | 188x750 |
| {size}{offset} | 指定偏移量(默认值为+0+0)。下面,{size}指的是上面的任何形式。 | ||
| {size}{+-}x{+-}y | 水平和垂直偏移x和y,以像素为单位指定。两者都需要标志。偏移受-gravity设置的影响。偏移不受%或其他大小运算符的影响。请注意,除“中心”外,对于所有重力选项,正X和Y偏移都是朝向图像中心的向内方向。对于东部,+X是左侧。对于南方,+Y向上。东南方向,+X向左,+Y向上。对于中心,使用法线X和Y方向约定(+X为右,+Y为下)。 |