On 29-6-2011 5:01, Cecil Westerhof wrote:
2011/6/29 Martin Schröder<mar...@oneiros.de>

I do not use graphics a lot in my ConTeXt files. But some time ago I used
several pictures with a very high resolution. This made the resulting PDF
very big. I did not expect the PDF printed on a printer with a higher
resolution as 1200 DPI. Is there a way to have the included graphics not
be
bigger as necessary (without changing the original pictures)?

Use a program for image manipulation, e.g. ImageMagick.


That would be a possibility, but I was wondering if there was a way to let
ConTeXt do it. Saves a lot of time. Also: when changing from A4 to A5, you
have to do it all over again.

You can plugin in a converter. However, it only works for one to anothe format so you need to patch a line in grph-inc.lua:

line 416: local converter = (newformat ~= format or resolution) and converters[format]

(I'll figure out something better for this so it's a temp hack.)

Such a plugin looks like:

\startluacode
figures.converters.png = {
    png = function(oldname,newname,resolution)
local command = string.format('gm convert -depth 1 "%s" "%s"',oldname,newname)
        logs.report(string.format("running command %s",command))
        os.execute(command)
    end
}
\stopluacode

\externalfigure[mill.png][resolution=lowres,conversion=png]


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