ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alan Braslau via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Henning Hraban Ramm <texml@fiee.net>
Cc: Alan Braslau <alan.braslau@icloud.com>
Subject: [NTG-context] Re: access image properties in Lua
Date: Mon, 17 Jul 2023 19:10:10 +0200	[thread overview]
Message-ID: <bcaa3413-f1b3-be08-56da-20c79072cc73@icloud.com> (raw)
In-Reply-To: <8aeba37a-d6cd-eb39-6814-5756ef6ebc0c@fiee.net>

On 17/07/23 17/07/23, 18:20, Henning Hraban Ramm wrote:
>> Bonus question: how also to handle the case of
>> \startMPcode
>> draw figure "MyFigure" xsized TextWidth ;
>> ...
>> \stopMPcode
> 
> Is MyFigure a pixel image?
> You could use \externalfigure within MP code.

The MP operator figure calls \externalfigure.
However, the resolution downsampler hooked into externalfigure as you 
suggest would not give the desired resolutions once resized in MP.

A solution might be to use
draw rawtextext("\externalfigure[MyFigure][width=\textwidth") ;
which is OK for this simplified example but would not work when more 
sophisticated MetaPost transformations might be needed.



Along the lines of the conversion downsampler, a resolution reporter and 
manual resampling could be more efficient than reconverting the bitmap 
image at every run, of which there can be many.

--
Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-07-17 17:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 12:22 Henning Hraban Ramm
2023-07-13  7:19 ` Hans Hagen
2023-07-17 13:44   ` [NTG-context] " Alan Braslau via ntg-context
2023-07-17 16:20     ` Henning Hraban Ramm
2023-07-17 17:10       ` Alan Braslau via ntg-context [this message]
     [not found]       ` <048d051e-c66f-3e0f-e3d2-48ef300b7280@icloud.com>
2023-07-18 11:39         ` Henning Hraban Ramm

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=bcaa3413-f1b3-be08-56da-20c79072cc73@icloud.com \
    --to=ntg-context@ntg.nl \
    --cc=alan.braslau@icloud.com \
    --cc=texml@fiee.net \
    /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).