How to Change Image Saving Options with the Python API? (Color, Color Depth)
You can discover nearly all data paths from Blender GUI itself.

Set your mouse cursor over a field and a tooltip will appear:



You can also copy (part of) the path directly here:



Then you can use it (and test it) from the Python console, and also discover all the properties you need using autocompletion with the Tab key:



So concretely you can for instance:

bpy.context.scene.render.image_settings.color_mode = 'RGBA'
bpy.context.scene.render.image_settings.color_depth = '8'
bpy.context.scene.render.image_settings.compression = 20


You can now easily search in the documentation:



And have access to a complete information for the fields values (click me).