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

According to the documentation, the optimize parameter instructs the PNG writer to make the output file as small as possible and for JPEG and other formats it’s not used for make output file small so it’s not used in other formats.  
http://effbot.org/imagingbook/format-png.htm