创建.car资产目录时,可以禁用Xcode的PNG修改吗?

时间:2019-05-29 19:39:35

标签: ios xcode assets

因此,关于Xcode在iOS应用中创建Assets.car的方式,我遇到了一个奇怪的问题。似乎构建过程向每个PNG添加了标头以指示颜色空间。我有一个存储为4字节数据的PNG示例示例(PNG为68字节),但是Assets.car中生成的PNG为3395字节。这到底是怎么回事?好吧,pngcheck讲述了这个故事:

pngcheck -v test_Normal.png
File: test_Normal.png (3395 bytes)
  chunk IHDR at offset 0x0000c, length 13
    4 x 1 image, 8-bit grayscale, non-interlaced
  chunk iCCP at offset 0x00025, length 3315
    profile name = kCGColorSpaceGenericGrayGamma2_2
    compression method = 0 (deflate), compressed profile = 3281 bytes
  chunk IDAT at offset 0x00d24, length 11
    zlib: deflated, 256-byte window, superfast compression
  chunk IEND at offset 0x00d3b, length 0

将此与原始PNG进行比较:

pngcheck -v test.png 
File: test.png (68 bytes)
  chunk IHDR at offset 0x0000c, length 13
    4 x 1 image, 8-bit grayscale, non-interlaced
  chunk IDAT at offset 0x00025, length 11
    zlib: deflated, 256-byte window, fast compression
  chunk IEND at offset 0x0003c, length 0

zlib压缩后,此iCCP PNG块似乎与以下文件相对应。

'/System/Library/ColorSync/Profiles/Generic Gray Gamma 2.2 Profile.icc'

将图像写入汽车文件时,是否无法禁用此自动PNG修改?有了很多小的PNG图片,这会增加已安装的应用的大小。

0 个答案:

没有答案