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]. Thanks, -- John Devereux
On Fri, Oct 21 2011, John Devereux wrote:
Is there a way to have context automatically compress or resample included images to a given output resolution?
Hello, See also http://archive.contextgarden.net/thread/20110629.173015.6dcd7b3e.en.html t-degrade.tex is broken with latest context. If you fix it (should be easy), please send me the patch! :-) (Sorry, too busy now for fixing it myself...) -- Peter
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 -----------------------------------------------------------------
On 24-10-2011 16:29, Aditya Mahajan wrote:
downsamples images are cached so the overhead is minimal
Is caching based only on the figure name? If I change the original figure, will the cached figure be updated?
Sure, local oldtime = lfs.attributes(oldname,'modification') or 0 local newtime = lfs.attributes(newname,'modification') or 0 if newtime == 0 or oldtime > newtime then In fact it's just integration of old resource library code (ruby stuff that happened between runs). 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 -----------------------------------------------------------------
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
John Devereux
-
pmlists@free.fr