PHP GD Distort Perspective

时间:2016-12-31 14:42:42

标签: php gd

我目前正在使用以下课程来扭曲我的形象的视角; https://github.com/nchourrout/GD-Perspective/blob/master/perspective.class.php

这是我的代码;

$newTex->createPerspective(
    $points[4], $points[5],             //[2]
    $points[6] , $points[7],            //[3]
    $points[0], $points[1],             //[0]
    $points[2], $points[3],             //[1]
);

然而,在透视变化发生后,图像中的像素将被删除。我不明白为什么。

在这里你可以看到透视变化发生之前的图像; enter image description here

然而,渲染后我得到以下

enter image description here

渲染在正确的位置,只是删除了一些像素。有什么想法我会解决这个问题吗?或者构造某种模式匹配以手动填充它们。

非常感谢所有帮助!谢谢xD!

我想使用GD而不是像Imagick这样的外部扩展来实现这一点。但是,您也可以在Imagick中提供一个示例,我可以看看!那也很棒。

0 个答案:

没有答案
相关问题