在this post,我想知道爲什麼我的PNG文件被嚴重顯示在Retina顯示屏。少見PNG文件的iOS顯示
我finaly發現問題來自於PNG文件本身:當我打開它,並用photoshop或別的東西,這個問題再次disapear保存它。
提議this post,我用幾口命令來查看究竟形成了我的PNG文件。我有original-image.png
(帶毛刺)和photoshoped-image.png
命令
sips original-image.png -g all
給我
pixelWidth: 256
pixelHeight: 256
typeIdentifier: public.png
format: png
formatOptions: default
dpiWidth: 72.000
dpiHeight: 72.000
samplesPerPixel: 3
bitsPerSample: 8
hasAlpha: no
space: RGB
而且
sips photoshoped-image.png -g all
給我
pixelWidth: 256
pixelHeight: 256
typeIdentifier: public.png
format: png
formatOptions: default
dpiWidth: 72.000
dpiHeight: 72.000
samplesPerPixel: 4
bitsPerSample: 8
hasAlpha: yes
space: RGB
profile: HD 709-A
所以3間的區別:
- samplePerPixel
- hasAlpha
- 的photoshoped文件都有一個配置文件。
但是這些特性只讀在sips中,我不知道如何改變它們以準確理解錯誤來自哪裏。
有什麼想法?
如何刪除Alpha通道? 'sips 1.png -s hasAlpha no' does not work,cause hasAlpha is read-only(https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/sips.1 .html) – Martin 2012-07-23 13:38:58
我相信你可以使用samplesPerPixel = 3來做到這一點,或類似的東西。谷歌圍繞使用啜飲或實驗 - 起初有點令人生畏,但由於其命令行可以快速工作。要查看新圖像,只需在終端中顯示「open」,它將在預覽中打開圖像。 –
2012-07-23 14:10:28
嗯......似乎samplesPerPixel也是一個只讀屬性。 – Martin 2012-07-23 15:46:13