我希望使用PHP编辑和移动图片。
例如,我想转换此图片:
并将其转换为此图片:
我并不需要为它编写的代码,如果可能的话,只是指向大致方向。我该怎么做?有可能吗?
答案 0 :(得分:0)
作为让你前进的首发,你可能会需要以下内容:
# Create a new canvas big enough for result
$im=imagecreatetruecolor(x,y);
# Fill canvas with pukey yellow colour background
$yellowbkgrnd=imagecolorallocate($im,255,247,212);
imagefill($im,0,0,$yellowbkgrnd);
# Load basic, original rainbow image
$orig=imagecreatefrompng("original.png");
# Copy basic original image across top of new one
imagecopyresampled($im,$orig,...);
# Now paste it again, but smaller and further down, left aligned
imagecopyresampled($im,$orig,...);
# And paste one last time, to the right of previous pasted copy
imagecopyresampled($im,$orig,...);
# Save result to file
imagepng($im,"result.png");