When dealing with GD Library unwantedly altering c

2019-09-19 02:39发布

问题:

I'm merging multiple small images into a rectangular mosaic.

When dealing with a small number of source images it turns out fine:

But when dealing with a larger number of sources it turns out a sepia like effect:

Is there any technique I should be used to preserve the colors?

My method for merging the images is essentially running a script that loops through the source images using imagecreatefromjpeg() to grab it, followed by imagecopy() to merge the source onto the collective destination image (and runs until all images have been added/placed).

回答1:

instead of using imagecreate() as my starting point, I changed to imagecreatetruecolor() and it has resolve the color loss issue.



标签: php image gdlib