summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/graphicxpsd/graphicxpsd.tex
blob: fed24f3af964f6dec93e9da23d4975b33338a759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%#!rm -f tigerpsdfmt4* && lualatex -shell-escape graphicxpsd
\documentclass[luatex]{article}
\usepackage{shortvrb}\MakeShortVerb{\|}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{graphicxpsd}
\title{\textsf{graphicxpsd} Package}
\author{Munehiro Yamamoto}
\date{2021/01/07 v1.2}
\begin{document}
\maketitle
\begin{abstract}
This package provides Adobe Photoshop Data format (PSD) support
for \textsf{graphicx} package
with \texttt{sips} (Darwin/macOS)/\texttt{magick} (ImageMagick) command.
\end{abstract}

\section{Motivation}
\textsf{graphicx} package supports already many graphics image formats as bellow.
\begin{itemize}
\item non-vector formats: jpg, png, bmp, and so on
\item PostScript-style formats: eps, ps
\item PDF-style formats: pdf, ai
\end{itemize}
However, it currently does not support Adobe Photoshop Data format (PSD).

Against that, we developed the \textsf{graphicxpsd} package
to support PSD format via PSD-to-PDF conversion
with two image converters.
\begin{itemize}
\item \texttt{sips}:
pre-installed command in Darwin/macOS

\item \texttt{magick}:
bundled command in \href{https://www.imagemagick.org/}{ImageMagick}
\end{itemize}

\section{Loading \textsf{graphicxpsd} Package}

Load \textsf{graphicxpsd} package after loading \textsf{graphicx} package.

\begin{quote}
\begin{verbatim}
\usepackage{graphicx}
\usepackage[<options>]{graphicxpsd}
\end{verbatim}
\end{quote}

The list of available options is the following.
\begin{itemize}
\item |dvipdfmx|, |xetex|, |pdftex|, |luatex|:
supported driver options;
You can also give specific driver option from global option.

\item |sips| (default),
|magick| (same as |imagemagick|), |convert|\footnotemark: % ,
% |graphicsmagick|:
supported image converters;
\begin{itemize}
\item
Darwin/macOS users do not have to do anything
unless you choose ImageMagick as PSD-to-PDF converter.
\item
If you use ImageMagick~7, you may choose |magick|.
\item
If you should use ImageMagick~6 or lower version, you just choose |convert|.
% \item
% If you use GraphicsMagick, you may choose |graphicsmagick|.
\end{itemize}

\item |cache=true|: supports to include cached images for all PSD files.
If there does not exist the cached image for a PSD file,
\textsf{graphicxpsd} attempts PSD-to-PDF conversion of the PSD file.
\end{itemize}
\footnotetext{When ImageMagick project had released ImageMagick~7,
they changed \texttt{convert} to \texttt{magick}
because that might be the usual problem with the conflict of names
between the ImageMagick's \texttt{convert.exe} and
the Windows ``\texttt{convert.exe}'' program,
which complains about invalid parameters, and
changing the Imagemagick program's name to imconvert and
using that instead avoided the conflict.}

\section{Example}

Typeset the following {\LaTeX} document with Lua{\TeX} enabling the shell escape,
that is, run |lualatex -shell-escape|.
\begin{quote}
\small
\begin{verbatim}
%#!lualatex -shell-escape
\documentclass[luatex]{article}%%set luatex driver as global option
\usepackage{graphicx}
\usepackage{graphicxpsd}
\begin{document}
\includegraphics{tigerpsdfmt.psd}
\end{document}
\end{verbatim}
\end{quote}
Then, the result is as below.
\begin{center}
\includegraphics{tigerpsdfmt.psd}
\end{center}
Incidentally, the above \texttt{tigerpsdfmt.psd} file is converted from
the \texttt{tiger.eps} file (a.k.a.~``cubic spline tiger''),
which comes with Ghostscript.
\begin{quote}
\small
\begin{verbatim}
$ file tigerpsdfmt.psd
tigerpsdfmt.psd: Adobe Photoshop Image, 550 x 568, RGBA, 4x 8-bit channels
\end{verbatim}
\end{quote}

\end{document}