Image representation 2015-02-20

Images edited in stet are represented in true colour or 32 bit RGBA per pixel. This means there are 8 bits per Red, Green and Blue channels and therefore 256^3 colours per pixel. Additionally the 8 bits per pixel used for the alpha channel defines the opacity or transparency of the pixel. Progammatically the bytes are accessed in the RGBA order per pixel, such as

  
  for(var byte in image)
  {
    var red   = image[byte];
    var green = image[byte + 1];
    var blue  = image[byte + 2];
    var alpha = image[byte + 3];
  }
  
Back to blog