Background after waving image using -wave..

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?".
Post Reply
aravs7

Background after waving image using -wave..

Post by aravs7 »

Hi,

Am absolutely new to Imagemagick.

This is what am trying to do:
I am trying to modify and bend an image along a sine wave (to create an arc of that image) and then place it on a cylindrical surface image like a cup, so that the image appears to be printed on the cup.

Problem: I am able to bend the image using -wave and make it an arc. But the displaced pixels, i.e the place above and below the actual image have some color. When i use background -none the background shows up in black. I want no background after waving the image. Want something like a transparent png image which can be used on web pages.

I guess i was clear explainging my point. Need help. Please let me know if something was unclear

Thanks,
Aravind
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Background after waving image using -wave..

Post by fmw42 »

be sure to use png or gif for your output. jpg does not support transparency

you may want to look at my unix bash script, cylinderize, see link below
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Background after waving image using -wave..

Post by anthony »

FYI, see also the example in IM examples, Image Mapping Effects
http://www.imagemagick.org/Usage/mappin ... e_cylinder
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Background after waving image using -wave..

Post by fmw42 »

When i use background -none the background shows up in black
try -background none

but looks like a bug as it works with any color but "none"
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Background after waving image using -wave..

Post by anthony »

If 'none' turns up as transparency, you need to make sure your image has transparency.
Ass a -matte or -alpha on afetr reading the source image.

You may also need -channel RGBA or -channel All setting for soem operators to handle transparency as well as colors.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Background after waving image using -wave..

Post by fmw42 »

this works fine.

convert koala.gif -background none -wave 10x64 wave.png


Note you have to use png or gif and not jpg as jpg does not support transparency.
Post Reply