ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \externalfigure question
@ 2017-02-17 14:20 j. van den hoff
  2017-02-17 14:42 ` Henning Hraban Ramm
  2017-02-17 14:43 ` Hans Hagen
  0 siblings, 2 replies; 11+ messages in thread
From: j. van den hoff @ 2017-02-17 14:20 UTC (permalink / raw)
  To: ntg-context

I am unsure about the "canonical" way to scale images to the desired size.  
my current understanding is, that `scale=' should do what I want in a way  
portable across `context' incarnations. so currently I use commands like

\externalfigure[image.png][scale=750]

to adjust the image size to my taste.

my problem: the same document looks completely different regarding image  
size in the produced pdf with standalone installations on osx64 and  
linux-64. actually, on oxx64 I have to use something like `scale=1500'  
where on linux-64 `scale=750' seemingly does about the same.

questions:

* what am I missing? why does the same document compile differently? I can  
only guess that `context' (or luatex?) has two different opinions of dpi  
resolution on the two machines when producing the pdf? where can I  
control/check this?

* if `scale=' is not the way to achieve invariant and unambiguous size of  
images embedded in the document, what is? `width=XXX cm'? i.e.: how is  
this supposed to be done correctly(TM)?

thx/joerg


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 14:20 \externalfigure question j. van den hoff
@ 2017-02-17 14:42 ` Henning Hraban Ramm
  2017-02-17 14:43 ` Hans Hagen
  1 sibling, 0 replies; 11+ messages in thread
From: Henning Hraban Ramm @ 2017-02-17 14:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-02-17 um 15:20 schrieb j. van den hoff <veedeehjay@gmail.com>:

> I am unsure about the "canonical" way to scale images to the desired size. my current understanding is, that `scale=' should do what I want in a way portable across `context' incarnations. so currently I use commands like
> 
> \externalfigure[image.png][scale=750]
> 
> to adjust the image size to my taste.
> 
> my problem: the same document looks completely different regarding image size in the produced pdf with standalone installations on osx64 and linux-64. actually, on oxx64 I have to use something like `scale=1500' where on linux-64 `scale=750' seemingly does about the same.
> 
> questions:
> 
> * what am I missing? why does the same document compile differently? I can only guess that `context' (or luatex?) has two different opinions of dpi resolution on the two machines when producing the pdf? where can I control/check this?
> 
> * if `scale=' is not the way to achieve invariant and unambiguous size of images embedded in the document, what is? `width=XXX cm'? i.e.: how is this supposed to be done correctly(TM)?

I can’t tell you anything about the difference in calculations, otherwise it depends on what you want to achieve: I always use width= or height=, because I need specific sizes of my images. Or I define maxwidth=\textwidth. I never had a case where the actual scaling would have been important - maps might be a use case.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 14:20 \externalfigure question j. van den hoff
  2017-02-17 14:42 ` Henning Hraban Ramm
@ 2017-02-17 14:43 ` Hans Hagen
  2017-02-17 16:04   ` j. van den hoff
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2017-02-17 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 2/17/2017 3:20 PM, j. van den hoff wrote:
> I am unsure about the "canonical" way to scale images to the desired
> size. my current understanding is, that `scale=' should do what I want
> in a way portable across `context' incarnations. so currently I use
> commands like
>
> \externalfigure[image.png][scale=750]
>
> to adjust the image size to my taste.
>
> my problem: the same document looks completely different regarding image
> size in the produced pdf with standalone installations on osx64 and
> linux-64. actually, on oxx64 I have to use something like `scale=1500'
> where on linux-64 `scale=750' seemingly does about the same.
>
> questions:
>
> * what am I missing? why does the same document compile differently? I
> can only guess that `context' (or luatex?) has two different opinions of
> dpi resolution on the two machines when producing the pdf? where can I
> control/check this?
>
> * if `scale=' is not the way to achieve invariant and unambiguous size
> of images embedded in the document, what is? `width=XXX cm'? i.e.: how
> is this supposed to be done correctly(TM)?

