PHP Function to bend/warp an image

两盒软妹~` 提交于 2019-12-23 22:40:35

问题


I'm working with my simple PHP captcha algorithm (http://www.source.ofitall.com/devel/captcha.php) and I have been struggling to try and adjust it to be the more attractive and easier to read, Google style captcha.

Does anyone know of a function that will take in a GD image reference and bend/warp it, Google style?


回答1:


If you can use ImageMagick on your server you might want to give this a try:

  convert koala.gif -background Blue  -wave 10x64  wave.jpg

UPDATE:

If you aren't using some library you will obviously have to write your own implementation.

Here are some suggestions where you can find useful informations on that:

  • If you are more of a hands on guy have a look at this freely available Java implementation of a SwimFilter or WarpFilter that can be downloaded here

  • Then there's an explanation of the 2-spline mash warping algorithm that might do what you want here.

  • Here's a good overview over algorithms that might suit your needs(Microsoft doc file).

You should be aware though that this isn't something that's easily implemented. But if you are interested in the topic and really really have to live withouth ImageMagick than that's your only chance(as far as I know).

And then there's also GD's bad performance..

Good luck! :-)



来源:https://stackoverflow.com/questions/1396252/php-function-to-bend-warp-an-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!