Creating a image from zero? [SOLVED]

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Darlex
Party member
Posts: 118
Joined: Sun Sep 24, 2017 10:02 am
Location: absolutely not Chile
Contact:

Creating a image from zero? [SOLVED]

Post by Darlex » Sun May 12, 2019 6:38 pm

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")
Last edited by Darlex on Sun May 12, 2019 7:24 pm, edited 1 time in total.
culdud uwu

User avatar
zorg
Party member
Posts: 2747
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Creating a image from zero?

Post by zorg » 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. :3
Last edited by zorg on Sun May 12, 2019 7:47 pm, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
Darlex
Party member
Posts: 118
Joined: Sun Sep 24, 2017 10:02 am
Location: absolutely not Chile
Contact:

Re: Creating a image from zero?

Post by Darlex » Sun May 12, 2019 7:24 pm

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!
culdud uwu

Post Reply

Who is online

Users browsing this forum: Bing [Bot], raidho36 and 10 guests