Mapping an image onto a set of coordinates

后端 未结 2 1646
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-15 05:18

I have a typical source image with a 3:4 aspect ratio. I also have a set of coordinates that I need to map the image onto in a separate image. The coordinates are not perf

相关标签:
2条回答
  • 2021-01-15 05:43

    Look into ImageMagick's Freeform Distorts.

    0 讨论(0)
  • I have some examples of the distort operators on my site ( http://www.rubblewebs.co.uk/imagemagick/operators/distort.php ) - using php but you will get the idea.

    You probably want the shepards method.

    $cmd = "$input -matte -virtual-pixel transparent".  
    " -distort Shepards \"0,0 0,0  0,100 20,100 0,200".  
    " 0,200 133,200 133,180 266,200 266,200 266,100".  
    " 246,100 266,0 266,0 133,0 133,20\" ";  
    exec("convert $cmd shepards.png");
    

    enter image description here

    0 讨论(0)
提交回复
热议问题