开发者

Is this effect possible with php code, without special software

I've learned to never underestimate what PHP and some libraries can do, so for this paper effect, can it be done with a php graphics library (or at least programmatically) without needing something like Photoshop or Illustrator?

To be clear, I'm asking just about the paper, not the iphone.

Edit: Dan G开发者_Go百科rossman's answer is great. I'm also wondering if someone can give me algorithmic ideas what might be happening in this image so I could try to possibly come up with some code to map it mathematically. My visual imagination is failing me a little.

Is this effect possible with php code, without special software


The answer is always yes, it's just a matter of difficulty/complexity.

PHP is a Turing-complete language, which means it has equal capabilities of every other Turing-complete language, like C++/Java or whatever your photo editing program was written in.

That means whatever Photoshop does, you can do. If nobody has written a handy library, you can treat the image as a matrix and perform the mathematics necessary to get the desired warping, then write the resulting matrix of pixel information to a new image one pixel at a time as a bitmap.

Of course you weren't hoping for that answer, you meant "does someone provide an easy library for PHP to do effects like this with a couple prewritten commands", right?

That's a little much for PHP's GD library, but you can always shell out to a command line image processor, like imagemagick, and read the resulting file to send back to the browser.


Imagemagick has plenty of distortion methods which will help you get to where you want. However with the detail you've given you'll need to do the math yourself to work out the correct combination of distortions to get the page curl you're after

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