I don’t know enough about ImageOptim and the limitations of that software. But I would imagine if you want to shrink (compress) more than 6000+ images, as you mentioned in your post, any software would need a lot of time to finish that … and eventually get stuck in the process.
ImageOptim is good if you have to compress a few images, I even tried a few hundred and it worked.
But please check the settings (preferences) first: if you have all the settings activated in ImageOptim every image will run through every optimisation tool and there is a warning in the settings that says it will take a LONG time … like for instance:
So you should not use all the tools combined. They don’t recommend it. Just pick one or two. And if you use the optimisation level setting “Insane”, it will take an insanely long time. So that is also not recommended.
Just as @duncan said, PNGs should be avoided on the web, or only used in rare cases. I am always surprised when people use PNGs on websites as background images and some of them are HUGE in size, slowing down the website.
Most of the time you can use JPGs and SVGs.
iWeb used to produce a lot of PNGs for all its effects and it was a “nightmare”.