JPEG Compression for reducing image size


I’m using the ngCordova Image Picker to get a bunch of images from the gallery. I’m using the following settings for the image quality:

var options = {
maximumImagesCount: 15,
height: 600,
quality: 60

For JPEG images, this work perfectly and I get small (usually < 200kb) images that can be easily transmitted to the server. However, when the user selects PNG images, even after reducing the resolution to width x 600 and quality to 60, I get images ranging from 400 kb to 2 mb.

I’m wondering if there is a way, either using Cordova Image Picker or another plugin to get the selected images in JPG format, resulting in a much smaller size? Or would I have to use a javascript implementation of JPEG encoder, and would this result in a big performance hit if done on the phone?

Thanks and Cheers