Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resize and convert a SVG image using a gimp script ?
#5
(11-13-2024, 12:46 PM)Alpha504 Wrote: Thanks for the advice about INTERPOLATION-NOHALO.

I have a preference for GIMP because after some tests with imagemagik and inkscape, the quality of the converted/resized images seems to be better with GIMP.

... and you use Cubic?

In Imagemagick there is an -interpolate option (to be used with  -scale) to define the interpolation algorithm used.

You'll see plenty of bad advice over interpolation algorithms on the web, because what works for some images won't work on others.

The interpolation algorithms have a frequency response (a bit like low-pass audio filters). But the high frequency response is not a simple decreasing curve, the response curves have bumps on high frequencies (strong bumps for simple algorithms like linear and cubic). So when the image that you scale has spatial components with frequencies that fall on these bumps they produce artefacts: roof and floor tiles, but also edges of oblique lines in CGI (so, typically, SVG renders). Using a different algorithm can put the frequency response bumps elsewhere so they no longer are a problem with the current image (but that doesn't make that new algorithm universal solution).

The general solution is to apply a good low-pass filter to the image before scaling it down, so that the image has no spatial frequency components in the bumps area. This good low pass filter is called "Gaussian blur". You just blur the image enough to blur out the details that will anyway be invisible in the scaled down output. And IM has a -blur operator that you can insert before the -scale.
Reply


Messages In This Thread
RE: Resize and convert a SVG image using a gimp script ? - by Ofnuts - 11-13-2024, 01:27 PM

Forum Jump: