manipulating pixel Color

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

manipulating pixel Color

Post by chaos »

"Color image:pixel(x, y) --get"

how can i manipulate the data from this object?

for example, if i want to know what is the red value of the pixel at 3,9 on a image.. how do i find out?

basically, i'm trying to create a fade function to fade parts of the screen, but i don't know any way to find the rgb value of a given pixel.
Chaosmachine Studios: High Quality Homebrew.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: manipulating pixel Color

Post by Shine »

Try yourColorObject:colors().r for the red component of a color object (and g, b, a for green, blue and alpha components). But I think a fading is too slow with Lua Player with this method, we need some 2D graphics library or OpenGL for it.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

thanks, that works.. but you're right, it's very slow :\
Chaosmachine Studios: High Quality Homebrew.
Post Reply