Added cdef write support.
Negative tests for images with alpha layers.