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 » 2012-11-05T13:22:41-07:00

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: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Transparent Gradients

Post by Bonzo » 2012-11-05T13:25:41-07:00

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 » 2012-11-05T13:26:58-07:00

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

@Bonzo, holy crap-- that is it exactly. Thanks.

Bonzo
Posts: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Transparent Gradients

Post by Bonzo » 2012-11-05T13:29:20-07:00

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 » 2012-11-05T14:07:55-07:00

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