Page 4 of 10
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T04:53:24-07:00
by NicolasRobidoux
henrywho wrote:Seems sigmoidal-downsizing increases the brightness of all interpolated areas.
I'll double check, but it may simply be because in an IM more than a few days old, sigmoidal contrast is not perfectly invertible, and consequently overall brightness is affected: my experiments revealed a bug (or undesirable feature) which was fixed by Cristy on Monday (I think).
I've not seen any "global" colour drift in any of my tests. Only subpixel stuff.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T04:58:44-07:00
by NicolasRobidoux
anthony wrote:...I think I'll remove the use of the integer support sized 3 lobe lancoz in these examples.
Or add it as a separate 'resize technique'.
I agree: Focus on regular orthogonal Lanczos, ideally used with an HDRI compile (to minimize clipping between orthogonal passes).
The reason is that "sigmoidization" appears to be so good at removing offensive Lanczos jaggies that there is no need to smooth them out with EWA. They are slightly reduced with Radius3, but it's not something that jumps at you. And orthogonal Lanczos is slightly sharper, so it's a toss. I'll go for sharp.
You can keep the Radius3 examples under "if combined with another experimental method..." but my experience is that at 8,50%, my current favorite setting, the only difference is that orthogonal Lanczos is very slightly sharper. So it makes sense to skip Radius3 from this example.
-----
I wish I had time to experiment a lot (or pass it through Adam's test software) but...
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:09:33-07:00
by NicolasRobidoux
Henry: You are enlarging the full size Nokia image 400%?
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:20:48-07:00
by NicolasRobidoux
Henry: I enlarged the small version of the image (..._m) 400% and I see no colour drift. I think you are using a version of IM with the sigmoidal-contrast "bug".
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:26:43-07:00
by henrywho
NicolasRobidoux wrote:Henry: I enlarged the small version of the image (..._m) 400% and I see no colour drift. I think you are using a version of IM with the sigmoidal-contrast "bug".
I copied the wrong commands and it's now corrected. I was doing downsizing of the original version and see if this sigmoidal technique is safe for downsizing. I will test it again with the latest IM6 Q16 version.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:30:30-07:00
by NicolasRobidoux
Henry: I think that you actually are right: It's not an overall brightness, it's that small (a few pixel wide, at most) bright colour areas are brightened.
Maybe 8,50% is too much, and we should push the contrast down to 6,50%?
Or indeed the sigmoidal should not have a midpoint at 50%, and something like 6,80% is right?
???
My earlier test images were pretty smooth. I think that's why I missed it. We're dealing with JPEG artifacts here.
Note: The above comments have to do with enlarging the smaller image (..._m) 400%.
-----
Thank you for trying downsampling. I have not yet, and it would not surprise me if it sucks.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:34:53-07:00
by NicolasRobidoux
Yes? To me, the sigmoidal rose's lower "lip" looks way less jaggy/overshot, and yet it is sharper.
But I suffer from selection bias...
anthony wrote:Essentually this decreases the contrast, spreading out mid-tone greys before resizing, then removes that modification afterward.
Exactly!
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T05:52:49-07:00
by NicolasRobidoux
NicolasRobidoux wrote:Henry: I think that you actually are right: It's not an overall brightness, it's that small (a few pixel wide, at most) bright colour areas are brightened.
This actually may be a side effect of negative lobes more than sigmoidal.
P.S. No it's not. The "sigmoization" process kinda "solarizes" the very bright spots. So, either I'm making it too strong, or the brights and darks need to be dealt with asymmetrically.
My guess is that 8,50% is too strong.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T06:12:52-07:00
by NicolasRobidoux
If you decrease the contrast, the ugly "black overshoots" come back. So, there is a zero sum game: "solarized" whites or "overshot" blacks?
(*&^%$#@! I need to buy a gadget that color calibrates monitors!)
I personally really really dislike the "black overshoots", so it looks like I'm kinda stuck at something like 7,50%.
P.S. I slooooowly downloaded
http://www.dcfever.com/phones/enlarge.php?id=7234 Turns out that the sigmoidal "solarization" of very bright details I was seeing when enlarging what I assume is a Hong Kong panorama was mostly happening in areas that are
overexposed in the full size original from which the image I was re-enlarging was obtained!!! Also, some of the garish fushias and pinkish reds ... are there in the full size image!
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T06:19:04-07:00
by NicolasRobidoux
Anthony: Suggestion: If you redo your discussion of this in the Examples, use 7,50%.
Also: I'm not sure what kind of screen you view your Examples site on, but it is my opinion that these enlargements are a bit on the small side to make differences clear.
Maybe you could show this?
Code: Select all
convert rose: -filter lanczos -resize 350x rose_lanczos_srgb.png
convert rose: -colorspace RGB -filter lanczos -resize 350x \
-colorspace sRGB rose_lanczos_linear.png
convert rose: -colorspace RGB +sigmoidal-contrast 7,50% \
-filter Lanczos -resize 350x \
-sigmoidal-contrast 7,50% -colorspace sRGB rose_lanczos_sigmoidal.png
To my eye, there is no question which one is best, even if the Mitchell results are included:
Code: Select all
convert rose: -resize 350x rose_mitchell_srgb.png
convert rose: -colorspace RGB -resize 350x -colorspace sRGB rose_mitchell_linear.png
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T08:03:21-07:00
by NicolasRobidoux
Using the very wishy washy criterion of minimizing the maximum difference between EWA Radius 3 and regular orthogonal Lanczos 3, but checking it using 16-bit results instead of 8-bit, indeed 7,50% is better than 6,50% and 8,50%.
Oddly enough, the "quantative" result matches my eyeball.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T09:41:34-07:00
by NicolasRobidoux
Anthony and Fred and Cristy: I very quickly checked the results using all combinations of the two different +contrast-sigmoidal and the two different -contrast-sigmoidal pieces of code (setting the two #ifdefs to all combinations of 0 and 1). My quick conclusion is that
Code: Select all
double
min = sigmoidal(contrast,1.0,0.0),
max = sigmoidal(contrast,QuantumScale*midpoint,1.0),
xi = min+(double)i/MaxMap*(max-min);
sigmoidal_map[i]=(MagickRealType) ScaleMapToQuantum(
(MagickRealType)(MaxMap*(
QuantumScale*midpoint-log((1-xi)/xi)/contrast) ));
is a broken +sigmoidal-contrast. On the other hand, either of the two -sigmoidal-contrast is fine: they give very close results.
I do prefer the -sigmoidal-contrast code that does not contain MagickEpsilon, in other words, I prefer the current IM bleeding edge. But if it made Fred happy to have something that behaves the way he expects when contrast=0 or close to it, I could live with the MagickEpsilon version of the -sigmoidal-contrast code.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T11:48:29-07:00
by NicolasRobidoux
Having checked things carefully, regular Lanczos 3 and EWA "Radius 3" are different when my current favorite sigmoidalization, namely 7,50%, is used (through linear light).
EWA is better at avoiding jaggies on diagonal lines, but otherwise regular Lanczos is slightly sharper "the right way". In other words, if it was not for the checkerboard mode, regular Lanczos 3 would win, no question.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T18:41:50-07:00
by NicolasRobidoux
@Henry: I checked downsampling with the Nokia picture and it looks like linear light wins, as usual.
Re: "Sigmoidal" minimization of resampling filter haloing
Posted: 2012-07-18T19:34:15-07:00
by henrywho
NicolasRobidoux wrote:@Henry: I checked downsampling with the Nokia picture and it looks like linear light wins, as usual.
To me, downsampling in linear RGB with sigmoidal minimization looks much like downsampling in sRGB plus cooked highlights. I think it is better suited for upsampling.