Getting Image Data of Image
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Getting Image Data of Image
I've been looking through the love api and I can't seem to find a way to get the ImageData from an image. I know you can replace it with (Image:replacePixels()) and you used to be able to get it with (Image:getData()). Was that feature removed, or is there just something I'm missing?
Re: Getting Image Data of Image
If you read the big red warning at the top, you'll see that this function is removed since love 11.0. And like the warning suggests, there is no way to get an ImageData from an Image anymore - instead, you should first create an ImageData, and then create the Image from that, while still keeping a reference of the original ImageData around.GVovkiv wrote: ↑Sat Mar 06, 2021 10:05 pm I guess you talking about https://love2d.org/wiki/(Image):getData
Re: Getting Image Data of Image
Or you could cheat: draw the Image to a Canvas of the same size, and use Canvas:newImageData() to get what you want. Following the wiki's recommendation is probably more efficient, though.
Re: Getting Image Data of Image
yeahsteVeRoll wrote: ↑Sat Mar 06, 2021 10:17 pmIf you read the big red warning at the top, you'll see that this function is removed since love 11.0. And like the warning suggests, there is no way to get an ImageData from an Image anymore - instead, you should first create an ImageData, and then create the Image from that, while still keeping a reference of the original ImageData around.GVovkiv wrote: ↑Sat Mar 06, 2021 10:05 pm I guess you talking about https://love2d.org/wiki/(Image):getData
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests