zooniverse / panoptes-cli

A command-line interface for Panoptes
Apache License 2.0
18 stars 5 forks source link

Adding compression to JPEG image types #253

Open ramanakumars opened 1 year ago

ramanakumars commented 1 year ago

Adding a --compress option to the CLI for subject-set upload-subjects to automatically compress JPEG images during the upload. Currently this is the only format that works consistently; PNG compression requires image size scaling rather than quality based compression.

The compression code starts at 80% quality and successively reduces to 50% before throwing an error if the file size is still too large. For a ~2-3MB it seems like 2 iterations is enough for getting below the current 1MB limit so this should not take too long.