- Adding a Background option when flattening out a transparent PNG

This commit is contained in:
Clement DAL PALU 2015-09-28 17:33:38 -07:00
parent ebb3688b44
commit e83c80c93c
5 changed files with 42 additions and 0 deletions

9
vips.h
View file

@ -226,6 +226,15 @@ vips_webpsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
);
}
int
vips_flatten_image(VipsImage *in, VipsImage **out, double background[3]) {
VipsArrayDouble *vipsBackground = vips_array_double_new(background, 3);
return vips_flatten(in, out,
"background", vipsBackground,
NULL
);
}
int
vips_init_image (void *buf, size_t len, int imageType, VipsImage **out) {
int code = 1;