Image: [question] Possibility to set background color?

Created on 7 Oct 2013  路  2Comments  路  Source: Intervention/image

I am using your class to load images from different sources and formats, convert them to jpeg and save them to the server hdd.

Is there a built in possibilty to change the background color of the resulting jpeg? when converting some transparent PNGs, the background color of the jpeg changes to black.

Most helpful comment

I would create an empty "base image" with a background-color and insert the other image into this.

Image::canvas(100,100, '#b53717')->insert($img)->save('foo.jpg');

All 2 comments

I would create an empty "base image" with a background-color and insert the other image into this.

Image::canvas(100,100, '#b53717')->insert($img)->save('foo.jpg');

Works very nice.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

txusramone picture txusramone  路  6Comments

ludo237 picture ludo237  路  8Comments

kivivuori picture kivivuori  路  8Comments

bkkrishna picture bkkrishna  路  7Comments

ctf0 picture ctf0  路  4Comments