- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有大量来自从事一个项目的艺术家提供的图像。这些图像有不同的规范,但都是PNG。有些是 8 位索引(调色板),有些是带有 alpha 32 位和 64 位 PNG 的真彩色。
现在,我正在尝试使用 imagemagick 将所有这些图像推送到单一的连贯格式,但我面临着一个痛苦的问题。我注意到从带有 alpha(16 位 channel 深度)的真彩色转换而来的图像非常有用。但是,每 channel 8 位图像,或者可能更低/更高的图像会有些损坏,并且我们拥有的渲染引擎(在 iOS 上)将无法正确显示图像。
有没有办法简单地将所有图像可靠地转换为具有 alpha PNG 格式(RGBA8888)的每 channel 8 位真彩色?
(注意:我在维基百科链接中读到真彩色和 alpha 每个 channel 至少 32 位,我需要通过修剪来减少深度以减小文件大小。渲染引擎也会处理这个问题。)
我尝试了以下命令:
/opt/local/bin/convert -depth 8 {} {}
/opt/local/bin/convert {} -depth 8 {}
/opt/local/bin/convert {} -colorspace sRGB -depth 8 {}
/opt/local/bin/convert {} -type truecolormatte -depth 8 {}
Image: bu_hu_townhall_l01.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 640x558+0+0
Resolution: 28.35x28.35
Print size: 22.575x19.6825
Units: PixelsPerCentimeter
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 207.468 (0.8136)
standard deviation: 60.7017 (0.238046)
kurtosis: 1.18939
skewness: -1.39109
Green:
min: 0 (0)
max: 255 (1)
mean: 205.419 (0.805565)
standard deviation: 56.0321 (0.219734)
kurtosis: 1.15995
skewness: -1.22368
Blue:
min: 0 (0)
max: 255 (1)
mean: 174.337 (0.683673)
standard deviation: 79.2051 (0.310608)
kurtosis: -0.8628
skewness: -0.578582
Alpha:
min: 0 (0)
max: 255 (1)
mean: 96.4893 (0.37839)
standard deviation: 123.454 (0.484134)
kurtosis: -1.74557
skewness: -0.501528
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 186.434 (0.731112)
standard deviation: 84.1704 (0.33008)
kurtosis: 0.210139
skewness: -1.19818
Alpha: srgba(255,255,255,0) #FFFFFF00
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
red primary: (0.63999,0.33001)
green primary: (0.3,0.6)
blue primary: (0.15,0.05999)
white point: (0.31269,0.32899)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 640x558+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2013-07-19T12:48:10-07:00
date:modify: 2013-07-19T12:48:10-07:00
png:bKGD: chunk was found (see Background color, above)
png:cHRM: chunk was found (see Chromaticity, above)
png:gAMA: gamma=0.45454544 (See Gamma, above)
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 6
png:IHDR.color_type: 6 (RGBA)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 640, 558
png:pHYs: x_res=2835, y_res=2835, units=1
png:sRGB: intent=0 (Perceptual Intent)
png:text: 2 tEXt/zTXt/iTXt chunks were found
signature: 547acae3cbfddef87d1ec49fb4dbe259772343ed121a8f9bfe2f1846fc542cf0
Artifacts:
filename: bu_hu_townhall_l01.png
verbose: true
Tainted: False
Filesize: 333KB
Number pixels: 357K
Pixels per second: 17.86MB
User time: 0.010u
Elapsed time: 0:01.019
Version: ImageMagick 6.8.6-0 2013-07-03 Q16 http://www.imagemagick.org
Image: red_circle.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 256x256+0+0
Resolution: 28.35x28.35
Print size: 9.02998x9.02998
Units: PixelsPerCentimeter
Type: PaletteAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 1-bit
green: 1-bit
blue: 1-bit
alpha: 8-bit
Channel statistics:
Red:
min: 255 (1)
max: 255 (1)
mean: 255 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Green:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Blue:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Alpha:
min: 0 (0)
max: 40 (0.156863)
mean: 6.30113 (0.0247103)
standard deviation: 10.7071 (0.0419887)
kurtosis: 1.47694
skewness: -1.66221
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 125.925 (0.493822)
standard deviation: 5.35356 (0.0209944)
kurtosis: 309547
skewness: 77.6945
Alpha: srgba(255,0,0,0) #FF000000
Colors: 41
Histogram:
37164: (255, 0, 0, 0) #FF000000 srgba(255,0,0,0)
4416: (255, 0, 0, 1) #FF000001 srgba(255,0,0,0.00392157)
1974: (255, 0, 0, 2) #FF000002 srgba(255,0,0,0.00784314)
1394: (255, 0, 0, 4) #FF000004 srgba(255,0,0,0.0156863)
1154: (255, 0, 0, 5) #FF000005 srgba(255,0,0,0.0196078)
982: (255, 0, 0, 8) #FF000008 srgba(255,0,0,0.0313725)
942: (255, 0, 0, 7) #FF000007 srgba(255,0,0,0.027451)
893: (255, 0, 0, 10) #FF00000A srgba(255,0,0,0.0392157)
758: (255, 0, 0, 3) #FF000003 srgba(255,0,0,0.0117647)
754: (255, 0, 0, 11) #FF00000B srgba(255,0,0,0.0431373)
752: (255, 0, 0, 14) #FF00000E srgba(255,0,0,0.054902)
749: (255, 0, 0, 13) #FF00000D srgba(255,0,0,0.0509804)
698: (255, 0, 0, 16) #FF000010 srgba(255,0,0,0.0627451)
684: (255, 0, 0, 17) #FF000011 srgba(255,0,0,0.0666667)
657: (255, 0, 0, 19) #FF000013 srgba(255,0,0,0.0745098)
636: (255, 0, 0, 20) #FF000014 srgba(255,0,0,0.0784314)
635: (255, 0, 0, 38) #FF000026 srgba(255,0,0,0.14902)
630: (255, 0, 0, 32) #FF000020 srgba(255,0,0,0.12549)
604: (255, 0, 0, 23) #FF000017 srgba(255,0,0,0.0901961)
598: (255, 0, 0, 26) #FF00001A srgba(255,0,0,0.101961)
589: (255, 0, 0, 28) #FF00001C srgba(255,0,0,0.109804)
574: (255, 0, 0, 34) #FF000022 srgba(255,0,0,0.133333)
574: (255, 0, 0, 31) #FF00001F srgba(255,0,0,0.121569)
568: (255, 0, 0, 22) #FF000016 srgba(255,0,0,0.0862745)
551: (255, 0, 0, 29) #FF00001D srgba(255,0,0,0.113725)
542: (255, 0, 0, 6) #FF000006 srgba(255,0,0,0.0235294)
541: (255, 0, 0, 25) #FF000019 srgba(255,0,0,0.0980392)
516: (255, 0, 0, 37) #FF000025 srgba(255,0,0,0.145098)
485: (255, 0, 0, 35) #FF000023 srgba(255,0,0,0.137255)
387: (255, 0, 0, 9) #FF000009 srgba(255,0,0,0.0352941)
381: (255, 0, 0, 12) #FF00000C srgba(255,0,0,0.0470588)
327: (255, 0, 0, 36) #FF000024 srgba(255,0,0,0.141176)
327: (255, 0, 0, 24) #FF000018 srgba(255,0,0,0.0941176)
326: (255, 0, 0, 15) #FF00000F srgba(255,0,0,0.0588235)
316: (255, 0, 0, 21) #FF000015 srgba(255,0,0,0.0823529)
305: (255, 0, 0, 18) #FF000012 srgba(255,0,0,0.0705882)
304: (255, 0, 0, 27) #FF00001B srgba(255,0,0,0.105882)
270: (255, 0, 0, 33) #FF000021 srgba(255,0,0,0.129412)
254: (255, 0, 0, 30) #FF00001E srgba(255,0,0,0.117647)
251: (255, 0, 0, 39) #FF000027 srgba(255,0,0,0.152941)
74: (255, 0, 0, 40) #FF000028 srgba(255,0,0,0.156863)
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64733,0.33636)
green primary: (0.28904,0.6052)
blue primary: (0.1235,0.0424)
white point: (0.28021,0.296)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 256x256+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2013-07-19T12:48:29-07:00
date:modify: 2013-07-19T12:48:29-07:00
png:bKGD: chunk was found (see Background color, above)
png:cHRM: chunk was found (see Chromaticity, above)
png:iCCP: chunk was found
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 3
png:IHDR.color_type: 3 (Indexed)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 256, 256
png:pHYs: x_res=2835, y_res=2835, units=1
png:PLTE.number_colors: 42
png:text: 2 tEXt/zTXt/iTXt chunks were found
png:tRNS: chunk was found
signature: f41a73e5fe161c06aa147572380ab95b6e43a411fa533b6533af37e2d19a161e
Profiles:
Profile-icc: 3224 bytes
Description: Display
Manufacturer: Display
Model: Display
Copyright: Copyright Apple, Inc., 2013
Artifacts:
filename: red_circle.png
verbose: true
Tainted: False
Filesize: 8.44KB
Number pixels: 65.5K
Pixels per second: 0B
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.8.6-0 2013-07-03 Q16 http://www.imagemagick.org
Image: red_circle.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 256x256+0+0
Resolution: 28.35x28.35
Print size: 9.02998x9.02998
Units: PixelsPerCentimeter
Type: PaletteAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 1-bit
green: 1-bit
blue: 1-bit
alpha: 8-bit
Channel statistics:
Red:
min: 255 (1)
max: 255 (1)
mean: 255 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Green:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Blue:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Alpha:
min: 0 (0)
max: 40 (0.156863)
mean: 6.30113 (0.0247103)
standard deviation: 10.7071 (0.0419887)
kurtosis: 1.47694
skewness: -1.66221
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 125.925 (0.493822)
standard deviation: 5.35356 (0.0209944)
kurtosis: 309547
skewness: 77.6945
Alpha: srgba(255,0,0,0) #FF000000
Colors: 41
Histogram:
37164: (255, 0, 0, 0) #FF000000 srgba(255,0,0,0)
4416: (255, 0, 0, 1) #FF000001 srgba(255,0,0,0.00392157)
1974: (255, 0, 0, 2) #FF000002 srgba(255,0,0,0.00784314)
1394: (255, 0, 0, 4) #FF000004 srgba(255,0,0,0.0156863)
1154: (255, 0, 0, 5) #FF000005 srgba(255,0,0,0.0196078)
982: (255, 0, 0, 8) #FF000008 srgba(255,0,0,0.0313725)
942: (255, 0, 0, 7) #FF000007 srgba(255,0,0,0.027451)
893: (255, 0, 0, 10) #FF00000A srgba(255,0,0,0.0392157)
758: (255, 0, 0, 3) #FF000003 srgba(255,0,0,0.0117647)
754: (255, 0, 0, 11) #FF00000B srgba(255,0,0,0.0431373)
752: (255, 0, 0, 14) #FF00000E srgba(255,0,0,0.054902)
749: (255, 0, 0, 13) #FF00000D srgba(255,0,0,0.0509804)
698: (255, 0, 0, 16) #FF000010 srgba(255,0,0,0.0627451)
684: (255, 0, 0, 17) #FF000011 srgba(255,0,0,0.0666667)
657: (255, 0, 0, 19) #FF000013 srgba(255,0,0,0.0745098)
636: (255, 0, 0, 20) #FF000014 srgba(255,0,0,0.0784314)
635: (255, 0, 0, 38) #FF000026 srgba(255,0,0,0.14902)
630: (255, 0, 0, 32) #FF000020 srgba(255,0,0,0.12549)
604: (255, 0, 0, 23) #FF000017 srgba(255,0,0,0.0901961)
598: (255, 0, 0, 26) #FF00001A srgba(255,0,0,0.101961)
589: (255, 0, 0, 28) #FF00001C srgba(255,0,0,0.109804)
574: (255, 0, 0, 34) #FF000022 srgba(255,0,0,0.133333)
574: (255, 0, 0, 31) #FF00001F srgba(255,0,0,0.121569)
568: (255, 0, 0, 22) #FF000016 srgba(255,0,0,0.0862745)
551: (255, 0, 0, 29) #FF00001D srgba(255,0,0,0.113725)
542: (255, 0, 0, 6) #FF000006 srgba(255,0,0,0.0235294)
541: (255, 0, 0, 25) #FF000019 srgba(255,0,0,0.0980392)
516: (255, 0, 0, 37) #FF000025 srgba(255,0,0,0.145098)
485: (255, 0, 0, 35) #FF000023 srgba(255,0,0,0.137255)
387: (255, 0, 0, 9) #FF000009 srgba(255,0,0,0.0352941)
381: (255, 0, 0, 12) #FF00000C srgba(255,0,0,0.0470588)
327: (255, 0, 0, 36) #FF000024 srgba(255,0,0,0.141176)
327: (255, 0, 0, 24) #FF000018 srgba(255,0,0,0.0941176)
326: (255, 0, 0, 15) #FF00000F srgba(255,0,0,0.0588235)
316: (255, 0, 0, 21) #FF000015 srgba(255,0,0,0.0823529)
305: (255, 0, 0, 18) #FF000012 srgba(255,0,0,0.0705882)
304: (255, 0, 0, 27) #FF00001B srgba(255,0,0,0.105882)
270: (255, 0, 0, 33) #FF000021 srgba(255,0,0,0.129412)
254: (255, 0, 0, 30) #FF00001E srgba(255,0,0,0.117647)
251: (255, 0, 0, 39) #FF000027 srgba(255,0,0,0.152941)
74: (255, 0, 0, 40) #FF000028 srgba(255,0,0,0.156863)
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64733,0.33636)
green primary: (0.28904,0.6052)
blue primary: (0.1235,0.0424)
white point: (0.28021,0.296)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 256x256+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2013-07-18T20:55:49-07:00
date:modify: 2013-07-18T20:55:49-07:00
png:cHRM: chunk was found (see Chromaticity, above)
png:iCCP: chunk was found
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 6
png:IHDR.color_type: 6 (RGBA)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 256, 256
png:pHYs: x_res=2835, y_res=2835, units=1
signature: f41a73e5fe161c06aa147572380ab95b6e43a411fa533b6533af37e2d19a161e
Profiles:
Profile-icc: 3224 bytes
Description: Display
Manufacturer: Display
Model: Display
Copyright: Copyright Apple, Inc., 2013
Artifacts:
filename: red_circle.png
verbose: true
Tainted: False
Filesize: 11.2KB
Number pixels: 65.5K
Pixels per second: 0B
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.8.6-0 2013-07-03 Q16 http://www.imagemagick.org
最佳答案
如果您使用的是 ImageMagick,则可以强制将图像写入为 RGBA8888 PNG
/opt/local/bin/convert input.png png32:output.png
关于ios - Imagemagick降低PNG深度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17741796/
IO 设备如何知道属于它的内存中的值在memory mapped IO 中发生了变化? ? 例如,假设内存地址 0 专用于保存 VGA 设备的背景颜色。当我们更改 memory[0] 中的值时,VGA
我目前正在开发一个使用Facebook sdk登录(通过FBLoginView)的iOS应用。 一切正常,除了那些拥有较旧版本的facebook的人。 当他们按下“使用Facebook登录”按钮时,他
假设我有: this - is an - example - with some - dashesNSRange将使用`rangeOfString:@“-”拾取“-”的第一个实例,但是如果我只想要最后
Card.io SDK提供以下详细信息: 卡号,有效期,月份,年份,CVV和邮政编码。 如何从此SDK获取国家名称。 - (void)userDidProvideCreditCardInfo:(Car
iOS 应用程序如何从网络服务下载图片并在安装过程中将它们安装到用户的 iOS 设备上?可能吗? 最佳答案 您无法控制应用在用户设备上的安装,因此无法在安装过程中下载其他数据。 只需在安装后首次启动应
我曾经开发过一款企业版 iOS 产品,我们公司曾将其出售给大型企业,供他们的员工使用。 该应用程序通过 AppStore 提供,企业用户获得了公司特定的配置文件(包含应用程序配置文件)以启用他们有权使
我正在尝试将 Card.io SDK 集成到我的 iOS 应用程序中。我想为 CardIO ui 做一个简单的本地化,如更改取消按钮标题或“在此保留信用卡”提示文本。 我在 github 上找到了这个
我正在使用 CardIOView 和 CardIOViewDelegate 类,没有可以设置为 YES 的 BOOL 来扫描 collectCardholderName。我可以看到它在 CardIOP
我有一个集成了通话工具包的 voip 应用程序。每次我从我的 voip 应用程序调用时,都会在 native 电话应用程序中创建一个新的最近通话记录。我在 voip 应用程序中也有自定义联系人(电话应
iOS 应用程序如何知道应用程序打开时屏幕上是否已经有键盘?应用程序运行后,它可以接收键盘显示/隐藏通知。但是,如果应用程序在分屏模式下作为辅助应用程序打开,而主应用程序已经显示键盘,则辅助应用程序不
我在模拟器中收到以下错误: ImageIO: CGImageReadSessionGetCachedImageBlockData *** CGImageReadSessionGetCachedIm
如 Apple 文档所示,可以通过 EAAccessory Framework 与经过认证的配件(由 Apple 认证)进行通信。但是我有点困惑,因为一些帖子告诉我它也可以通过 CoreBluetoo
尽管现在的调试器已经很不错了,但有时找出应用程序中正在发生的事情的最好方法仍然是古老的 NSLog。当您连接到计算机时,这样做很容易; Xcode 会帮助弹出日志查看器面板,然后就可以了。当您不在办公
在我的 iOS 应用程序中,我定义了一些兴趣点。其中一些有一个 Kontakt.io 信标的名称,它绑定(bind)到一个特定的 PoI(我的意思是通常贴在信标标签上的名称)。现在我想在附近发现信标,
我正在为警报提示创建一个 trigger.io 插件。尝试从警报提示返回数据。这是我的代码: // Prompt + (void)show_prompt:(ForgeTask*)task{
您好,我是 Apple iOS 的新手。我阅读并搜索了很多关于推送通知的文章,但我没有发现任何关于 APNS 从 io4 到 ios 6 的新更新的信息。任何人都可以向我提供 APNS 如何在 ios
UITabBar 的高度似乎在 iOS 7 和 8/9/10/11 之间发生了变化。我发布这个问题是为了让其他人轻松找到答案。 那么:在 iPhone 和 iPad 上的 iOS 8/9/10/11
我想我可以针对不同的 iOS 版本使用不同的 Storyboard。 由于 UI 的差异,我将创建下一个 Storyboard: Main_iPhone.storyboard Main_iPad.st
我正在写一些东西,我将使用设备的 iTunes 库中的一部分音轨来覆盖 2 个视频的组合,例如: AVMutableComposition* mixComposition = [[AVMutableC
我创建了一个简单的 iOS 程序,可以顺利编译并在 iPad 模拟器上运行良好。当我告诉 XCode 4 使用我连接的 iPad 设备时,无法编译相同的程序。问题似乎是当我尝试使用附加的 iPad 时
我是一名优秀的程序员,十分优秀!