Changes

Jump to navigation Jump to search
1,052 bytes added ,  10:39, 4 May 2015
description of t-degrade
Downsampling means to reduce the resolution of a picture to save space.
There are two simple, but otherwise undocumented modules:
== grph-downsample ==
This MkIV module is not in the distributionand not documented, but you can download it from [http://modules.contextgarden.net/grph-downsample here]. It expects the <code>gm</code> tool from [http://www.graphicsmagick.org GraphicsMagick] to be callableand works on PNG, JPG and GIF pictures.
Copy grph-downsample.lua to <code>.../texmf-local/tex/context/third/grph-downsample/grph-downsample.lua</code>
== t-degrade ==
 
This MkII module is in the distribution, but also available [http://modules.contextgarden.net/t-degrade here]. It works only on JPG pictures and has some [http://modules.contextgarden.net/dl/t-degrade/doc/context/third/degrade/degrade-doc.pdf documentation].
 
{{cmd|setupDegrade}} understands the keys <code>Res</code>, <code>Dir</code>, <code>SDir</code>:
* Res = resolution in dpi (default: 100)
* Dir = target directory for degraded images (default: degrade)
* SDir = source directory of original images (default: .)
 
This modules works only if the if the <code>width</code> or <code>height</code> key of {{cmd|externalfigure}} is defined. or <code>height</code> key of {{cmd|externalfigure}} is defined.
 
It creates a Bash (shell) script and calls the tools <code>jpeg2ps</code>, <code>epstopdf</code> or <code>texutil</code>, <code>identify</code> and <code>convert</code>.
 
<texcode>
\usemodule[degrade]
\setupDegrade[Res=10, Dir=temp, SDir=.]
\starttext
\externalfigure[hacker.jpg][width=5cm]
\stoptext
</texcode>

Navigation menu