Made pixel format conversions more accurate.
Merge pull request #14 from PeterHatch/master

Made pixel format conversions more accurate.