typst/typst

Profile-based Color Management for Preview and PDF export

開放

#3,143 建立於 2024年1月6日

 (14 則留言) (9 個反應) (0 位負責人)Rust (1,574 個分叉)batch import
feature requesthelp wantedpdfpngvisualize

倉庫指標

星標
 (53,538 顆星)
PR 合併指標
 (平均合併 8天 5小時) (30 天內合併 54 個 PR)

描述

Description

1. Features

The typst compiler should

  1. allow to specify an output ICC color profile (e.g. command line option --icc-profile ).
  2. convert the colors to the specified output profile when writing the pdf. If none is specified default to the sRGB profile currently used.
  3. use a "proofing" transform (see details) to RGB so we get a better preview of CMYK colors.
  4. include a few commonly used ICC profiles to improve usability. The most commonly used color profile for offset print ist ISOcoatedv2.

2. Details

One of the most popular color management C libraries is Little-CMS, which is used by Scribus, Imagemagick, GIMP, Inkscape and many more. It is open source (MIT License). For improving the preview of documents with CMYK-colors, it offers a function cmsCreateProofingTransform that allows a transformation to RGB that tries to get the colors to look on the screen as it would when printed with the destination profile. (see the docs,p.25)

Use Case

CMYK colors are supported in typst. However most printers require an embedded CMYK color profile in the pdf file.

Additionally, improving the preview of cmyk colors in the Web App so it is consistent with common pdf viewers (that use proper color management) would be helpful. To illustrate this issue: create a CMYK color that mixes Cyan and Magenta, e.g. cmyk(80%,80%,0,0). Observe how it is blue in the webapp but violet in the downloaded pdf.

貢獻者指南