Added preserveFileType and transparencyFillColor
In order to keep transparency working on png files, I've added a preserveFileType
option. I noted the limitation in the readme, if this is kept compression will not work; the only way to effect file size will be through changing the dimensions of the image.
Also, when compressing pngs, which also converts them to jpeg; the transparent sections of the image were being replaced with black. I added an option called transparencyFillColor
to allow a color to be passed in. This uses https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle under the hood, so anything it can do, this can do.