Need help converting 3d Cover!
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
Need help converting 3d Cover!
Hello guys,
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.
Regards,
N.
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.
Regards,
N.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
see http://www.imagemagick.org/Usage/distorts/#box3d
or if using Linux/Mac, see my unix bash shell script, 3Dbox at the link below.
or if using Linux/Mac, see my unix bash shell script, 3Dbox at the link below.
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
Re: Need help converting 3d Cover!
The box3d code doesnt give those finishing values... as I said the spine has bit curves or would that be called as spherize?
I am still trying.. and here is what my first attempt is.. LOL
Somehow just not able to get the right coordinates. as I am not a programmer its pretty to tough to understand the stuff..
I hope I can get some help...
I am still trying.. and here is what my first attempt is.. LOL
Somehow just not able to get the right coordinates. as I am not a programmer its pretty to tough to understand the stuff..
I hope I can get some help...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
How did you get the above? What commands? Perhaps if we see that, we might be able get the bottom also.
An approximation woul be a cylinder distortion, though I doubt my cylinderize script will be able to help. Neither would http://www.imagemagick.org/Usage/mappin ... e_cylinder. But you may get some ideas about distortions from http://www.imagemagick.org/Usage/mapping/
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/
An approximation woul be a cylinder distortion, though I doubt my cylinderize script will be able to help. Neither would http://www.imagemagick.org/Usage/mappin ... e_cylinder. But you may get some ideas about distortions from http://www.imagemagick.org/Usage/mapping/
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/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
see also the example and code at viewtopic.php?t=11726
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
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.
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
Re: Need help converting 3d Cover!
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.
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.
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
Re: Need help converting 3d Cover!
Its not plain color its going to be an ecover so there are going to be gradients, images, horizontal lines in between as image
as above, it cannot be cropped either as there are going to be lines inbetween
here is the command i used to generated earlier output.
as above, it cannot be cropped either as there are going to be lines inbetween
here is the command i used to generated earlier output.
Code: Select all
exec("convert flat_cover.jpg -crop 109x802+0+0 +repage -virtual-pixel transparent -matte +distort Polynomial '1.5 \
0,0 0,0 802,0 403,33 802,109 390,36 0,128 0,123' spine.png");
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
see my notes about using -draw above. perhaps that will give the appearance of a curved spine though only the top and bottom will be curved.
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
this just gives me straight sides and slanted top and bottom.
convert -size 109x802 xc:darkgreen -virtual-pixel transparent -matte +distort Polynomial '1.5 \
0,0 0,0 109,0 109,100 109,802 109,802 0,802 0,702' spine.png
convert -size 109x802 xc:darkgreen -virtual-pixel transparent -matte +distort Polynomial '1.5 \
0,0 0,0 109,0 109,100 109,802 109,802 0,802 0,702' spine.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
You first have to do the perspective transformation, then use the mask on that.
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308
Re: Need help converting 3d Cover!
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..
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..
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help converting 3d Cover!
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).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..
-
- Posts: 37
- Joined: 2010-10-12T12:42:53-07:00
- Authentication code: 8675308