I don’t use facebook, but when I have to strip down an image to the minimum bearable, I normally use jpegoptim. On a mac you can easily install it with homebrew. For convenience I use it within an automator app and an open with shortcut that gets things done quickly from the finder. From the top of my head, there’s also ImageOptim (app) which is quite nice - based on it image_optim - they also have some png alpha thingie, and caesium for mac and win. For critical compression/colour/accuracy maximum ratio, the best I’ve seen is TinyPanda/Jpeg - you can compress till 20 files online, their PS plugin’s expensive!!
BTW, as this site’s user level is quite high I feel the need to be straight-forward: these are 2 cents of someone who knows absolutelly nothing about code, but has two eyes and follows copy paste ancient tradition
{no fat budha}
Somethin’ of the sorts (quality 71) // notice there’s also a size option
for f in "$@" do jpegoptim -d/OPTIM_output -f -m71 -b -P -v --strip-all --all-progressive "$f" echo "$f" done
jpegoptim --help
-d<path>, --dest=<path>
specify alternative destination directory for
optimized files (default is to overwrite originals)
-f, --force force optimization
-h, --help display this help and exit
-m<quality>, --max=<quality>
set maximum image quality factor (disables lossless
optimization mode, which is by default on)
Valid quality values: 0 - 100
-n, --noaction don't really optimize files, just print results
-S<size>, --size=<size>
Try to optimize file to given size (disables lossless
optimization mode). Target size is specified either in
kilo bytes (1 - n) or as percentage (1% - 99%)
-T<threshold>, --threshold=<threshold>
keep old file if the gain is below a threshold (%)
-b, --csv print progress info in CSV format
-o, --overwrite overwrite target file even if it exists (meaningful
only when used with -d, --dest option)
-p, --preserve preserve file timestamps
-P, --preserve-perms
preserve original file permissions by overwriting it
-q, --quiet quiet mode
-t, --totals print totals after processing all files
-v, --verbose enable verbose mode (positively chatty)
-V, --version print program version
-s, --strip-all strip all markers from output file
--strip-none do not strip any markers
--strip-com strip Comment markers from output file
--strip-exif strip Exif markers from output file
--strip-iptc strip IPTC/Photoshop (APP13) markers from output file
--strip-icc strip ICC profile markers from output file
--strip-xmp strip XMP markers markers from output file
--all-normal force all output files to be non-progressive
--all-progressive force all output files to be progressive
--stdout send output to standard output (instead of a file)
--stdin read input from standard input (instead of a file)