Graphics::highResamplingQuality

is not always very high quality.

If you take a large image (such as that from a digital camera) and use this to scale down

image.rescaled(w,h, Graphics::highResamplingQuality);

it’s just terrible. i had to use another image library in the end.

or am i missing something.

Hi Hugh, I think high quality is better than medium for upsampling only - they’re both the same for downsampling (area averaging).

Thanks.

I suspected something like this. Most of the time i am scaling up and it looks fine. when i scale down, it looks bad when the picture is many times bigger than the result.

hmm. perhaps juce should have some downsampling code.

Yeah, it’ll be ok for small amounts of down-sampling, e.g. 50% or greater, but it was designed for speed rather than quality, so will only do area-averaging of 4 source pixels per dest pixel.

A quick hack for good quality if speed isn’t an issue is to do it in several stages, scaling down by no more than 50% repeatedly until you hit your target size. That’d require a temporary buffer, but depending on what you’re doing might do the job.