Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I am not a pro. programmer but know quite a bit. I have a small requirement to turn a flat image into a 3d cover, I am not posting the entire image.. but just 2 parts that i am facing problem at..
I was able to use perspective but that simply throw a straight line output.. and then tried using 'BilinearReverse' and "Shephard" features but none of them helped..
Here is the flat cover
and here is how the output should be..
So the spine has bit curves at the bottom and top (if you look at the output in full size)... and front cover has very very slight angle where it joins the spine.
It would really be a great if someone can help me out.
Do you really need the curved spine? Is is with a single color or with an image? If a single color, then you could use -draw with straight lines for sides and arcs for the top and bottom. see http://www.imagemagick.org/Usage/draw/
perhaps you could use -draw to create a mask of the desired outline, fill it with white and put black on the outside. The use the mask to "cookie-cutter" out the shape from an image under it. That is create the binary mask image. Resize your image for the spine (after you do the perspective tranform) to the same size or vice-versa. Then put the mask into the alpha channel so that the outside is transparent.
I have seen that example earlier and it has straight lines no curves..
I did many tries so forgot which code generated that output.. I am trying to replicate that effect and keep you posted.. but all i know that i put some stupid values in coordinates which doesnt make sense.. anyway let me try that again.
Yup... but that will not give the actual curved effect to elements near the edges like the top border and the bottom... I have used the perspective method successfully but it doesnt give that perfect one..
Here is the one generated by IM
But I need those perfect curves kinda bending effect (not sure whats that called) ... I tried -wave and -shear as well.. but somehow it did not work at all..
ecoverguru wrote:Yup... but that will not give the actual curved effect to elements near the edges like the top border and the bottom... I have used the perspective method successfully but it doesnt give that perfect one..
Here is the one generated by IM
But I need those perfect curves kinda bending effect (not sure whats that called) ... I tried -wave and -shear as well.. but somehow it did not work at all..
That is where the mask comes in if you draw arcs at the top and bottom and straight lines for the sides (after you have done the perspective transform).