Cylinderize script radius

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
hmakani
Posts: 4
Joined: 2015-07-28T04:17:34-07:00
Authentication code: 1151

Cylinderize script radius

Post by hmakani » 2015-07-28T04:28:26-07:00

Hi Fred,
We are using your cylinderize script and It is a really amazing script.
I need your help to understand radius for cylinderize image.I need specific size cylinderize image everytime with respect to variation of wrap.
like I need cylinderize image with width 206 width with different wrap ... I can achieve it using -r 103 and -w 50.
is there any calculation which provide -r value with respect to output image width and wrap ?

Thanks,
Harsh

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Cylinderize script radius

Post by fmw42 » 2015-07-28T09:11:00-07:00

The -r argument is independent of the size of the output image. -r is the radius of the cylinder in the background image or your desired radius in the output image, if there is no background image. If the cylinder is vertical, then It is the width of the cylinder in pixels from one side to the other divided by 2, i.e. the diameter divided by 2. If you want a bigger radius corresponding to the size of the input/output image, then you must compute the fraction of the width of the output image that should correspond to the radius. Then multiply that ratio by the width of the output image to get the radius.


Radius does not control the amount of wrap. Wrap is independent of the radius and the output image. That is controlled using the -w argument. If -w=50, the input image will wrap such that the whole width of the image will show on the cylinder (object) from its left side to its right side. If -w=100, then you will see only half of the image on the cylinder.

If this does not explain it well enough, then please clarify your question in more detail.

Do you have a background image or only the image to be wrapped into a cylinder?

hmakani
Posts: 4
Joined: 2015-07-28T04:17:34-07:00
Authentication code: 1151

Re: Cylinderize script radius

Post by hmakani » 2015-07-30T04:57:09-07:00

Hello Fred,

Thanks for you quick reply. I do understand your calculation.
I am doing vertical cylinderiz of image on background and we are doing like user can resize logo on background and all wrap,offset,pitch,height and radius calculate dynamically.

It was a really good piece of advice – thanks a million!
Harsh

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Cylinderize script radius

Post by fmw42 » 2015-07-30T09:23:24-07:00

hmakani, please see my PM on this forum to you. Thanks

Post Reply