best downsampling method for DSLR photographs
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Fred: And yes: In my back of the envelope mind, there was no way that anything past RobidouxSharp could be any good. My grad student and Henry and you sure are blowing my back of the envelope off the table
- 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
Some more experiments:
1)
convert zelda3.png -filter catrom -define filter:blur=0.7 -distort resize 200% zelda3_200_distort_catrom_b0p7.png
2)
convert zelda3.png -define filter:support=2.5 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order4.png
convert zelda3.png -define filter:support=3 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order5.png
convert zelda3.png -define filter:support=3.5 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order6.png
The catrom with filter:blur=0.7 is sharper than the default catrom (filter:blur=1). But it shows stair-stepped artifacts
The lagrange of order 4 (filter:support=2.5) is even sharper, but has far less artifacts, though there is some in comparison to the default order 3 (filter:support=2) lagrange. This is to be expected as the even order lagrange filters have discontinuous slopes. See (http://www.imagemagick.org/Usage/resize/#lagrange).
The order 5 lagrange is only slightly sharper at best than the order 3 (default) lagrange.
There seems to be no or little increase in sharpness or difference, when using lagrange of order 6 in comparison to order 4.
3)
convert zelda3.png -filter catrom -define filter:lobes=2 -distort resize 200% zelda3_200_distort_catrom_lobes2.png (default)
convert zelda3.png -filter catrom -define filter:lobes=3 -distort resize 200% zelda3_200_distort_catrom_lobes3.png
convert zelda3.png -filter catrom -define filter:lobes=4 -distort resize 200% zelda3_200_distort_catrom_lobes4.png
Catrom with lobes=3,4 are not any sharper than with lobes=2.
1)
convert zelda3.png -filter catrom -define filter:blur=0.7 -distort resize 200% zelda3_200_distort_catrom_b0p7.png
2)
convert zelda3.png -define filter:support=2.5 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order4.png
convert zelda3.png -define filter:support=3 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order5.png
convert zelda3.png -define filter:support=3.5 -filter lagrange -distort resize 200% zelda3_200_distort_lagrange_order6.png
The catrom with filter:blur=0.7 is sharper than the default catrom (filter:blur=1). But it shows stair-stepped artifacts
The lagrange of order 4 (filter:support=2.5) is even sharper, but has far less artifacts, though there is some in comparison to the default order 3 (filter:support=2) lagrange. This is to be expected as the even order lagrange filters have discontinuous slopes. See (http://www.imagemagick.org/Usage/resize/#lagrange).
The order 5 lagrange is only slightly sharper at best than the order 3 (default) lagrange.
There seems to be no or little increase in sharpness or difference, when using lagrange of order 6 in comparison to order 4.
3)
convert zelda3.png -filter catrom -define filter:lobes=2 -distort resize 200% zelda3_200_distort_catrom_lobes2.png (default)
convert zelda3.png -filter catrom -define filter:lobes=3 -distort resize 200% zelda3_200_distort_catrom_lobes3.png
convert zelda3.png -filter catrom -define filter:lobes=4 -distort resize 200% zelda3_200_distort_catrom_lobes4.png
Catrom with lobes=3,4 are not any sharper than with lobes=2.
- 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
The last few post here have gone off track from the subject about downsampling and have turned into upsampling. Perhaps this topic should be linked to viewtopic.php?f=22&t=21435&start=15
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
(Gasp!)fmw42 wrote:...
What surprised me about my experiments with IM above was that the EWA versions of Catrom and Lagrange were noticeably better than the orthogonal ones.
...
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Anthony: If downsampling through Lab or actually anything else than linear RGB or XYZ turns out to be better than these last two, you'll shock more than just me.
Re: best downsampling method for DSLR photographs
Hey, I thought I had made myself clear in some posts that I prefer EWA Lagrange over EWA Catrom for downsizing in place of unsharpening.NicolasRobidoux wrote:Fred: Your observations jive with "why" Henry tried EWA Catmull-Rom: To give "pixel peepers" all the sharpness they crave. His context was downsampling, but still.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Message received: I was so certain that EWA Catmull-Rom would never amount to anything that I did not even bother to try it even though the code was right there.henrywho wrote:...
Hey, I thought I had made myself clear in some posts that I prefer EWA Lagrange over EWA Catrom for downsizing in place of unsharpening.
Actually, I was even more certain that EWA Lagrange had to be junk, so I did not record that I should consider it, despite yours (and Fred's) strong hints.
I thought I had shades on, but they were blinders.
-----
Plain unwindowed Jinc has to be given another look. They have been visited before I believe, but only in the context of enlarging. Reducing is a different ball o'wax.
When downsampling, the raison d'etre of windowing, namely reducing slope discontinuities, is not so important. Getting rid of the window function thus seems reasonable.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
@Henry: Thank you, very much, for the clarification. Sometimes I do things too quickly. For this reasons, messages that clearly dot the i's are a friend.henrywho wrote:...
Hey, I thought I had made myself clear in some posts that I prefer EWA Lagrange over EWA Catrom for downsizing in place of unsharpening.
- 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
Henry, in my quick tests, I did not see any significant difference. I would appreciate hearing from you what differences you saw and was this downsampling, upsampling or both. I presume these were very high quality or perhaps raw images that you processed, something with which I really have no experience.henrywho wrote:Hey, I thought I had made myself clear in some posts that I prefer EWA Lagrange over EWA Catrom for downsizing in place of unsharpening.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Here is an example of downsampling with sigmoidization, compared to downsampling through linear RGB (linear light being better at tonal faithfulness). It's the backpack image which Pictus (Luiz E. Vasconcellos) has used for tests earlier in this thread, and which Henry HO pointed us to.
Downsampled with EWA LanczosSharp through linear RGB:
Downsampled with EWA LanczosSharp sigmoidized with contrast = 6, pretty much the reasonable limit when downsampling:
The code:for the first, andfor the second.
To see clearly the differences, you should flicker between the two images. To see the difference in haloing, enlarge and follow sharp boundaries, for example where wood meets sky.
The sigmoidized version not only has decreased halos, but it also has slightly sharper and less jaggy thin features. Look at the zipper track.
But there is no question that sigmoidization affects tonal faithfulness in areas where pixels with midtones mixed in with more extreme values.
Downsampled with EWA LanczosSharp through linear RGB:
Downsampled with EWA LanczosSharp sigmoidized with contrast = 6, pretty much the reasonable limit when downsampling:
The code:
Code: Select all
magick BackPack.jpg -colorspace RGB -filter LanczosSharp -distort resize 1200x1200 -colorspace sRGB EWALanczosSharp.0.png
Code: Select all
magick BackPack.jpg -colorspace RGB +sigmoidal-contrast 6 -filter LanczosSharp -distort resize 1200x1200 -sigmoidal-contrast 6 -colorspace sRGB EWALanczosSharp.6.png
To see clearly the differences, you should flicker between the two images. To see the difference in haloing, enlarge and follow sharp boundaries, for example where wood meets sky.
The sigmoidized version not only has decreased halos, but it also has slightly sharper and less jaggy thin features. Look at the zipper track.
But there is no question that sigmoidization affects tonal faithfulness in areas where pixels with midtones mixed in with more extreme values.
Re: best downsampling method for DSLR photographs
Yup, there are fewer halos; unfortunately, it also reduces the reflection of the nylon fibre vastly. May we use a 2-lobe downsizer with lower sigmoidization value?
The backpack photo is a special use-case. EWA Catrom, "Cub-grange" (cubic @ c=0.4846), Lagrange and Lanczos2VerySharp (blur=0.88826421508540347), in decreasing order of acutance, are actually preserving the nylon texture better than "gently-sharp" schemes like GinSeng under such a big down-sampling operation.
The backpack photo is a special use-case. EWA Catrom, "Cub-grange" (cubic @ c=0.4846), Lagrange and Lanczos2VerySharp (blur=0.88826421508540347), in decreasing order of acutance, are actually preserving the nylon texture better than "gently-sharp" schemes like GinSeng under such a big down-sampling operation.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
@Henry: As usual, you bring some very interesting observations and ideas to the table.
Thank you.
P.S. You tried Ginseng (-resize with Jinc-windowed Sinc)?
Thank you.
P.S. You tried Ginseng (-resize with Jinc-windowed Sinc)?
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
I am starting to get the hint that sigmoidization is indeed a bad idea when downsampling if there are fine textures. It may only be a general recommendation when dealing with "synthetic" images (like line drawings).
This backpack test image is wonderful. Sigmoidization makes everything look at least as good EXCEPT on the backpack itself.
It looks like when there is actual, real, natural moire that one wants to preserve, sigmoidization messes it up.
Even the webbing straps are affected.
-----
When downsizing, linear light strikes again.
This backpack test image is wonderful. Sigmoidization makes everything look at least as good EXCEPT on the backpack itself.
It looks like when there is actual, real, natural moire that one wants to preserve, sigmoidization messes it up.
Even the webbing straps are affected.
-----
When downsizing, linear light strikes again.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Here is Ginseng through linear light (no sigmoidization):
Code:Yes, there is halo when one pixel-peeks. But the textures are nicely preserved.
Code:
Code: Select all
magick BackPack.jpg -colorspace RGB -define filter:window=Jinc -define filter:lobes=3 -resize 1200x1200 -colorspace sRGB Ginseng.0.png
Last edited by NicolasRobidoux on 2012-09-19T06:32:22-07:00, edited 2 times in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: best downsampling method for DSLR photographs
Isn't it funny? I spend all this time trying to minimize (artificial) moire, and then fall in love with a scheme that preserves (natural) moire.