Is there a way to do a FishEye (or Barrel transformation) effect on a image with PHP-GD?
I found this with some code, but I have a hard time porting it to PHP.
How can I implement a fisheye lens effect (barrel transformation) in MATLAB?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
But – It is possible with GD and fast!! in comparison with ImageMagick

Create a new image with the size of (2*SourceWidth)/PI.
Walk trough each pixel of the new image and find the distance from the center.
dsource=hypot(x-centerX,y-centerY)
Find the corresponding distance in the source image by ddest.=2*r*asin(dsource/r)/2
r is the half width of the destination image.
See examples with bench mark: http://meindesign.net/picture2bubble/picture2bubble.php