Hi
I save from original png with transparency and when i save loose the transparency and put a black background.
$imageObj = Image::make($request->file('activityUploadPhoto'))->orientate();
$imageName = substr(md5(Auth::user()->id), -10) . '_' . md5(microtime()) . '.' . $request->file('activityUploadPhoto')->getClientOriginalExtension();
$imageObj->save(config('paths.storage_tmp_imgs') . $imageName)
I have this version "version": "2.3.7",
Is a bug?
Thanks
I'm having a similar issue, where the PNG's shadow that is semi transparent is converted to flat black.
If you upload this....

to this...
https://www.apps.regenr8web.com.au/image-preparation/
you get this...

The controller simply resizes to max size and saves as JPEG with quality of 85.
Thoughts or ideas? Most recent version of the plugin (as of right now).
JPEG does not support alpha channel / transparency. If you want the background in another color than black, I would suggest you create an empty image with canvas() with the desired background color and insert() your semi-transparent image into this container.
Like this:
$png = Image::make('transparent.png');
$jpg = Image::canvas($png->width(), $png->height(), '#ff0000');
$jpg->insert($png);
$jpg->save('foo.jpg');
with imagick run correctly the plugin, with gd no
that did the trick with both GD and imagick drivers.
@olivervogel I wonder if this is a sensible default that should be apart of the framework. Is this a pull request you would consider if I put it together (or someone else)?
I figure if the image is being converted to a jpg, by default it should have a white background and keep the original images transparency (with the white behind it of course).
I think full transparency (seen in the corners of the image above) is converted to white and everything in between (like the shadow in the image above) becomes black. That's just the way GD works.
If you want it any another way, try my example above.
Most helpful comment
Like this: