Optimizing processed images - janko/image_processing GitHub Wiki
After images have been processed, you might want to additionally optimize them to reduce their filesize. The image_optim gem does this:
require "image_optim"
thumbnail = ImageProcessing::Vips
.resize_to_limit(400, 400)
.saver(quality: 85)
.call(image)
image_optim = ImageOptim.new(...)
image_optim.optimize_image!(thumbnail.path)
thumbnail.open # refresh file descriptor
thumbnail # optimized thumbnail