Spoiler
But, it seems to erase all pixels in output that are left of the corresponding pixels in img1. I'm doing this for a game. Help?
Posted 11 April 2016 - 02:06 PM
Posted 11 April 2016 - 02:40 PM
Posted 11 April 2016 - 03:08 PM
function mixImages(img1,img2)
local output = img1
for a = 1, #img2 do
if img2[a] then
for b = 1, #img2[a] do
if not output[a] then output[a] = {} end
if not img1[a] then
output[a][b] = img2[a][b]
elseif (not img1[a][b]) or (img1[a][b] == 0) then
output[a][b] = img2[a][b]
end
end
end
end
return output
end
0 members, 1 guests, 0 anonymous users