best downsampling method for DSLR photographs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

And yes, EWA Lanczos2Sharpest is a very good scheme, considering that it's 2-lobe, and consequently does not have the "bounceback" halo:
Image
More moire prone, however.
Code:

Code: Select all

magick BackPack.jpg -colorspace RGB -filter Lanczos -define filter:blur=0.88826421508540347 -distort resize 1200x1200 -colorspace sRGB EWALanczos2Sharpest.0.png
When I have some time, I'll revisit the fly.
Last edited by NicolasRobidoux on 2012-09-20T18:30:57-07:00, edited 3 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

@Henry:
I can perceive a slight difference in shine with linear RGB EWA LanczosSharp, but I can't with linear RGB Ginseng and linear RGB Lanczos2Sharpest.
It's almost as if the scheme has to be sufficiently nearest neighbour like to put the right amount of "noise" in the texture.
Also, Ginseng has slightly tighter haloing than LanczosSharp (but of course Lanczos2Sharpest has no second halo, ever).
Comments?
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: best downsampling method for DSLR photographs

Post by henrywho »

From the zipper on the left, I think Ginseng3 and EWA-LanczosSharp have similar "sharpness", but then from the backpack surface, EWA-LanczosSharp have less "noise".

For "Fly", I found something strange. On down-sampling to 403x600, Ginseng3 is making the compound eyes looking "brighter" (in contrast, EWA-Lagrange/Catrom is making it "darker"). Perhaps its "bounce-back" light halos are too strong (while EWA Lagrange's 1st-strike dark halos are too strong). Ginseng2 and Lanczos2VerySharp are safe though.

Aren't we pushing the limits (which have contradicting objectives) too much?
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

@Henry:
To get an idea of the tonal look, I compare with the result of -filter Triangle -resize, or occasionnally with nearest neighbour (-filter Point). Imperfect, but probably good enough.
-----
So, what I learned from you is that negative lobes can affect local colour when there is a complex texture. They don't only add annoying haloing/not so annoying acutance (in addition to locally smoothing/sharpening features).
-----
I agree that we are playing close to the zero sum. But if we succeed in classifying schemes w.r.t. artifacts, then we can produce a How To that tells people how to dial in or out certain artifacts, with a summary of what it costs.
-----
I'm starting to wonder if the EWA BC-splines (Robidoux & RobidouxSharp) may be better at preserving "tone", given that they are close to being "first order accurate", which means that they preserve affine gradients. Same with the good ol' -resize Mitchell.
The tricky thing, it appears, is not to let artificial moire through at the same time.
(Warning: Don't let me wear you out. I've done this to grad students, but they get a degree out of it at the end.)
Last edited by NicolasRobidoux on 2012-09-20T05:45:34-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

My guess is that the brightness change can be attributed to the tensor windowed-Sincs not being as good low pass filters as the EWA ones.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

When I have some time, I'll compare local linear light averages using one of the CMC colour tolerance "metrics".
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

When it's there, I can't stand Moire. Which is why EWA Robidoux and RobidouxSharp and Mitchell and the like (and of course EWA Catrom) will never be at the top of my list.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

@Henry: Just to make sure: Always go through linear light when downsampling (unless you want "special halo effects", of course), and if using a tensor filter with negative lobes (e.g. Ginseng) with -resize, make sure you use an HDRI version of ImageMagick. Otherwise the colour drift and/or moire and/or jaggies may come from the between orthogonal passes clipping.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

@Henry: I see what you mean. The fly is AWFUL with linear light Ginseng!
The eyes completely change character.
Moire from hell too :(
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

... but EWA Triangle gives a pretty nice halo free result:
Image
Tolerable moire.

Code: Select all

magick original.jpg -colorspace RGB -filter Triangle -distort resize 403x600 -colorspace sRGB fly.EWATriangle.0.png
The backpack looks pretty good too (too much moire, though). And of course, plain -filter Triangle -resize looks almost the same and is fast.
Image
EWA Quadratic and tensor Quadratic bring the moire down to an acceptable level and of course are very slightly more blurry. I'll show EWA Quadratic in my next post.
Grrr! This is confusing.
Last edited by NicolasRobidoux on 2012-09-20T15:30:30-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

EWA Lanczos Radius 3 also has too much moire on the fly.
EWA LanczosSharp is less affected, but it still has too much in my book.
Is this because the original is JPEG compressed and sharpened?
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

So, which schemes appears to be left somewhat unscathed after being put through the "fly" downsampling test? -resize Mitchell and -distort resize Robidoux!
I'll look some more but the fly is deadly.
EWA LanczosSharp was not maimed too badly. And monotone methods (tensor and EWA Triangle, tensor and EWA Quadratic) do well on the fly.
I could probably kill the moire using more lobes than 3 with windowed methods, but I don't like to do that in general.
Last edited by NicolasRobidoux on 2012-09-20T14:19:02-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

As promised, the results with EWA Quadratic:
Image
Image
Almost moire free and totally halo free (of course), but definitely not as sharp.
P.S. It's really too dull.
Last edited by NicolasRobidoux on 2012-09-20T18:18:02-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

I'm going to have to redo my downsampling recommendations.
-----
Something very interesting: EWA LanczosSharp has noticeably less moire with the fly than EWA Lanczos. \o/
P.S. This is false: I had miscomputed the EWA Lanczos result. It's really hard to see the difference. /o\
Of all my fancy somewhat sharp schemes, EWA LanczosSharp appears to be the one that best survives the fly downsampling test.
Here are the results with linear RGB EWA LanczosSharp:
Image
Image
Last edited by NicolasRobidoux on 2012-09-20T15:40:22-07:00, edited 4 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: best downsampling method for DSLR photographs

Post by NicolasRobidoux »

Plain -filter Mitchell -resize, although a bit soft, does really well too:
Image
Image
EWA Robidoux is almost the same: A bit sharper, a bit more (mild) halo, a bit more moire:
Image
Image
Visa and Mastercard.
-----
Warning: You may want to download when comparing. Firefox, for example, adds its own "banding" artifacts to some images. These artifacts are not there with Chromium. (The Mozilla Foundation has no image processing expert on staff and it shows.)
Post Reply