Keeping tranparency when working from clipboard

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
lenourien

Keeping tranparency when working from clipboard

Post by lenourien »

Hello,
I am working with Imagemagick from powerpoint.
The problem I have is that I select a shape, say a disc for example nothing special. It has a transparent background.
I copy the shape and then ask ImageMagick to create a shadow using "clipboard:" as the source.
The problem is Imagemagick doesn't "see" the transparency and gives me a square shadow everytime.

By the way, I am having Imagemagick giving only the shadow back, so I don't do anything like flattening.
Also, if I export the shape as a png and work from there my code works perfectly, but from the clipboard, it works but no transparency.

I try to use api function to control the format in the clipboard but I am going nowhere. if anybody has any idea???

Any help would be much appreciated. Many thanks in advance.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Keeping tranparency when working from clipboard

Post by fmw42 »

pardon my ignorance, but how do you tell command line IM to use the clipboard as input?

can you modify the read of the clipboard by telling it -channel rgba -alpha on to get the transparency?
lenourien

Re: Keeping tranparency when working from clipboard

Post by lenourien »

Hello. To use the clipboard, as the source for my "convert" command, instead of myimage.png (an example) I use "clipboard:".
I found it in the Imagemagick doc.

As for your suggestion, thank you very much. I will try.
lenourien

Re: Keeping tranparency when working from clipboard

Post by lenourien »

hello again,
i tried your suggestion -channel rgba -alpha and it didn't work. Obviously Imagemagick sees the image in the clipboard as opaque.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Keeping tranparency when working from clipboard

Post by fmw42 »

so the clipboard is only for Windows?

did you put -channel rgba -alpha before clipboard: or after?
lenourien

Re: Keeping tranparency when working from clipboard

Post by lenourien »

Sorry I don't know much about systems others than windows but I assume "clipboard:" refers to whatever memory is used when you copy something.

I put -channel rgba -alpha after "clipboard:" as I assumed we should always start with the source. But maybe I was wrong. I'll try and see what happens.
Post Reply