User:Raul Miller/graphics/png
Jump to navigation
Jump to search
The graphics/png addon looks handy but seems to be remarkably undocumented.
A small experiment with it suggests that (4#256) #: readpng filename
produces a bitmap representation of the image in ARGB format.
In other words:
- indices into the first dimension selects pixels vertically
- indices into the second dimension selects pixels horizontally
- the third dimension has four elements: alpha intensity, red intensity, green intensity, blue intensity
Logically speaking, it might be advantageous to instead represent these pixels in a more OpenGL style, using 255 %~ (4#256) #: readpng filename
.(this way these intensities each range from 0 to 1)