Xcode generates png form pdf with different colors

前端 未结 3 1289
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 08:53

We are following article to use pdf vector resources in iOS project: http://martiancraft.com/blog/2014/09/vector-images-xcode6/

However we faced problems. If we set colo

相关标签:
3条回答
  • 2021-02-10 08:54

    When a new artboard is created in Illustrator it defaults to using Adobe RGB for the color space which doesn't work well with iOS. To make sure the colors remain as close to the original as possible, set the color space to sRGB by selecting "Web" for Profile and RGB for Color Mode under Advanced.

    illustrator settings

    This works well for new artboards. I have an Illustrator file as a deliverable that was created in Adobe RGB. For such cases, I've resorted to copy pasting vector paths on a new artboard that's set to sRGB before saving as PDF for use in Xcode 6.

    0 讨论(0)
  • 2021-02-10 09:11

    It is possible that Photoshop/Illustrator generates CMYK or other special colors in the PDF file and Xcode uses the PDF rendering engine that is implemented in iOS to convert the PDF files to PNG.
    Because the iOS has problems with displaying CMYK colors, your PNG image has distorted colors.

    The above is only an assumption because I have not seen a sample PDF file and the process used by Xcode to convert the PDF to PNG is not documented.

    0 讨论(0)
  • 2021-02-10 09:12

    I got the same problem, and finally I found that set the deployment Target to 7.0 or above solves the problem.

    0 讨论(0)
提交回复
热议问题