Figma introduces PDF exports(figma.com)

6 months ago from Jason Coudriet, Design and Development Leader

  • Gaël PGaël P, 6 months ago

    It is the format recommended by Apple in their HIG though, isn’t it?

    0 points
    • Marc EdwardsMarc Edwards, 6 months ago

      Yes. Well, with PNG as the first preference. Here is the relevent section of Apple’s HIG:

      Produce artwork in the appropriate format. In general, use de-interlaced PNG files for bitmap/raster artwork. PNG supports transparency and, because it's lossless, compression artifacts don't blur important details or alter colors. It's a good choice for intricate artwork that requires effects like shading, textures, and highlights. Use JPEG for photos. Its compression algorithm usually produces smaller sizes than lossless formats and artifacts are harder to discern in photos. Photo-realistic app icons, however, look best as PNGs. Use PDF for glyphs and other flat, vector artwork that requires high-resolution scaling.

      The recommendation is to use PNG for most things, JPEG for photos, and PDFs for glyphs and other flat, vector artwork that requires high-resolution scaling.

      However, they don’t mention that PDFs get converted to PNGs by Xcode. In doing so, there can be quality and rendering issues, and the resulting PNGs are almost certainly bigger files than if you just saved PNGs from your design tool.

      It is true that some assets may look very similar, but when Xcode renders your PDFs to PNGs, it will use macOS’s PDF rendering, which means even things like shape antialiasing will likely be different to your design tool (Sketch matches the standard macOS shape antialiasing, Figma, Photoshop, Illustrator and Affinity Designer don’t).

      The PNGs created from a PDFs are typically far bigger files for a few reasons — if there’s scaling issues, the images will be blurrier, which will increase the number of unique colours. Xcode also uses of PNGCrush to compress PNGs, and that can easily be improved, if you disable it.

      The HIG also says:

      Use the 8-bit color palette for PNG graphics that don’t require full 24-bit color. Using an 8-bit color palette reduces file size without reducing image quality. This palette is not appropriate for photos.

      As far as I am aware, Xcode never does this with PDFs, but if you’re saving or optimising your own PNGs, you can. Indexed PNGs are far smaller than RGBA PNGs.

      So, given the files are bigger, and even with very simple solid colour glyphs there can be rendering issues, and your PDFs end up as PNGs in the app bundle anyway… there really isn’t any incentive to use PDFs for iOS assets.

      Apple are wrong to recommend PDFs. PDF is a terrible UI asset format, and they should not be using it. You should not be using it. You should recommend to colleagues and clients that PDFs are never used as iOS assets.

      What about using PDFs to send a bunch of artboards to someone, so they can review the design? Sure. Go for it.

      5 points