I want to skew an image like this what params I need to set for context.setTransform?

I want to skew an image like this what params I need to set
Share
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.
You cannot achieve this with a single 2D transform.
A 2D transform allows you to skew the image “upwards” or “downwards” by passing the tangent of the skew angle in the second argument to
setTransform(), but you want to perform both in a symmetrical manner (resulting in a “nearwards” and/or “farwards” deformation). You need a 3D transform to do that.However, you can emulate the same result by slicing the image into several horizontal “bands” and applying a different transform when rendering each band. Bands further from the half of the image will be applied stronger skew angles. Something like:
Note the bands are two pixels high instead of one to avoid a moire effect.
You can see the results in this fiddle.