summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/workflows/workflows-graphics.tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-10 12:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-10 12:15:05 +0100
commit51ca6df7d66393551bdf02032b990144e94c497b (patch)
treee5dfec0c51cdf143be856d7eca9bb68cb3af1734 /doc/context/sources/general/manuals/workflows/workflows-graphics.tex
parentdadf082803c3801cc0b5cd44d2e8fa8cfe56afa0 (diff)
downloadcontext-51ca6df7d66393551bdf02032b990144e94c497b.tar.gz
2015-03-10 12:11:00
Diffstat (limited to 'doc/context/sources/general/manuals/workflows/workflows-graphics.tex')
-rw-r--r--doc/context/sources/general/manuals/workflows/workflows-graphics.tex47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/workflows/workflows-graphics.tex b/doc/context/sources/general/manuals/workflows/workflows-graphics.tex
index 549b8b9f2..25eed7bee 100644
--- a/doc/context/sources/general/manuals/workflows/workflows-graphics.tex
+++ b/doc/context/sources/general/manuals/workflows/workflows-graphics.tex
@@ -83,6 +83,53 @@ and suitable action can be taken.
\stopsection
+\startsection[title=Downsampling]
+
+You can plug in you rown converter, here is an example:
+
+\starttyping
+\startluacode
+
+figures.converters.jpg = figures.converters.jpg or { }
+
+figures.converters.jpg["lowresjpg.pdf"] =
+ function(oldname,newname,resolution)
+ figures.programs.run (
+ [[gm]],
+ [[convert -geometry %nx%x%ny% -compress JPEG "%old%" "%new%"]],
+ {
+ old = old,
+ new = new,
+ nx = resolution or 300,
+ ny = resolution or 300,
+ }
+ )
+ end
+\stopluacode
+\stoptyping
+
+You can limit the search to a few types and set the resolution with:
+
+\starttyping
+\setupexternalfigures
+ [order={pdf,jpg},
+ resolution=100,
+ method=auto]
+\stoptyping
+
+And use it like:
+
+\starttyping
+\externalfigure[verybig.jpg][height=10cm]
+\stoptyping
+
+The second string passed to the \type {run} helper contains the arguments to the
+first one. The variables between percent signs get replaced by the variables in
+the tables passed as third argument.
+
+\stopsection
+
\stopchapter
\stopcomponent
+