Getting started with Imagick i have been using the following examples:
http://www.phpimagick.com/Imagick/rotateImage
To successfully rotate/scale/extent etc the image but cannot see how I can wrap it round a cylinder.
I can see there is a way of doing so with Cylindrical Displacement in the docs:
http://www.imagemagick.org/Usage/mappin ... e_cylinder
Like so:
Code: Select all
convert rose: -background black -gravity south -splice 0x8 \
\( +clone -sparse-color barycentric '0,0 black 69,0 white' \) \
\( +clone -function arcsin 0.5 \) \
\( -clone 1 -level 25%,75% \
-function polynomial -4,4,0 -gamma 2 \
+level 50%,0 \) \
-delete 1 -swap 0,1 miff:- |\
composite - -virtual-pixel black -displace 17x7 rose_cylinder.png
Code: Select all
$img = new Imagick($the_img_path);
// to resize
$img->resizeImage($_w, $_h, imagick::FILTER_LANCZOS, 1, false);
// to crop
$img->cropImage($crop_w, $crop_h, $crop_x, $crop_y);
I'm completely stuck on this.
Thanks