transparent background for pad operation?

Archived from the Transloadit support forum. Originally posted on June 15, 2011; details may be outdated, see our docs for current behavior. Original thread

Hi,

The documentation for /image/resize talks about the background parameter and its use with pad mode of resizing. That all works great.

It doesn’t mention if transparency is supported – i.e. can I have the image padded with a fully transparent border rather than a color? For our purposes, we don’t actually need to be able to specify a full rgba value – either colors with alpha 1 or fully transparent would be fine.

Thanks for the great product!

Hi there, and sorry for the late reply.

We are basically passing this parameter to image magick, so all values supported by image magick should work.

Looking at this in more detail here: http://www.imagemagick.org/script/color.php#color_names it seems that you can specify rgab values like so:

rgab(255,0,255,0.5)

Let me know if that works for you.

Hi Felix

That does indeed work. Note it’s rgba, not rgab :slight_smile:

Love the service!
-s
P.S. Thanks for all the work you’re doing to make Node successful too.
We’re huge fans of that project.

Sorry for the typo, but glad it’s working now! : )

--fg