When dealing with GD Library unwantedly altering colors

倾然丶 夕夏残阳落幕 提交于 2019-12-12 05:13: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.



来源:https://stackoverflow.com/questions/2420320/when-dealing-with-gd-library-unwantedly-altering-colors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!