Hi all.
I would like to apply a non-linear scaling to an image with image edge as center point.
To illustrate what I am trying to achieve, I have manually created an input and output file in Photoshop. I have used a a grid to help visualize, but the effect will be applied to photos. Basically, the stretching should progressively increase from top of image to bottom of image. There should be no virtual pixels because the bottom and top edge remain fixed.
https://drive.google.com/file/d/16C_w5_ ... sp=sharing
https://drive.google.com/file/d/1YDsvVO ... sp=sharing
Thus far I have been going the route of displacement maps using simple gradient but that squeezes the image from both ends - not in one direction. If any one could lead me in the right direction it would be appreciated.
Thanks.
non-linear scaling
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: non-linear scaling
There was a discussion on that issue just a couple months ago. You may find some helpful pointers at THIS link. Several methods are described, and there's a link to one of Fred's scripts which should accomplish the task.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: non-linear scaling
Perhaps you used "-compose Displace", which is for relative displacement maps, not absolute displacement maps.josephs wrote:...displacement maps using simple gradient but that squeezes the image from both ends - not in one direction
This seems very close (identical?) to what you want:
Code: Select all
%IMG7%magick ^
checks.png ^
( +clone ^
-sparse-color Bilinear ^
0,0,#008,^
%%[fx:w-1],0,#f08,^
0,%%[fx:h-1],#0f8,^
%%[fx:w-1],%%[fx:h-1],#ff8 ^
-channel G -evaluate Pow 0.5 +channel ^
) ^
-compose Distort -composite ^
out.png
snibgo's IM pages: im.snibgo.com
Re: non-linear scaling
Yes. Exactly what I was looking for. Thanks for your help! I was nowhere close to this.