Jump to content

ImageMagick/MagickWand - anyone here experienced?


feuerfalke

Recommended Posts

Hi,

 

I'm trying to use MagickWand to do some seemingly simple tasks that gdlibrary is not powerful enough to do. However the Magickwand documentation is somewhere between sparse and nonexistent, and it is not helpful at all. I don't have the time to spend messing around with every single MagickWand function that looks like it might be useful. There are no good tutorials to using MagickWand online. If anyone is experienced with MagickWand and could point me in the right direction, that would be great.

 

The tasks I want to do are as follows:

 

1. Overlay one PNG onto another. This would seem simple enough - but MagickWand seems to insist on using some strange algorithm when I try to overlay the images. For example if I overlay a grey image onto some base image, rather than assuming the pixels are 100% opacity pixels with an RGB of 128,128,128 (as they actually are), it seems to think they are 0,0,0 pixels with an opacity of 50%. I don't think this is the actual algorithm it is using but it is one example. The function I am using is as follows:

 

MagickCompositeImage($image->outline,$image->base,MW_OverCompositeOp,0,0);

 

As you can see I'm trying to overlay an outline onto a base image, but every time I try to do that, no matter which order I arrange the resources in the function in, it will output the grey base image "over" the black outline image (so that you can only see the edges of the outline that are visible underneath the grey base image). Is there a simpler way to overlay PNG images similar to gdlibrary's imagecopy function?

 

2. Change the colour of an image. Say I have pixels with RGB value x,y,z with a varying alpha channel. I want to change those pixels to a different RGB value but leave the alpha channel alone. Is there any way to do this?

 

 

That is pretty much it for now. If anyone could help I would be so grateful! Thanks in advance..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.