Bulk smush images not in media library

I have a large group of files that are not in the WP media library, and I'm wondering if there is a way to bulk smush those images? If not, would a workable alternative be to copy those images into the media library, bulk smush them, then replace the original files (outside the media library) with the smushed files?