just use width=4cm and so

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 14:43 ` Hans Hagen
@ 2017-02-17 16:04   ` j. van den hoff
  2017-02-17 16:51     ` Alan Braslau
  0 siblings, 1 reply; 11+ messages in thread
From: j. van den hoff @ 2017-02-17 16:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen

On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen <pragma@wxs.nl> wrote:

>  * if `scale=' is not the way to achieve invariant and unambiguous size
> of images embedded in the document, what is? `width=XXX cm'? i.e.: how
> is this supposed to be done correctly(TM)?
>  just use width=4cm and so

understood, will do (thanks to henning, too, for answering). in any case,  
I have settled for `width={fraction}\textwidth' as the most convenient  
solution. but if you don't mind explaining: _why_ is `scale' causing me a  
problem in the first place? what is the actual intended (and good) use of  
this parameter?

..


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 16:04   ` j. van den hoff
@ 2017-02-17 16:51     ` Alan Braslau
  2017-02-17 17:05       ` j. van den hoff
  2017-02-17 17:42       ` Hans Hagen
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Braslau @ 2017-02-17 16:51 UTC (permalink / raw)
  To: j. van den hoff, Hans Hagen; +Cc: mailing list for ConTeXt users

On Fri, 17 Feb 2017 17:04:27 +0100
"j. van den hoff" <veedeehjay@gmail.com> wrote:

> On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen <pragma@wxs.nl> wrote:
> 
> >  * if `scale=' is not the way to achieve invariant and unambiguous
> > size of images embedded in the document, what is? `width=XXX cm'?
> > i.e.: how is this supposed to be done correctly(TM)?
> >  just use width=4cm and so
> 
> understood, will do (thanks to henning, too, for answering). in any
> case, I have settled for `width={fraction}\textwidth' as the most
> convenient solution. but if you don't mind explaining: _why_ is
> `scale' causing me a problem in the first place? what is the actual
> intended (and good) use of this parameter?

scale= is EXTREMELY useful when combining external figures and one
wants to retain uniform linewidths, text pointsizes, etc. Using width=
(or height=) in such a case will lead to very poor results, indeed.

Alan

