First commit, this version is not yet working. It does not write anything to images.