Resizing images with transparency

See all posts Reply

Resizing images with transparency new!
by Graham Ramsay, 15 years, 11 months ago
Hi,

Is it possible to resize a PNG with transparency and have the resized version preserve it's transparency? Currently the transparency is lost and replaced with white (or similar).

Here are the options I am using:
$handle->file_src_mime       = 'image/png'
$handle->file_new_name_body    = 'resized';
$handle->file_new_name_ext     = 'png';
$handle->image_resize        = true;
$handle->image_x            = 400;
$handle->image_y             = 400;
$handle->image_ratio          = true;
$handle->image_ratio_no_zoom_in = true;

Thanks,

Graham.

ps. It would be nice to be able to search the forums ;) (maybe I missed the link?)Reply
Re: Resizing images with transparency new!
by colin, 15 years, 11 months ago
The lastest version should preserve transparency. It uses a default background color only if the output format doesn't support transparency.

PS: you can search the forums, using the site-wide search on the top right corner of the site.Reply
Re: Resizing images with transparency new!
by Graham Ramsay, 15 years, 11 months ago
Hi Colin,

I'll do a bit more testing and see how I get on as I am running 0.25. Thanks for the tip re searching the forum too.

Graham.Reply