I have an image which is mostly transparent with a bit of white on it, I'd like to make it transparent where it was white and white where it was transparent. How can I do that ?
local media = Media.new(e.path)for i =1, media:getWidth()dofor j =1, media:getHeight()dolocal r, g, b, a = media:getPixel(i, j)if a ==0then--transparent
media:setPixel(i, j, 255, 255, 255, 1)elseif r ==255and g ==255and b ==255then
media:setPixel(i, j, 255, 255, 255, 0)endendend
Comments
Likes: Disciple, talis, MoKaLux