Handle different extensions, add support for transparency.