On 21-10-2011 11:54, John Devereux wrote:

Hi all,

Is there a way to have context automatically compress or resample
included images to a given output resolution? I have not been following
recent developments...

I can obviously "pre-reduce" all images to the desired dpi. But:

1) This is a bit of work (and hard to get non-technical people to do)

2) In 5 years time we might want the images to be higher resolution and
not be as concerned about PDF size. But the information will be lost (or
be elsewhere).

So a command line or document setting would be ideal, is there such a
thing? \setpdfimageresolution[300dpi].

You can plug in a converter:

\startluacode

figures.converters["png"] = {
    ["lowres.png"] = function(oldname,newname,resolution)
os.execute(string.format('gm convert -depth 1 "%s" "%s"',oldname,newname))
    end,
}

-- the following is automatic in next beta

figures.suffixes["lowres.png"] = figures.suffixes.png

\stopluacode

And then use:

\starttext
    \externalfigure[mill.png][conversion=lowres.png]
\stoptext

downsamples images are cached so the overhead is minimal

Hans



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to