I think that you are asking about scaling the dimensions of the image and not the values of each pixel, I'll explain both.
An example of dimentional scaling is when you convert a sonogram/spectrogram for linear to mel spectrogram.
In this specific example, we convert sound into an image by extracting the frequencies in the audio and displaying the power (for example) of each frequency in each time step.
In audio, chaning the frequency from 20 hz to 30 hz will change dramaticly the sound you hear. But chaning from 15000 to 15010 will not be noticable, therefor it is logical to stech out the lower frequencies and squeeze the highr frequency to get an image where if you move up by 1 unit, the change in the sound will be allway the same, and that is done by converting to mel spectrogram which uses logarithmic scale.
This can be done in many ways, if you just want to change the scale of an image, convert it to a plot and change the "xscale" or "yscale" of the image.
On the other hand, you can also scale values of the image logarithmiclly, again, in the field of audio processing, most of the power in the sound is in the lower frequencies, and if you are looking for something in the higher frequencies, you'll have a problem since it will be overshadowed by the lower frequencies. In this case, you take each pixal of the image and convert it to it's log. note that you must make sure that the images have positive values (which the do most of the time unless you zero-centered the images) and add an small values to prevent log(0).
https://au.mathworks.com/matlabcentral/answers/361205-changing-just-the-axis-to-a-log-scale-one-and-not-the-image and https://au.mathworks.com/matlabcentral/answers/90055-how-to-do-logarithmic-image-normalization