love-canvas_getPixel /

Filename Size Date modified Message
950 B
391 B
19.9 KB
45.2 KB
3.3 KB

Fork information

This fork adds a getPixel(x, y) method to the Canvas object. I created this out of my annoyance with the current method of obtaining pixel data, which is to create a full ImageData object and run setPixel() on that. This adds an incredible load if done frequently, such as in the draw loop, but for my purposes I really needed to test pixel data for each frame. The method I've devised does not create a significant framerate drop on my system, even when performed in every iteration of the draw loop.



r, g, b, a = Canvas:getPixel( x, y )


number x

The position of the pixel on the x-axis.

number y

The position of the pixel on the y-axis.


number r

The red component (0-255).

number g

The green component (0-255).

number b

The blue component (0-255).

number a

The alpha component (0-255).

See Also


LÖVE is an awesome framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X and Linux.


We use our wiki for documentation. If you need further help, feel free to ask on our forums, and last but not least there's the irc channel #love on OFTC.



Use the project files for Visual Studio 2010 located in the platform dir.


Run platform/unix/automagic, then run ./configure and make.


Use the XCode project in platform/macosx.

For both Windows and OSX there are dependencies available here.

Repository information

We use the 'default' branch for development, and therefore it should not be considered stable. Also used is the 'minor' branch, which is used for features in the next minor version and it is not our development target (which would be the next revision). (Version numbers formatted major.minor.revision.)

We tag all our releases (since we started using mercurial), and have binary downloads available for them.


Releases are found in the 'downloads' section on bitbucket, are linked on the site, and there's a ppa for ubuntu, ppa:bartbes/love-stable.

There are also unstable/nightly builds:

  • For windows they are located here.
  • For ubuntu linux they are in ppa:bartbes/love-unstable
  • For arch linux there's love-hg in the AUR.
  • For other linuxes and OSX there are currently no official builds.


  • SDL
  • OpenGL
  • OpenAL
  • Lua / LuaJIT / LLVM-lua
  • DevIL with MNG and TIFF
  • FreeType
  • PhysicsFS
  • ModPlug
  • mpg123
  • Vorbisfile