import sensor, imlib
sensor.set_pixformat(sensor.RGB565)
while (True):
  image = sensor.snapshot()

import sensor
sensor.set_pixformat(sensor.RGB565)
while (True):
  image = sensor.snapshot()

Update FB viewer example