Transparent Gradients

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
BradChesney79
Posts: 4
Joined: 2012-11-02T12:39:02-07:00
Authentication code: 67789

Transparent Gradients

Post by BradChesney79 »

The end result I am looking for is a ten pixel wide border that goes from fully opaque on the inner edge to fully transparent on the outer edge for all four sides.

Step 1: I think I am going to have to check that the alpha channels are available in conjunction with using the matte property.

Step 2: Then I think I am going to have to define a calculated 1 pixel wide region to set to a partial transparency and repeat that ~40 times to get the corners right.

Step 3: Lastly I will set the image type and compression level before writing to the cache directory on disk.

The problem is that my Google searching is not returning the right results to help me.

Would anyone be so kind as to provide search terms that will help me read up on what I need to know?
(Links to pertinent web pages would also be much appreciated.)

I am having trouble understanding what I need to do for Steps 1 & 2.

This eyesore is just a two minute example of the effect I would like to create programmatically.
Image
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Transparent Gradients

Post by Bonzo »

Is this the sort of thing you are after - Anthony's examples
BradChesney79
Posts: 4
Joined: 2012-11-02T12:39:02-07:00
Authentication code: 67789

Re: Transparent Gradients

Post by BradChesney79 »

PHP via Apache on Debian using the PECL implementation of imagick.

@Bonzo, holy crap-- that is it exactly. Thanks.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Transparent Gradients

Post by Bonzo »

Thanks BradChesney79 - it is just knowing where to look 8)

Things will probably not be as easy using Imagick :(
BradChesney79
Posts: 4
Joined: 2012-11-02T12:39:02-07:00
Authentication code: 67789

Re: Transparent Gradients

Post by BradChesney79 »

I can use the code as is, there is no requirement that I use imagic via PECL.
When I was looking at other posts I saw a few people ask about environment specifics.
You replied while I was preemptively providing that info.

Imagic via PECL is just how I have been doing everything else. Scale, crop, store edited image caches...

I just have to start with PHP to trigger the code you linked to and have it run. But, that I can figure out without too much trouble.

I consider my problem squashed... much appreciated.
Post Reply