Keep transparency if png is croped

Changes the compression format and bitmap-config depending on file-type to keep transparency.