[FEATURE] Add attribute format and quality for target file

This is a replacement for pull request #484. The first commit is rebased and fixed in regard to our CGL. The quality commit seemed to be unfinished since the quality attribute was never used.