diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-06 23:07:41 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-06 23:07:41 +0000 |
| commit | a44238ce4ce8f0ba29e093de92067b708454a876 (patch) | |
| tree | db4158af432583e7159fe0d13e5c69b1c6233229 /doc/manual/colour.tex | |
| parent | c2aa1e3c11f9d13286c7a7260bcedce7e3502f00 (diff) | |
Various manual bits.
Diffstat (limited to 'doc/manual/colour.tex')
| -rw-r--r-- | doc/manual/colour.tex | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/manual/colour.tex b/doc/manual/colour.tex new file mode 100644 index 000000000..a742788fc --- /dev/null +++ b/doc/manual/colour.tex @@ -0,0 +1,59 @@ +\documentclass{article} + +\pagestyle{empty} +\usepackage{amsmath,mathtools} +\title{Colour conversion in DCP-o-matic} +\author{} +\date{} +\begin{document} +\maketitle + +Conversion from an RGB pixel $(r, g, b)$ is done in three steps. +First, the input gamma $\gamma_i$ is applied. This is done in one of +two ways, depending on the setting of the ``linearise input gamma +curve for low values'' option. If linearisation is disabled, we use: + +\begin{align*} +r' &= r^{\gamma_i} \\ +g' &= g^{\gamma_i} \\ +b' &= b^{\gamma_i} +\end{align*} + +otherwise, with linearisation enabled, we use: + +\begin{align*} +r' &= \begin{dcases} +\frac{r}{12.92} & r \leq 0.04045 \\ +\left(\frac{r + 0.055}{1.055}\right)^{\gamma_i} & r > 0.04045 +\end{dcases} +\end{align*} + +Next, the colour transformation matrix is used to convert to XYZ: + +\begin{align*} +\left[\begin{array}{c} +x \\ +y \\ +z +\end{array}\right] &= +\left[\begin{array}{ccc} +m_{11} & m_{12} & m_{13} \\ +m_{21} & m_{22} & m_{23} \\ +m_{31} & m_{32} & m_{33} +\end{array}\right] +\left[\begin{array}{c} +r' \\ +g' \\ +b' +\end{array}\right] +\end{align*} + +Finally, the output gamma $\gamma_o$ is applied to give our final XYZ values $(x', y', z')$: + +\begin{align*} +x' &= x^{1/\gamma_o} \\ +y' &= y^{1/\gamma_o} \\ +z' &= z^{1/\gamma_o} \\ +\end{align*} + +\end{document} |
