Changing img_url helper URL format

Is there a way to change the result url format of the img_url template helper? I want to use an external service (Bunny Optimizer) for resizing images on the fly. But currently img_url only works for local images and I couldn’t see a way of changing it.