Re: best downsampling method for DSLR photographs
Posted: 2012-09-21T04:53:15-07:00
I am revising my recommendations.
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=20992
Code: Select all
original.jpg -colorspace RGB -filter Triangle -resize 403x600 -colorspace sRGB fly.Triangle.png
Code: Select all
convert original.jpg -colorspace RGB -define filter:window=Spline -define filter:lobes=2 -distort resize 403x600 -colorspace sRGB fly.EWASplineJinc2.png
Code: Select all
magick original.jpg -colorspace RGB -define filter:window=Spline -distort resize 403x600 -colorspace sRGB fly.EWASplineJinc.png
Code: Select all
magick BackPack.jpg -colorspace RGB -define filter:window=Quadratic -distort resize 1200x1200 -colorspace sRGB backpack.EWAQuadraticJinc.png
But EWA Mitchell is not sharp enough.......NicolasRobidoux wrote:it's about as sharp as EWA Mitchell, but it has almost no second halo, and it definitely suppresses moire better.
viewtopic.php?f=1&t=20992&start=225#p90392
Code: Select all
magick null: -filter -set option:filter:blur '%[fx:3.23832/1.5]' -define filter:verbose=1 -distort resize 200% null: > quad.dat
Code: Select all
magick null: -define filter:window=box -define filter:verbose=1 -distort resize 200% null: > jinc.dat
Code: Select all
magick null: -define filter:window=quadratic -define filter:verbose=1 -distort resize 200% null: > quad-jinc.dat
Code: Select all
for i in *.dat; do
perl -i -ple '
undef $first if /#/;
next if /^$/ || /#/;
($x,$y)=split;
$first=$y if ! defined $first && $y > 0;
$y /= $first; $_="$x\t$y";
' "$i"
done
Code: Select all
gnuplot
set grid
plot "jinc.dat" with lines, "quad.dat" with lines, "quad-jinc.dat" with lines
Code: Select all
magick null: -define filter:verbose=1 -distort resize 200% null: > robidoux.dat
magick null: -filter RobidouxSharp -define filter:verbose=1 -distort resize 200% null: > robidoux_sharp.dat
I have always been advocating the direct use of EWA-Lagrange or even EWA-Catrom down-sampling instead of downsampling-then-USM.NicolasRobidoux wrote:P.S. ... which may not be bad, because many many people USM when downsampling.
This was exactly my intention. (I can't pass anything by you.)anthony wrote:...It is certainally a bit different. I have not compared it to a normal Cylindrical Lanczos yet though. But as Lanczos uses a untapered window function (first lobe of Jinc) and this uses a Tapered one, you are essentially getting something like a 2 lobe Lanczos using a 3 lobed Jinc...
You and I had the exact same idea.anthony wrote:...As the last positive lobe is so small (tappered windowing function), you can probably use a 3 lobe window support of -define filter:filter:win-support=3.23832 (as above) but limit the actual working support to just 2 -define filter:filter:lobe=2. The use of "win-support" setting has not been used much and may speed up things slightly by making the real (clipping limit) support smaller.
Indeed, you and Fred may have a point here. I just can't stand the artifacts.henrywho wrote:NicolasRobidoux wrote:... I have always been advocating the direct use of EWA-Lagrange or even EWA-Catrom down-sampling instead of downsampling-then-USM.