(1) save the file with a new JPG quality setting, or
(2) save the file to PNG (I'm not aware of any options for PNG), or
(3) save the current file format (typically JPG) and current quality setting.
This last option will basically be the same thing as "right click" and "save file", but I would prefer something that will work from a button.
How would I go about doing this? A code sample would definitely be helpful