快速調整圖片大小:T-REZ
一個超級快的圖片大小調整Go庫,構建opencv 和 jpeg-turbo 之上。
這個包能夠保持圖片品質,雖然專注于速度。它會剔除圖片元信息如IPTC, EXIF, ColorSync profile等。
特性
當前支持:
fit
resize algofill
resize algobackground
colorgravity
in case offit
quality
of jpeg (default95
)
基準測試
On:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 45
Stepping: 7
CPU MHz: 1895.270
BogoMIPS: 3790.86
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 15360K
NUMA node0 CPU(s): 0-5,12-17
NUMA node1 CPU(s): 6-11,18-23
運行24個線程:
$ GOMAXPROCS=24 go run bench/main.go -file testdata/American_Dad.jpg -size 200x200 -workers 24
## Resize speed of 14000 resizes
mean: 34.377864ms
min: 20.395457ms
max: 61.757311ms
%99: 55.475588ms
stdDev: 4.781191ms
rate: 700.16 ops (images resized per second)
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!