ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Which Image quality should I use ?
Date: Tue, 15 Jul 2014 21:52:07 +0200	[thread overview]
Message-ID: <53C58667.9060001@wxs.nl> (raw)
In-Reply-To: <87fvi2v9kh.fsf@micropit.roche-blanche.homenet.org>

On 7/15/2014 7:03 PM, Peter Münster wrote:
> On Sun, Jul 13 2014, Pol Stra wrote:
>
>>> I can be done automatically for example by using this module:
>>> http://modules.contextgarden.net/grph-downsample
>>
>> Thank you, it looks interesting. Is there a documentation somewhere or could
>> you provide an example about how to use it ?
>
> Hi,
>
> Here an example: http://wiki.contextgarden.net/Catalogue_raisonné
>
>
>> Also, it changes the resolution only at inclusion into the pdf or it does it
>> on original files ? My concern is to give the sources in attachment of the
>> document, so if I don't change those files, the document will still be huge.
>
> The downscaled images are kept on disk in the "cache" sub-directory.
>
>
>> There is a way to include the source without duplicates images ?
>
> Yes.
>
>
> There is also an old module t-degrade.tex but I don't know, if it still
> works with recent ConTeXt versions.

so you have several options:

- using build in
- using specific modules

built in boils down to something

\startluacode

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

-- figures.suffixes["lowres.png"] = figures.suffixes.png -- suffix is 
automatically done

\stopluacode

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

in nearly all our projects we get images that need to be converted 
(color -> bw, downsampling, removing crap from pdf, etc) but in most 
cases we also convert to pdf then because that is normally the fastest 
way to include an image (which is why one can also define a prefix and 
cache)

what method you choose depends on how much control you want (it's hard 
to predict demands) ... btw, many of these build-in mechanism are 
derived from mkii methods, where we also had resource manipulators and 
so (we still have figure databases btw)

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
___________________________________________________________________________________

  parent reply	other threads:[~2014-07-15 19:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-12 12:58 Pol Stra
2014-07-12 14:14 ` Peter Münster
2014-07-13  7:59   ` Pol Stra
2014-07-15 17:03     ` Peter Münster
2014-07-15 17:13       ` Aditya Mahajan
2014-07-15 19:52       ` Hans Hagen [this message]
2014-07-13 10:06 ` Henning Hraban Ramm
2014-07-13 11:10 ` Joshua Krämer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C58667.9060001@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).