如何在php中实现tapestry模拟器

I want to implement a simulator like the one shown on this page http://www.fama.es/bolero.html#direct-simulator-0. I want to use ImageMagick with PHP. I have no experience with image manipulation in PHP. Any ideas

You would need to have each part of the sofa as a masked image. Then make new versions with the gray changed to whatever color you want (via Imagemagick command such as +level-colors, or -fill newcolor -opaque oldcolor). Then you need to your PHP to control which color image is displayed in the viewer

I test this code convert sleeves.png pattern.png \ \( -clone 0 -auto-level \) \ \( -clone 1 -clone 0 -alpha set -virtual-pixel transparent -compose displace \ -set option:compose:args -5x-5 -composite \) \ -delete 0,1 -compose multiply -composite sleeves_pattern.png in console and work very well. Soo, how I do this in PHP?