Compress images to upload on website

Compress images and upload them on website using the quality selected by user.

Task: https://openerp.my.openerp.com/web?#id=8680&view_type=form&model=project.task&menu_id=3942&action=327
Pad: https://pad.odoo.com/p/r.BpiW2XLoXNlh35yj

Thanks

> I have used JPEG format because it decreases the file size because there is not much change in size using PNG format

Well yeah but in JPEG there's also a loss in quality.

> when image mode is P or I then we can’t change the image format

Except here an image in mode `RGB` won't change image format either.