Image dimensions = 258Wx505H
I want to pinch both sides on the bottom by ~35px. Ideally, I want to pinch by a % of the original image, so I can pinch the bottom by 10% on each side - equally.
The code below works for a 258x505 image, however, I can't dynamically replicate this for images of various sizes.
Code: Select all
convert magick.png -virtual-pixel transparent \
-distort Perspective '0,0,0,0 0,%h,35,%h %w,0,%w,0 160,50,160,65' \magick2.png
1 - how do I change the bottom left coordinate to 10% vs a fixed pixel coord of 35 (as seen above)? I tried to dozens of % configurations and they all throw errors. In order to change images of various sizes on the fly, I need a dynamic value, or model to define ~10%.
2 - bottom right coordinates of 160,50,160,65... for the life of me, nothing other than 65 works. I can change the other numbers, but nothing yields a simple pinch left effect by ~10%.
note: I've tried wave displacement to bulge the image, but it causes the image to become totally distorted. Distort perspective seems to give me the results that I need, but finding a simple coordinate model seems impossible. I can generate simple % based coordinates based on the original image size, but everything seems totally unpredictable.