You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My need is resizing landscape and portrait photos to square thumbs (png). Instead of cropping to cover, I want the images to fit inside the square. EmbedWhite and EmbedBlack work perfect here, but I'd like to EmbedTransparent, as my images are on a greyish background.
The inverse of this feature would be to specify the background colour when converting from transparent PNG/WebP images to JPEG - see jcupitt/libvips@b21c47b
This approach makes sense to me. Assuming an image to have an alpha channel is reasonable IMO. Default colour for flattening a transparent image to jpg is white I guess.
The inverse of this feature would be to specify the background colour when converting from transparent PNG/WebP images to JPEG - see jcupitt/libvips@b21c47b
—
Reply to this email directly or view it on GitHub.
Hey @lovell, I just tested and it works like a charm. Awesome stuff. As I am on holiday I am not able to test any further, but a drop in replacement using .background({r: 0, g: 0, b: 0, a: 0}).embed() did the trick. Thanks!
Activity
lovell commentedon Sep 10, 2014
Good idea, should be possible. Some thoughts for when I get round to implementing this:
embed*API method(s) slightly to accommodate thisThanks for the suggestion.
lovell commentedon Sep 15, 2014
The inverse of this feature would be to specify the background colour when converting from transparent PNG/WebP images to JPEG - see jcupitt/libvips@b21c47b
ssured commentedon Sep 15, 2014
This approach makes sense to me. Assuming an image to have an alpha channel is reasonable IMO. Default colour for flattening a transparent image to jpg is white I guess.
On 15 Sep 2014, at 16:07, Lovell Fuller [email protected] wrote:
Allow embed with rgba background #86 #89
lovell commentedon Oct 2, 2014
Hi @ssured, are you able to verify the new
backgroundandembedmethods on thealphabranch meet your needs?ssured commentedon Oct 7, 2014
Hey @lovell, I just tested and it works like a charm. Awesome stuff. As I am on holiday I am not able to test any further, but a drop in replacement using
.background({r: 0, g: 0, b: 0, a: 0}).embed()did the trick. Thanks!lovell commentedon Oct 7, 2014
Great news, thank you for confirming.