-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8-bit PNG #62
Comments
這是為了省頻寬嗎?用http header的gz會不會比較單純? 2016/11/18 上午12:30,"Mingye Wang" notifications@github.com寫道:
|
java 写 PNG 似乎已经 best deflate 了,gz 肯定动不了多少。(本来碰 deflate 之后的档案,gz 肯定也不行啊…) |
目前繪圖所用顏色基本只有一種(加上 Anti-Alias 得到的 Alpha),應該可以考慮將 PNG 轉為 256 索引顏色(8-bit)模式(這麼多灰階很夠用了)。測試將楷體 biang 以 pngquant 轉為 256 索引色(8-bit),檔案大小由 6403 位元組減少至 4967 位元組(77.6% 原大小);轉為 64 索引色(4-bit),檔案大小為 3516 位元組(54.9%)。
要實作的話,StackOverflow 上已有前人經驗。
其中
ImageTypeSpecifier.createIndexed
基本上是應該傳入幾個這樣的陣列:之後
PNGMetadata
感覺是直接用之前建立的ImageTypeSpecifier
去initialize
一下就好,總之先寫下來有空去做吧。pngquant 處理的結果如下所示。如果看得出區別的話,應該都是在字邊緣處。
64
256
原始
The text was updated successfully, but these errors were encountered: