Modern smartphones have high resolution cameras that are total overkill for use on the web. The first step in compression for the web is typically to scale and reduce the resolution.
AI is not a requirement for scaling. For example, a simple algorithm for 50% scaling is to simply skip every other pixel row and column.