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?".
Post Reply
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 »

Thank you, Fred, for your feedback.
I constantly need to be reminded that my aversion to haloing is not universal.
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 »

henrywho wrote:...
BTW, EWA-SincSinc3 and 4 are really interesting. Their excessive haloing is producing darkening/brightening artifacts only at some particular downsize ratios.
An inferior low pass filter will "resonate" at certain ratios, which depend somewhat on image content. Basically this has to do with frequency response, and consequently aliasing, depending on the sampling rate (and, to a much lesser extent, phase variations).
Last edited by NicolasRobidoux on 2012-05-16T06:57:38-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 »

The bricks on the windmill give rise to a subtle moire, I think: Compare with the original. I tried the EWA Jinc Lanczoses with blur=sqrt(.5), and IMHO, this disqualifies them right there (given that I care more about faithfulness than sharpness). I'm adding them to the collection under the Jinc*Sharpening.png names.
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 decided to also downsample the test image given at http://en.wikipedia.org/wiki/Aliasing. The results are at http://web.cs.laurentian.ca/nrobidoux/misc/brickwall/.
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'll see if I can find the time to try Kaiser, both tensor and EWA.
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 »

Hmmm! At best it's Coke VS Pepsi, at worst it's Visa and Mastercard. :?
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 »

The good news is that they all are pretty good.

Moral: Just choose an ImageMagick filter at random? (Well, a few of the included ones are going in my "bad" bin, but it's not as if they carry an "I suck" name tag on their forehead.)
Last edited by NicolasRobidoux on 2012-05-16T06:58:59-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 »

henrywho wrote:As for upsize, tritical@doom9 has been maintaining an intra-field only deinterlacer which can be used as a video upsizer...
Note that I believe I can put together a general upsizer which uses similar principles to approach this kind of result without having to "train" a neural network. But it's going to be a while before I have time to program it. And I may just be kidding myself that my brain can beat a well-trained neural net.
Last edited by NicolasRobidoux on 2012-05-15T11:35:45-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 added downsamples of the famous Wikipedia "fly" image by JJ Harrison: http://upload.wikimedia.org/wikipedia/c ... rtrait.jpg
They are at http://web.cs.laurentian.ca/nrobidoux/misc/fly/.
This is a very telling test image. If you can, compare images having renamed them "randomly". You may surprise yourself.
P.S. To this batch, I've added the EWA Sinc-windowed Sinc (Sinc*.png) and the IM built-in EWA Jinc-windowed Jinc LanczosSharp (LanczosSharp.png).
Last edited by NicolasRobidoux on 2012-05-15T12:47:22-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 »

NicolasRobidoux wrote:
fmw42 wrote:Is there some good way to look for sharpness differences?
...
I don't know much about doing psychovisual experiments :-(
I also like Henry's approach: Step back from your computer so that the large version is roughly the same size as that at which you'll see the reduced version, and move back closer to view the smaller version.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: best downsampling method for DSLR photographs

Post by fmw42 »

I had just been zooming the reduced images using -filter point -resize and then alternating the images. I don't know if that is a good way or not.
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 »

fmw42 wrote:I had just been zooming the reduced images using -filter point -resize and then alternating the images. I don't know if that is a good way or not.
It's reasonable. However, there are artifacts that you'll miss if you don't look at downsized images at "normal resolution". For example, it's really hard to see moire, which is an interference pattern, if you zoom in a lot, unless you know what moire looks like when enlarged, and you remember what the original looked like there. The "overall tone" of an area can also be hard to compare when things are enlarged.
Last edited by NicolasRobidoux on 2012-05-16T07:00:29-07:00, edited 1 time in total.
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: best downsampling method for DSLR photographs

Post by henrywho »

The photo "Moire_pattern_of_bricks.jpg" is too blurry (or is ImageMagick too capable?)

We need sharper patterns, such as the brick walls on "7640_CO40_FM1-175pct_sRGB.jpg".
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 »

henrywho wrote:...We need sharper patterns, such as the brick walls on "7640_CO40_FM1-175pct_sRGB.jpg".
The downsizings of this very image found at http://web.cs.laurentian.ca/nrobidoux/misc/windmill/ are not enough?
Just to make sure it did not get lost in the bandwidth: I did two different downsizing dimensions of the above windmill image. I also did one downsizing of the brickwall image from Wikipedia: http://web.cs.laurentian.ca/nrobidoux/misc/brickwall/ and one of the fly image from Wikipedia as well: http://web.cs.laurentian.ca/nrobidoux/misc/fly/.
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: best downsampling method for DSLR photographs

Post by henrywho »

NicolasRobidoux wrote:The downsizings of this very image found at http://web.cs.laurentian.ca/nrobidoux/misc/windmill/ are not enough?
Nono... I mean that the brickwall image from Wikipedia is too blurry and not challenging at all for ImageMagick. Actually, any software failed on that image should be eliminated from Earth.

The brick walls on the windmill image has a much better reference value.

BTW, Nicolas, I seem to have missed some of the discussions. What are the objectives behind JincJinc2Radius2 and JincJinc4Radius4?
Post Reply