ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Henning Hraban Ramm <texml@fiee.net>
Subject: Re: Use MetaPost to distort images?
Date: Sat, 4 Sep 2021 14:18:02 +0200	[thread overview]
Message-ID: <EFEB0998-17AF-467B-8F7C-1CAB143FA0D5@fiee.net> (raw)
In-Reply-To: <7cd61bb7-9f65-41c2-53f1-55489f9fa8f7@xs4all.nl>


> Am 03.09.2021 um 18:24 schrieb Hans Hagen via ntg-context <ntg-context@ntg.nl>:
> 
> On 9/3/2021 12:28 PM, Henning Hraban Ramm via ntg-context wrote:
>> Hi, is it possible to apply geometric transformations to images using MetaPost?
>> This is again way over my head, but I’m still trying different methods to let a ConTeXt document look more “hand-made”.
>> In my example*, I added frame and shadow to a photo and _distorted_ it slightly to have it look like a postcard was glued on the page (with a piece of tape). I’d like to automate and randomize that process.
>> I guess I could achieve something similar with ImageMagick (not with GraphicsMagick), but if it would be possible inside LMTX that would be great.
> the question is not so much if it can be done but how far we should go in doing things .. so, only as friday afternoon distraction, and because
> i wanted to upload anyway (not done yet) i'll meta-imp-magick that uses the gm lib interface (that only does simple conversions, but i added bur and noise an dcan add some more if needed as long as there is no weird stuff or code bloat)
> 
> not in the core, just as 'imp' because we don't want library dependencies (and the optional libs are lightweight delayed loading ones)
> 
> now, the drawback of course is that one needs gm installed (quite large) but it does work on my windows box so ...

Thank you!

That’s interesting and I can probably use it for a different project, but for what I had in mind, GM wasn’t enough. IM has much more features (and probably also flaws), is even bigger, with more dependencies, but I could install both with MacPorts.

I guess it’s on me to write a wiki page about GM.
And maybe adapt your code to IM...

I just thought since MP is great for geometrical calculations it might also be able to use transformation matrices on images.
But since I don’t understand matrix calculations anyway, I’ll live without.

Generally, I’d like to delay image manipulation as long as possible – only ConTeXt knows the final size of the used images, and since I want to keep e.g. frames and shadows at the same size for all images I need to calculate with that final size. 


Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2021-09-04 12:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 10:28 Henning Hraban Ramm via ntg-context
2021-09-03 16:24 ` Hans Hagen via ntg-context
2021-09-04 12:18   ` Henning Hraban Ramm via ntg-context [this message]
2021-09-04 17:06     ` Hans Hagen via ntg-context
2021-09-05  7:40       ` Henning Hraban Ramm via ntg-context
2021-09-05  8:10         ` Hans Hagen via ntg-context
2021-09-05  9:34           ` Henning Hraban Ramm via ntg-context
2021-09-06  2:13             ` Aditya Mahajan via ntg-context
2021-09-06  8:42               ` Henning Hraban Ramm via ntg-context
2021-09-05  8:46         ` Hans Hagen via ntg-context
2021-09-03 22:16 ` Bruce Horrocks via ntg-context
2021-09-04 11:59   ` Henning Hraban Ramm via ntg-context

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=EFEB0998-17AF-467B-8F7C-1CAB143FA0D5@fiee.net \
    --to=ntg-context@ntg.nl \
    --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).