Using php vips to convert indexed/alpha transparent gif/png to jpg with non black background #157
Unanswered
richardsyeo
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @richardsyeo, you just set $image->writeToFile('vips_test_output/quad_indexed.jpg', [
'background' => 255
]); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have tried without success to use php vips to convert indexed/alpha transparent gif/png to jpg and set background to be color other than black which is default when using below code.
$image = Vips\Image::newFromFile('vips_test_source/quad_indexed.png');
how do i remove transparency and set background to be white not black?
$image->writeToFile('vips_test_output/quad_indexed.jpg');
Using Ubuntu 22.04 which appears to come with 8.12.1 of vips.
Any solutions much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions