I am using Eventviva for image scaling, resizing etc.
Problem is if I use it for saving transparent png without resizing or scaling, like this
$image = new \Eventviva\ImageResize($file['tmp_name']);
$image-save(self::getFilesDir($file['id']));
Image that was 512x512px and 14kb in size is now 1Mb
Eventviva uses next functions:
imagecreatefrompng, imagecreatetruecolor, imagealphablending, imagesavealpha, imagecopyresampled and in the end imagepng to save the image
I can't figure out what part enlarges image. You can take a look the source of the save function here