P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
left-over from the previous century - prehistoric days. In the
chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
to confuse things. (Hans: I would suggest dropping this...).

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 16:51     ` Alan Braslau
@ 2017-02-17 17:05       ` j. van den hoff
  2017-02-17 17:43         ` Hans Hagen
  2017-02-17 17:42       ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: j. van den hoff @ 2017-02-17 17:05 UTC (permalink / raw)
  To: j. van den hoff, Hans Hagen, Alan Braslau; +Cc: mailing list for ConTeXt users

On Fri, 17 Feb 2017 17:51:11 +0100, Alan Braslau <alan.braslau@cea.fr>  
wrote:

> On Fri, 17 Feb 2017 17:04:27 +0100
> "j. van den hoff" <veedeehjay@gmail.com> wrote:
>
>> On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen <pragma@wxs.nl> wrote:
>>
>> >  * if `scale=' is not the way to achieve invariant and unambiguous
>> > size of images embedded in the document, what is? `width=XXX cm'?
>> > i.e.: how is this supposed to be done correctly(TM)?
>> >  just use width=4cm and so
>>
>> understood, will do (thanks to henning, too, for answering). in any
>> case, I have settled for `width={fraction}\textwidth' as the most
>> convenient solution. but if you don't mind explaining: _why_ is
>> `scale' causing me a problem in the first place? what is the actual
>> intended (and good) use of this parameter?
>
> scale= is EXTREMELY useful when combining external figures and one
> wants to retain uniform linewidths, text pointsizes, etc. Using width=
> (or height=) in such a case will lead to very poor results, indeed.

OK, thanks. will try to remember that. -- but in this case  
(important/useful parameter...) I am still wondering, why the same value  
(say: scale=750) leads to totally different figure size in the pdf output  
for two different machines/OSes?

I understand that scale=1000 means "original size" but in want sense? it  
seems to dependent on the machine/engine's idea of dpi resolution or  
something like that ...

joerg

>
> Alan
>
> P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
> left-over from the previous century - prehistoric days. In the
> chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
> to confuse things. (Hans: I would suggest dropping this...).
>


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 16:51     ` Alan Braslau
  2017-02-17 17:05       ` j. van den hoff
@ 2017-02-17 17:42       ` Hans Hagen
  2017-02-17 18:06         ` Alan Braslau
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2017-02-17 17:42 UTC (permalink / raw)
  To: Alan Braslau, j. van den hoff; +Cc: mailing list for ConTeXt users

On 2/17/2017 5:51 PM, Alan Braslau wrote:
> On Fri, 17 Feb 2017 17:04:27 +0100
> "j. van den hoff" <veedeehjay@gmail.com> wrote:
>
>> On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen <pragma@wxs.nl> wrote:
>>
>>>  * if `scale=' is not the way to achieve invariant and unambiguous
>>> size of images embedded in the document, what is? `width=XXX cm'?
>>> i.e.: how is this supposed to be done correctly(TM)?
>>>  just use width=4cm and so
>>
>> understood, will do (thanks to henning, too, for answering). in any
>> case, I have settled for `width={fraction}\textwidth' as the most
>> convenient solution. but if you don't mind explaining: _why_ is
>> `scale' causing me a problem in the first place? what is the actual
>> intended (and good) use of this parameter?
>
> scale= is EXTREMELY useful when combining external figures and one
> wants to retain uniform linewidths, text pointsizes, etc. Using width=
> (or height=) in such a case will lead to very poor results, indeed.
>
> Alan
>
> P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
> left-over from the previous century - prehistoric days. In the
> chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
> to confuse things. (Hans: I would suggest dropping this...).

sx=
sy=

iir small scales are also seen as fractions

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 17:05       ` j. van den hoff
@ 2017-02-17 17:43         ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2017-02-17 17:43 UTC (permalink / raw)
  To: j. van den hoff, Alan Braslau; +Cc: mailing list for ConTeXt users

On 2/17/2017 6:05 PM, j. van den hoff wrote:
> On Fri, 17 Feb 2017 17:51:11 +0100, Alan Braslau <alan.braslau@cea.fr>
> wrote:
>
>> On Fri, 17 Feb 2017 17:04:27 +0100
>> "j. van den hoff" <veedeehjay@gmail.com> wrote:
>>
>>> On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen <pragma@wxs.nl> wrote:
>>>
>>> >  * if `scale=' is not the way to achieve invariant and unambiguous
>>> > size of images embedded in the document, what is? `width=XXX cm'?
>>> > i.e.: how is this supposed to be done correctly(TM)?
>>> >  just use width=4cm and so
>>>
>>> understood, will do (thanks to henning, too, for answering). in any
>>> case, I have settled for `width={fraction}\textwidth' as the most
>>> convenient solution. but if you don't mind explaining: _why_ is
>>> `scale' causing me a problem in the first place? what is the actual
>>> intended (and good) use of this parameter?
>>
>> scale= is EXTREMELY useful when combining external figures and one
>> wants to retain uniform linewidths, text pointsizes, etc. Using width=
>> (or height=) in such a case will lead to very poor results, indeed.
>
> OK, thanks. will try to remember that. -- but in this case
> (important/useful parameter...) I am still wondering, why the same value
> (say: scale=750) leads to totally different figure size in the pdf
> output for two different machines/OSes?
>
> I understand that scale=1000 means "original size" but in want sense? it
> seems to dependent on the machine/engine's idea of dpi resolution or
> something like that ...

or identifying libraries used


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 17:42       ` Hans Hagen
@ 2017-02-17 18:06         ` Alan Braslau
  2017-02-17 18:20           ` Hans Hagen
  2017-02-17 18:20           ` j. van den hoff
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Braslau @ 2017-02-17 18:06 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Fri, 17 Feb 2017 18:42:25 +0100
Hans Hagen <pragma@wxs.nl> wrote:

> sx=
> sy=
> 
> iir small scales are also seen as fractions

Like for the chemistry module, this can be confusing.


Also, sx=,sy= muck with the aspect ratio, don't they?

As we know, there is also an inconsistency in the handling of figure
scaling. Consider:

\startMPcode
  draw externalfigure("cow") xsized 5cm ;
  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
  draw rawtextext("\externalfigure[cow][width=5cm]") ;
\stopMPcode

The first will draw a distorted, square 5cmX5cm cow,
The second and third will both draw an undistorted, rectangular
5cmX3.635cm cow.

> or identifying libraries used

which assume different default dpi. Can this be normalized in the case
of file formats (such as pdf) that do not explicitly set the dpi?

Alan
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 18:06         ` Alan Braslau
@ 2017-02-17 18:20           ` Hans Hagen
  2017-02-17 18:20           ` j. van den hoff
  1 sibling, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2017-02-17 18:20 UTC (permalink / raw)
  To: Alan Braslau; +Cc: mailing list for ConTeXt users

On 2/17/2017 7:06 PM, Alan Braslau wrote:
> On Fri, 17 Feb 2017 18:42:25 +0100
> Hans Hagen <pragma@wxs.nl> wrote:
>
>> sx=
>> sy=
>>
>> iir small scales are also seen as fractions
>
> Like for the chemistry module, this can be confusing.
>
>
> Also, sx=,sy= muck with the aspect ratio, don't they?
>
> As we know, there is also an inconsistency in the handling of figure
> scaling. Consider:
>
> \startMPcode
>   draw externalfigure("cow") xsized 5cm ;
>   draw rawtextext("\externalfigure[cow]") xsized 5cm ;
>   draw rawtextext("\externalfigure[cow][width=5cm]") ;
> \stopMPcode
>
> The first will draw a distorted, square 5cmX5cm cow,
> The second and third will both draw an undistorted, rectangular
> 5cmX3.635cm cow.

indeed but that has to do with compatibility ...

>> or identifying libraries used
>
> which assume different default dpi. Can this be normalized in the case
> of file formats (such as pdf) that do not explicitly set the dpi?

luatex teies to figure it out from the tags in th efile ... there has 
been some improvements so maybe older luatex and new ones are different

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: \externalfigure question
  2017-02-17 18:06         ` Alan Braslau
  2017-02-17 18:20           ` Hans Hagen
@ 2017-02-17 18:20           ` j. van den hoff
  1 sibling, 0 replies; 11+ messages in thread
From: j. van den hoff @ 2017-02-17 18:20 UTC (permalink / raw)
  To: Hans Hagen, Alan Braslau; +Cc: mailing list for ConTeXt users

On Fri, 17 Feb 2017 19:06:30 +0100, Alan Braslau <alan.braslau@cea.fr>  
wrote:

> or identifying libraries used
> which assume different default dpi. Can this be normalized in the case
> of file formats (such as pdf) that do not explicitly set the dpi?

if possible I would say this could help "pedestrians" like myself some:  
during document creation and processing I nowhere do see any of that. I  
just get to severly different
pdf documents depending on which machine I compile it (it was a factor of  
2 different figure size in my case (extending well below page limits  
...)). from a user perspective this is of course highly unwelcome (and  
feels a bit like what is happening with MSword to this day, probably ;-))


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-02-17 18:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 14:20 \externalfigure question j. van den hoff
2017-02-17 14:42 ` Henning Hraban Ramm
2017-02-17 14:43 ` Hans Hagen
2017-02-17 16:04   ` j. van den hoff
2017-02-17 16:51     ` Alan Braslau
2017-02-17 17:05       ` j. van den hoff
2017-02-17 17:43         ` Hans Hagen
2017-02-17 17:42       ` Hans Hagen
2017-02-17 18:06         ` Alan Braslau
2017-02-17 18:20           ` Hans Hagen
2017-02-17 18:20           ` j. van den hoff

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).