Am 03.09.2021 um 18:24 schrieb Hans Hagen via ntg-context
: 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.
On 9/3/2021 12:28 PM, Henning Hraban Ramm via ntg-context wrote: 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