Page 1 of 1

Convert image To cylindrical shape

Posted: 2020-04-07T06:19:10-07:00
by atf4_solace
Hello Team,
How can we convert the image to the cylinder shape in core ImageMagick?
Could anyone suggest a sample command for that process?

I tried with Fred's script but it is taking more time to generate so if You have a suggestion to optimize the Freds cylinder command that will also work

Screenshot of the input image that we have to convert is as below
http://prntscr.com/ruqk1o

Screenshot of the output image that is needed is as below
http://prntscr.com/ruqhmq

Any help will be appreciated

Re: Convert image To cylindrical shape

Posted: 2020-04-07T10:05:36-07:00
by fmw42

Re: Convert image To cylindrical shape

Posted: 2020-04-10T06:02:38-07:00
by atf4_solace
Hello Fred,
Thank You for the suggestion for the command of cylinder
I have tried the below command for converting one of the images as below

My input image is as below
https://i.ibb.co/LN7phx4/1447.jpg

My output Image is as below:
https://i.ibb.co/0CqwZYW/test12112-cloudimage.jpg

But I need the image as below:
https://imagemagick.org/Usage/mapping/rose_cylinder.png

Code: Select all

convert $my_input_image -background black -gravity south -splice 0x20 \( +clone -sparse-color barycentric '0,0 black 1040,0 white' \) \( -clone 1 -function arcsin 0.5  \) \( -clone 1 -level 40%,60% -function polynomial -4,4,0 -gamma 2 +level 50%,0 \) -delete 1 -virtual-pixel black  -define compose:args=17x20           -compose Displace  -composite $output_image
So could you please suggest what am I missing.

Help is appreciated
Thank You

Re: Convert image To cylindrical shape

Posted: 2020-04-10T12:34:42-07:00
by fmw42
Try this:

Image

Code: Select all

convert 1447.jpg -background none -gravity south -splice 0x20 \
\( +clone -sparse-color barycentric '0,0 black 1040,0 white' \) \
\( -clone 1 -function arcsin 0.5 \) \
\( -clone 1 -level 40%,60% -function polynomial -4,4,0 -gamma 2 +level 50%,0 \) \
\( +clone -alpha off -threshold 49.8% -negate -write mpr:alpha +delete \) \
-delete 1 -virtual-pixel none -define compose:args=17x20 -compose Displace -composite \
mpr:alpha -alpha off -compose copy_opacity -composite \
-background black -compose over -flatten 1447_result.jpg
Image