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
Darlex
Party member
Posts: 128
Joined: Sun Sep 24, 2017 10:02 am
Location: Chile
Contact:

Creating a image from zero? [SOLVED]

Post 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")
Last edited by Darlex on Sun May 12, 2019 7:24 pm, edited 1 time in total.
Hi! I wish you have an amazing day!
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Creating a image from zero?

Post 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
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.
Darlex
Party member
Posts: 128
Joined: Sun Sep 24, 2017 10:02 am
Location: Chile
Contact:

Re: Creating a image from zero?

Post 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!
Hi! I wish you have an amazing day!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 46 guests