Page 1 of 1

Creating a image from zero? [SOLVED]

Posted: Sun May 12, 2019 6:38 pm
by Darlex
There is some way of creating a image from zero and saving it to a local file? like:

Code: Select all

img = love.graphics.createImage(200,200) --200x200 image
img:setPixel(1,1,0.5,0.7,0.87) --Sets the pixel x:1,y:1 to color 0.5, 0.7, 0.87
img:encode("poop.png")

Re: Creating a image from zero?

Posted: Sun May 12, 2019 6:48 pm
by zorg
That is exactly the way, except you use love.image.newImageData.
You can also use mapPixel on ImageDatas... also read through the wiki, it helps. :3

Re: Creating a image from zero?

Posted: Sun May 12, 2019 7:24 pm
by Darlex
zorg wrote: Sun May 12, 2019 6:48 pm That is exactly the way, except you use love.image.newImageData.
You can also use mapPixel on ImageDatas... also read through the wiki, it helps.
wtf really?. Thanks!