Go to main content

gd_save_alpha

Save Alpha in GD

gd_save_alpha

NAME

gd_save_alpha - Save alpha channel in GD

SYNOPSIS

gd_save_alpha(image, integer);

DESCRIPTION

This function is used to set the the alpha blending for an image. From GD:

By default, gd 2.0.2 and above do not attempt to save full alpha channel information (as opposed to single-color transparency) when saving PNG images. (PNG is currently the only output format supported by gd which can accommodate alpa channel information.) This saves space in the output file. If you wish to create an image with alpha channel information for use with tools that support it, call gdImageSaveAlpha(im, 1) to turn on saving of such information, and call gdImageAlphaBlending(im, 0) to turn off alpha blending within the library so that alpha channel information is actually stored in the image rather than being composited immediately at the time that drawing functions are invoked.

MODULES

To use this module, you must specify the following in /usr/local/website/site.conf:

Module gd {
        Library : "/usr/local/lib/libsngd.so"
        Init : "sngd_init"
}

EXAMPLES

gd_save_alpha(im,1);

SEE ALSO

{{ include("includes/gd.sn") }}

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2016-04-01 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.