Hello,
The way of changing the image URLs depends on the approach you are using to display such images.
If you display them via some listing web part then it will be just about the transformation change.
On the other hand, having them in the
WYSIWYG Editor means you need to go through each editable region in particular document and change them manually. Of course, you could create an SQL script which will select all the DocumentContent columns, parse out images, change their URLs and update the record for all available documents.
Moreover, I can think of the API script, which would do the same, but in C# code.
Hope this helps you.
Best regards
Ondrej Vasil