View Full Version : madVR - high quality video renderer (GPU assisted)
NicolasRobidoux
14th October 2012, 23:09
...
Normally B-Spline is a filter used for 1D resampling. So you feed in the x-distance in the first pass and the y-distance in the 2nd pass. Now that you're using B-Spline for EWA windowing, I was wondering whether you could use the very same B-Spline filter, but feed in the radial distance. I wasn't sure this would work because normally you don't feed a radial distance into B-Spline. But it seems it does work, when scaled properly. Well, I guess it makes sense. And why would it not work? I'll give this a try sooner or later...
Yes, you use the same function, stretched the same way, except you feed it the distance instead of x (in the first pass) or y (in the second pass). (And of course there is only one pass when you do things radially.)
Some people would go "WTF???" because the cubic B-spline comes from 1D considerations, but it turns out that Anthony Thyssen of ImageMagick and I discovered that Keys splines are "special" when used radially. (Some of the important properties are buried in the ImageMagick forums and are unpublished. I'd rather get code that uses my ideas than publish an article.) The cubic B-spline is the only Keys cubic which is really usable as a window function, because you really really don't want negative values. And indeed it is, in the tensor world, under the name "Parzen".
All I'm doing is saying that you can use it as a radial window function as well (substituting it for the first lobe of the Jinc function).
-----
All clear now? Basically, you already have all the code you need.
-----
I don't know if "EWA Parzen-windowed Jinc 4-lobe with extent normalized to a disc of radius 4" is an all around great scheme, because I only tried it on that "robot" image.
But when I saw the haloing etc, I went "I think that I know how to fix this".
Now: Is it good when used with slightly blurry natural images? Only testing will tell. (And I'm a bit short on time these days.)
NicolasRobidoux
14th October 2012, 23:15
...
Ah, I understand. Apart from the x/2 stretching it's the same filter used in tensor resampling, though, correct?Exactly.
P.S. The reason for the x/2 is that the extent of the cubic B-spline is from (-2,2), and we need a window for something that is "Radius 4".
It's the usual "match the extents" business.
NicolasRobidoux
15th October 2012, 01:14
Mathias:
I figured you knew most or all of this, but sometimes "re-iterating" is better than "leaving a gap".
Motenai Yoda
15th October 2012, 05:19
I am suffering a problem about the change in frequency of the screen when going to full screen with mpc-hc.
With evr works right, with madvr it freeze, audio sounds, but screen remains blank.
madshi
15th October 2012, 07:10
Yes, you use the same function, stretched the same way, except you feed it the distance instead of x (in the first pass) or y (in the second pass). (And of course there is only one pass when you do things radially.)
Some people would go "WTF???" because the cubic B-spline comes from 1D considerations, but it turns out that Anthony Thyssen of ImageMagick and I discovered that Keys splines are "special" when used radially. (Some of the important properties are buried in the ImageMagick forums and are unpublished. I'd rather get code that uses my ideas than publish an article.) The cubic B-spline is the only Keys cubic which is really usable as a window function, because you really really don't want negative values. And indeed it is, in the tensor world, under the name "Parzen".
All I'm doing is saying that you can use it as a radial window function as well (substituting it for the first lobe of the Jinc function).
-----
All clear now? Basically, you already have all the code you need.
-----
I don't know if "EWA Parzen-windowed Jinc 4-lobe with extent normalized to a disc of radius 4" is an all around great scheme, because I only tried it on that "robot" image.
But when I saw the haloing etc, I went "I think that I know how to fix this".
Now: Is it good when used with slightly blurry natural images? Only testing will tell. (And I'm a bit short on time these days.)
Exactly.
P.S. The reason for the x/2 is that the extent of the cubic B-spline is from (-2,2), and we need a window for something that is "Radius 4".
It's the usual "match the extents" business.
Thank you very much. I'll definitely give this B-Spline/Jinc combination a try.
madshi
15th October 2012, 07:15
I am suffering a problem about the change in frequency of the screen when going to full screen with mpc-hc.
With evr works right, with madvr it freeze, audio sounds, but screen remains blank.
Does this also happen with the latest madVR v0.84.3 build? Are you using the MPC-HC refresh rate switcher? Try using the madVR built in display mode switcher instead.
madshi
15th October 2012, 08:37
If I use the ImageMagick -define filter:verbose=1 option to "spy" into the filtering, I get this:convert small.png -define filter:verbose=1 -define filter:filter=Jinc -define filter:lobes=4 -define filter:window=Spline -define filter:blur=.9431597994328477 -distort Resize 700% EWASplineJincRadius4.png
# Resize Filter (for graphing)
#
# filter = Jinc
# window = Cubic
# support = 4.24106
# window-support = 4.24106
# scale-blur = 0.94316
# practical-support = 4
# B,C = 1,0
0.00 1.0472
0.01 1.04701
0.02 1.04646
0.03 1.04554
0.04 1.04425
0.05 1.0426
0.06 1.04059
0.07 1.03822
0.08 1.03549
0.09 1.0324
0.10 1.02897
0.11 1.02518
0.12 1.02105
0.13 1.01657
0.14 1.01176
0.15 1.00662
0.16 1.00114
0.17 0.995345
0.18 0.989228
0.19 0.982798
0.20 0.976058
0.21 0.969016
0.22 0.961677
0.23 0.954048
0.24 0.946133
0.25 0.93794
0.26 0.929475
0.27 0.920745
0.28 0.911757
0.29 0.902518
0.30 0.893036
0.31 0.883317
0.32 0.87337
0.33 0.863201
0.34 0.852819
0.35 0.842232
0.36 0.831447
0.37 0.820472
0.38 0.809317
0.39 0.797988
0.40 0.786495
0.41 0.774845
0.42 0.763047
0.43 0.75111
0.44 0.739042
0.45 0.726852
0.46 0.714548
0.47 0.702138
0.48 0.689632
0.49 0.677038
0.50 0.664364
0.51 0.65162
0.52 0.638813
0.53 0.625952
0.54 0.613045
0.55 0.600101
0.56 0.587129
0.57 0.574136
0.58 0.56113
0.59 0.548121
0.60 0.535115
0.61 0.522121
0.62 0.509147
0.63 0.496201
0.64 0.483289
0.65 0.47042
0.66 0.457601
0.67 0.444839
0.68 0.432141
0.69 0.419515
0.70 0.406967
0.71 0.394505
0.72 0.382133
0.73 0.36986
0.74 0.35769
0.75 0.345631
0.76 0.333688
0.77 0.321867
0.78 0.310173
0.79 0.298612
0.80 0.287189
0.81 0.275909
0.82 0.264777
0.83 0.253797
0.84 0.242973
0.85 0.232311
0.86 0.221814
0.87 0.211485
0.88 0.201329
0.89 0.191349
0.90 0.181548
0.91 0.17193
0.92 0.162496
0.93 0.15325
0.94 0.144195
0.95 0.135331
0.96 0.126662
0.97 0.118189
0.98 0.109914
0.99 0.101838
1.00 0.093963
1.01 0.0862892
1.02 0.0788179
1.03 0.0715497
1.04 0.064485
1.05 0.0576241
1.06 0.0509672
1.07 0.0445141
1.08 0.0382647
1.09 0.0322184
1.10 0.0263747
1.11 0.0207329
1.12 0.015292
1.13 0.0100509
1.14 0.00500834
1.15 0.000163021
1.16 -0.00448675
1.17 -0.00894254
1.18 -0.0132062
1.19 -0.0172799
1.20 -0.0211654
1.21 -0.0248651
1.22 -0.0283815
1.23 -0.0317169
1.24 -0.034874
1.25 -0.0378553
1.26 -0.0406637
1.27 -0.0433022
1.28 -0.0457738
1.29 -0.0480813
1.30 -0.0502282
1.31 -0.0522175
1.32 -0.0540527
1.33 -0.0557372
1.34 -0.0572742
1.35 -0.0586675
1.36 -0.0599205
1.37 -0.0610369
1.38 -0.0620204
1.39 -0.0628745
1.40 -0.0636032
1.41 -0.06421
1.42 -0.0646989
1.43 -0.0650737
1.44 -0.0653381
1.45 -0.0654959
1.46 -0.0655512
1.47 -0.0655075
1.48 -0.065369
1.49 -0.0651393
1.50 -0.0648222
1.51 -0.0644217
1.52 -0.0639414
1.53 -0.0633851
1.54 -0.0627566
1.55 -0.0620595
1.56 -0.0612976
1.57 -0.0604744
1.58 -0.0595936
1.59 -0.0586587
1.60 -0.0576731
1.61 -0.0566404
1.62 -0.0555638
1.63 -0.0544468
1.64 -0.0532926
1.65 -0.0521043
1.66 -0.0508854
1.67 -0.0496384
1.68 -0.0483668
1.69 -0.0470733
1.70 -0.0457607
1.71 -0.044432
1.72 -0.0430897
1.73 -0.0417366
1.74 -0.040375
1.75 -0.0390076
1.76 -0.0376367
1.77 -0.0362645
1.78 -0.0348934
1.79 -0.0335253
1.80 -0.0321625
1.81 -0.0308069
1.82 -0.0294602
1.83 -0.0281242
1.84 -0.0268009
1.85 -0.0254917
1.86 -0.0241979
1.87 -0.0229214
1.88 -0.0216633
1.89 -0.0204249
1.90 -0.0192074
1.91 -0.018012
1.92 -0.0168396
1.93 -0.0156912
1.94 -0.0145677
1.95 -0.0134699
1.96 -0.0123984
1.97 -0.011354
1.98 -0.0103372
1.99 -0.00934828
2.00 -0.00838814
2.01 -0.00745659
2.02 -0.00655429
2.03 -0.00568133
2.04 -0.00483784
2.05 -0.00402394
2.06 -0.00323964
2.07 -0.00248501
2.08 -0.00175991
2.09 -0.00106439
2.10 -0.000398309
2.11 0.000238611
2.12 0.000846515
2.13 0.00142575
2.14 0.00197648
2.15 0.00249902
2.16 0.00299377
2.17 0.003461
2.18 0.00390145
2.19 0.00431509
2.20 0.00470278
2.21 0.00506479
2.22 0.00540162
2.23 0.00571386
2.24 0.00600208
2.25 0.00626698
2.26 0.00650877
2.27 0.00672836
2.28 0.0069262
2.29 0.00710303
2.30 0.00725933
2.31 0.00739585
2.32 0.00751322
2.33 0.00761204
2.34 0.00769305
2.35 0.00775688
2.36 0.00780397
2.37 0.00783547
2.38 0.00785152
2.39 0.00785306
2.40 0.00784068
2.41 0.00781506
2.42 0.00777683
2.43 0.00772663
2.44 0.00766511
2.45 0.00759289
2.46 0.00751058
2.47 0.00741883
2.48 0.00731821
2.49 0.00720935
2.50 0.00709278
2.51 0.00696912
2.52 0.0068389
2.53 0.00670271
2.54 0.00656106
2.55 0.00641448
2.56 0.00626344
2.57 0.0061085
2.58 0.00595007
2.59 0.00578869
2.60 0.00562475
2.61 0.00545873
2.62 0.00529103
2.63 0.00512206
2.64 0.0049522
2.65 0.00478184
2.66 0.00461131
2.67 0.00444097
2.68 0.00427118
2.69 0.0041022
2.70 0.00393435
2.71 0.0037679
2.72 0.00360313
2.73 0.00344026
2.74 0.00327957
2.75 0.00312123
2.76 0.00296548
2.77 0.00281249
2.78 0.00266243
2.79 0.00251546
2.80 0.00237176
2.81 0.00223144
2.82 0.00209459
2.83 0.00196137
2.84 0.00183185
2.85 0.00170611
2.86 0.00158422
2.87 0.00146625
2.88 0.00135223
2.89 0.00124221
2.90 0.00113622
2.91 0.00103426
2.92 0.000936347
2.93 0.000842474
2.94 0.000752636
2.95 0.000666805
2.96 0.000584958
2.97 0.000507055
2.98 0.000433064
2.99 0.000362925
3.00 0.000296587
3.01 0.000233983
3.02 0.000175052
3.03 0.00011972
3.04 6.79069e-05
3.05 1.95334e-05
3.06 -2.5486e-05
3.07 -6.7241e-05
3.08 -0.000105827
3.09 -0.000141332
3.10 -0.000173861
3.11 -0.000203509
3.12 -0.000230387
3.13 -0.00025458
3.14 -0.000276216
3.15 -0.00029538
3.16 -0.000312196
3.17 -0.000326749
3.18 -0.00033917
3.19 -0.000349544
3.20 -0.000357989
3.21 -0.000364599
3.22 -0.000369494
3.23 -0.000372758
3.24 -0.000374508
3.25 -0.000374839
3.26 -0.000373844
3.27 -0.000371624
3.28 -0.000368268
3.29 -0.000363867
3.30 -0.000358517
3.31 -0.000352298
3.32 -0.000345301
3.33 -0.000337607
3.34 -0.000329289
3.35 -0.000320409
3.36 -0.000311066
3.37 -0.000301317
3.38 -0.000291229
3.39 -0.000280864
3.40 -0.000270291
3.41 -0.000259545
3.42 -0.000248694
3.43 -0.000237803
3.44 -0.0002269
3.45 -0.000216013
3.46 -0.000205228
3.47 -0.000194554
3.48 -0.000184026
3.49 -0.000173676
3.50 -0.000163535
3.51 -0.000153635
3.52 -0.000144008
3.53 -0.000134645
3.54 -0.000125595
3.55 -0.000116858
3.56 -0.000108441
3.57 -0.000100368
3.58 -9.26422e-05
3.59 -8.52692e-05
3.60 -7.82537e-05
3.61 -7.1605e-05
3.62 -6.53032e-05
3.63 -5.9361e-05
3.64 -5.37823e-05
3.65 -4.8556e-05
3.66 -4.36636e-05
3.67 -3.91173e-05
3.68 -3.48964e-05
3.69 -3.09978e-05
3.70 -2.74054e-05
3.71 -2.41083e-05
3.72 -2.1095e-05
3.73 -1.83746e-05
3.74 -1.58858e-05
3.75 -1.36731e-05
3.76 -1.16617e-05
3.77 -9.89684e-06
3.78 -8.31668e-06
3.79 -6.94366e-06
3.80 -5.72873e-06
3.81 -4.68372e-06
3.82 -3.77891e-06
3.83 -3.01256e-06
3.84 -2.37097e-06
3.85 -1.83769e-06
3.86 -1.39463e-06
3.87 -1.04208e-06
3.88 -7.5514e-07
3.89 -5.36571e-07
3.90 -3.62735e-07
3.91 -2.38204e-07
3.92 -1.46614e-07
3.93 -8.73773e-08
3.94 -4.61199e-08
3.95 -2.28118e-08
3.96 -9.10535e-09
3.97 -2.47706e-09
3.98 -1.23499e-09
3.99 -0
4.00 0
I've tried your Cubic/Jinc combination, and I get the same values as you posted above. But I'm still getting ringing here, while you seemingly don't. I don't understand that. How can your image contain no ringing? Your ImageMagick spy result clearly shows that your filter also contains a negative lobe. See distance 1.16..2.09. So how can your filter not ring, despite having a negative lobe? That makes no sense to me!
madshi
15th October 2012, 08:59
OK: Maybe I'll learn to love 4-lobe windowed Jinc methods, at least when using the "Radius = number of lobes" deblur. Here is the result of enlarging 7x with no colorspace or sigmoidization shenanigans with EWA Spline (meaning cubic B-spline windowing; this is the old ImageMagick "Cubic" filter and window) windowed Jinc 4 lobe with deblur set so that the radius is 4:
http://web.cs.laurentian.ca/nrobidoux/misc/madVR/robot/EWASplineJincRadius4.png
I'm not saying this scheme is the be all and end all. But the fact that it is the very first "Radius 4" EWA windowed-Jinc I tried with the level of understanding I now have about these things should tell you something.
(Of course, it does not have the "antialiasing EWA LanczosSharp is famous for": This is a fairly sharp low halo variant.)
I've double checked. The image you linked to does not match what I get when using "convert small.png -define filter:verbose=1 -define filter:filter=Jinc -define filter:lobes=4 -define filter:window=Spline -define filter:blur=.9431597994328477 -distort Resize 700% EWASplineJincRadius4.png". With this "convert" command I get less aliasing and more ringing compared to the image you uploaded. I'm confused...
(Using ImageMagick 6.8.0.0 2012-10-11 Q16 Windows)
crotecun
15th October 2012, 09:17
When SoftCubic is set to 100 and you activate anti-ringing it makes SoftCubic go to 50 automatically. (For the first time, after you set it back to 100 you can activate it but I guess that's meant to show there's no point in doing so?)
I can't seem to be able to reproduce this problem. Can you write an exact step-by-step description on how to reproduce this bug?
I also have this bug! :D Here's how to reproduce it:
- reset madVR to default using the restore default settings script
- go to the chroma upscaling settings, which would be set to SoftCubic 100. Upon checking the activate anti-ringing filter option, the softness for SoftCubic automatically goes down from 100 to 50.
You can still manually set SoftCubic to 100 with anti-ringing if you like, and checking/unchecking the box after applying the changes would not set it back to 50. This only happens right after restoring the settings to default.
By the way a similar bug happens when changing the settings for the first time on image upscaling and image downscaling for Lanczos. When you enable anti-ringing or scale in linear light it would automatically reduce the number of taps from 4 to 3.
romulous
15th October 2012, 09:36
Hi madshi,
This is something bLight asked me to post here, in case it is a bug in the renderer (we aren't sure). Using Zoom Player, if you open a video file, fullscreen Zoom, then move to the next video file in the folder while madVR is in exclusive mode, before the next video begins to play, you see a flash of the first frame of the first video you opened. This only happens the first time you move to the next video file each time you have the player open. If you move to the next video file after the second video file without closing the player, you won't see that first frame of the previous video.
The easiest reproduction steps that I can describe are:
1. Open Zoom in windowed mode, not fullscreen (version of Zoom should not matter, but I happened to be using 8.5 RC1).
2. Make sure you have at least two files in the test folder. The first file should not have a black screen as the first frame, otherwise you will be unlikely to notice the effect. I find 'Ducks Take Off' to be a good test file for this:
http://xhmikosr.1f0.de/samples/2160p/DucksTakeOff/
3. Open the first file in Zoom. Zoom will still be in windowed mode at this point in time.
4. Hit Alt+Enter to fullscreen Zoom.
5. Wait until madVR shows the 'Exclusive' OSD text.
6. Move to the next file in the folder, e.g. by using the ] key.
7. If you watch carefully, you should see the first frame of the first video file show briefly again before the second video file starts to play.
8. You will only see this on the first video change. If you then move from the second file to a third file in the folder, you will not see it. If you close Zoom though and repeat the test, you will see it on the first video change again.
It isn't caused by a particular system configuration - it happens on my system, bLight can reproduce it on his system, as can another Zoom user. If it happened with every file change, I'd be tempted to write it off as an unfortunate side-effect of exclusive mode, but seeing as how it only happens on the first video change, we are wondering if it is a madVR bug. It would be appreciated if you could take a quick look at this at some point.
Thanks!
ryrynz
15th October 2012, 10:03
I was going to mention this also, I get the previous frame flash in FSE mode (like what used to happen with windowed mode) on next file playback, thought I'd hold off mentioning it a being a minor cosmetic bug and all.
cyberbeing
15th October 2012, 10:05
The same thing has always happened when using madVR FSE in MPC-HC as well, so I wouldn't think it would be a Zoom Player bug. More specifically, what flashes on screen is the first frame displayed the last time you entered FSE, not necessarily the first frame of the video. It's been an issue since madshi first introduced FSE mode a long time ago, if memory serves me right.
Somewhere in this thread this issue has been mentioned before. I think madshi just accepted it as FSE quirk which he hasn't been able to fix.
ryrynz
15th October 2012, 10:38
Yup that's right, I was going to mention that but I hate editing posts unnecessarily. Since he fixed the windowed mode one I thought it might be worth mentioning the FSE one too (I've been using FSE mode recently) but looks like I was beaten to it, would be nice to see that fixed up at some point.
TheShadowRunner
15th October 2012, 12:34
About the first-frame-flashing issue you guys are having, does it occur also with FSE "old path"?
Please try: at "rendering" > "exclusive mode settings" > uncheck "present several frames in advance".
NicolasRobidoux
15th October 2012, 12:40
The image you linked to does not match...I'll double check. Sorry if I confused you and/or myself and unwittingly sent you down another dead end.
(Waking kids up: school day.)
NicolasRobidoux
15th October 2012, 12:46
Mathias: I just copy-pasted the command you have in your "???" email into a terminal, and I get an identical image to the one I had before (without much ringing).
I'm going to have to see what's up. This will involve triple checking on my various installs.Version: ImageMagick 6.8.0-0 2012-10-09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP HDRI
P.S. Argh! You're right. I named images wrong when I copied things to my server.
Apologies.
Now: Which method I tried gives the "low ringing" one?
madshi
15th October 2012, 12:51
No worries, mate. Yeah, how did you get the low-ringing one? :)
NicolasRobidoux
15th October 2012, 13:01
It's a mystery.
None of the images in my "testing folder" matches!!!
-----
School bus...
madshi
15th October 2012, 13:02
Maybe EWA Mitchell, if there is such a thing?
NicolasRobidoux
15th October 2012, 13:18
Maybe EWA Mitchell, if there is such a thing?
My first guess was the closely related EWA Robidoux. Or tensor Mitchell.
Will look in 30 minutes.
madshi
15th October 2012, 13:31
I also have this bug! :D Here's how to reproduce it
Thanks! Should be easy enough to fix, now that I know how to reproduce it.
This is something bLight asked me to post here, in case it is a bug in the renderer (we aren't sure). Using Zoom Player, if you open a video file, fullscreen Zoom, then move to the next video file in the folder while madVR is in exclusive mode, before the next video begins to play, you see a flash of the first frame of the first video you opened. This only happens the first time you move to the next video file each time you have the player open. If you move to the next video file after the second video file without closing the player, you won't see that first frame of the previous video.
The easiest reproduction steps that I can describe are:
1. Open Zoom in windowed mode, not fullscreen (version of Zoom should not matter, but I happened to be using 8.5 RC1).
2. Make sure you have at least two files in the test folder. The first file should not have a black screen as the first frame, otherwise you will be unlikely to notice the effect. I find 'Ducks Take Off' to be a good test file for this:
http://xhmikosr.1f0.de/samples/2160p/DucksTakeOff/
3. Open the first file in Zoom. Zoom will still be in windowed mode at this point in time.
4. Hit Alt+Enter to fullscreen Zoom.
5. Wait until madVR shows the 'Exclusive' OSD text.
6. Move to the next file in the folder, e.g. by using the ] key.
7. If you watch carefully, you should see the first frame of the first video file show briefly again before the second video file starts to play.
8. You will only see this on the first video change. If you then move from the second file to a third file in the folder, you will not see it. If you close Zoom though and repeat the test, you will see it on the first video change again.
It isn't caused by a particular system configuration - it happens on my system, bLight can reproduce it on his system, as can another Zoom user. If it happened with every file change, I'd be tempted to write it off as an unfortunate side-effect of exclusive mode, but seeing as how it only happens on the first video change, we are wondering if it is a madVR bug. It would be appreciated if you could take a quick look at this at some point.
Thanks for the report. I can try looking at this again, but as the others have already mentioned, this problem has been there for a long time and I doubt there's anything I can do about it. It's definitely not ZoomPlayer related, so you can tell Blight that he needn't worry about it.
Or tensor Mitchell.
Yes, looks quite similar to simple tensor Mitchell.
romulous
15th October 2012, 13:51
About the first-frame-flashing issue you guys are having, does it occur also with FSE "old path"?
Please try: at "rendering" > "exclusive mode settings" > uncheck "present several frames in advance".
I don't know about the others, but when I disable that option, it seems to stop that extra frame from being shown. In place of that however, I *think* it may mean the black screen between videos is slightly longer.
By that I mean that with the option enabled or disabled, there is a black screen between videos as you move through a folder (between when one video ends and the next video begins) - but the black screen seems to be displayed slightly longer with the option disabled.
That's very unscientific though - its hard to measure accurately with a stopwatch, and I might be totally wrong. It may in fact be exactly the same length of time, regardless of whether that option is enabled or disabled.
It's definitely not ZoomPlayer related, so you can tell Blight that he needn't worry about it.
Great, thanks! I will let him know.
NicolasRobidoux
15th October 2012, 14:02
It's pretty far from tensor Mitchell (numerically measured), but pretty close to EWA Robidoux (max error 7) and EWA Spline-windowed Jinc Radius 3 (max error 8) but I still don't know where this image comes from.
NicolasRobidoux
15th October 2012, 14:26
I still can't reproduce the image, but I'm getting closer: My install of ImageMagick 7 gives different results than my install of ImageMagick 6, and does not seem to give "correct" results.
And I vaguely remember that I produced the new image with the new "magick" command instead of the "convert" one.
What did "magick" do "wrong" which gave less ringing? (Possibly because I did not do ldconfig correctly, or at least early enough.)
madshi
15th October 2012, 14:50
You're right, it's not tensor Mitchell. It has less aliasing, but more ringing than tensor Mitchell.
NicolasRobidoux
15th October 2012, 15:23
OK:
Now I'm pretty sure I know what happened:
Bleeding edge ImageMagick 7 appears to have a broken -define system, so it silently substituted HDRI EWA Robidoux (the default -distort Resize filter) or some strange but slight variant of it. Or something like that.
So, basically, what you got is the result of something essentially identical to
convert small.png -distort Resize 700% output.png
which is equivalent to
convert -filter Robidoux -distort Resize 700% output.png
Robidoux is a Keys cubic, so the scheme above is automatically "Radius 2".
-----
Having reinstalled from svn, things are apparently broken slightly differently than they were yesterday, so I still can't reproduce the exact same image.
BUT I can tell you that: The result with EWA Robidoux (and EWA cubic B-spline windowed Jinc Radius 3, which is a 3 lobe method, hence more expensive) is pretty much visually identical.
Basically, you liked the look of the default -distort Resize method, named after yours truly.
P.S. I initially protested the choice of Robidoux being the default, because I like EWA LanczosSharp a lot more. But I'm not the one who decided. And it turns out that a panel of web designers chose it FOR DOWSAMPLING OFTEN POOR QUALITY JPEG DIGITAL PHOTOGRAPHS USING sRGB PIXEL VALUES DIRECTLY over EWA LanczosSharp (by a nose) without knowing it was associated with me (they added the default -distort Resize to a list of methods to try that I had suggested and that did not include it, and that default is Robidoux). Also, EWA Robidoux does very well in one of the quantitative tests done by my grad student Adam Turcotte to be published, hopefully, before New Year. So, I protest less loudly now.
P.S. Filed a bug report with ImageMagick: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22072
madshi
15th October 2012, 15:42
Well, I liked the lack of ringing, on this computer type test pattern, reportedly coming from an algorithm involving Jinc. Haven't tested this algorithm myself with any images yet, nor really compared it to any other algorithms yet. So I don't really know how good it is. My "liking" just came from seeing the lack of ringing. I truely hate ringing. FWIW, the latest version of my AR algorithm handles this computer type stuff better now, so no ringing, nice anti-aliasing, but some new minor artifacts. Still working on it...
I wonder which algorithm those web designers would have chosen if ImageMagick had a good AR filter... :)
aufkrawall
15th October 2012, 16:03
Little suggestion: I think a checkbox to disable fps detection by filename for display modes would be nice since they tend to be incorrect or not precise enough. :)
NicolasRobidoux
15th October 2012, 16:09
Well:
You don't have to work hard to try EWA Robidoux with ImageMagick:
convert {input} -distort Resize {size specification} {output}
----
Should be trivial to implement in madVR: Robidoux is a keys cubic
defined by
Keys alpha = BC-spline C = 113/(58+216*sqrt(2)).
You use it "straight" to produce a LUT with radius 2. No windowing, no
whatever. Straight up.
Really really cheap.
----
If somebody were to ask me ;) what would be a reasonably easy to
implement approach for dealing with images that have slightly blurry
natural scenes but also sharp text or text-like stuff, I'd say this:
Choose a good scheme for natural images.
Choose a good scheme for "text-like stuff".
Independently resize with both.
Now, at every output pixel, have a measure, between 0 (text) and 1
(natural) that estimates whether "what's happening around there" is
text (kill ripples) or natural images (enjoy the antialiasing).
This measure should be reasonably smooth (for example, it could be
obtained, when enlarging, by interpolating, with bilinear even,
diagnostics performed at every input pixel location, or at every
"center" of the square that has input pixel locations as corners).
The final result is obtained by blending, on a pixel by pixel basis
(so, it's a lerp, basically as if you are varying transparency, to
blend the "natural" result with the "text-like" result), the two
results.
NicolasRobidoux
15th October 2012, 17:10
After all this, here are the two schemes I could put together that looked most like the robot image you liked (which I mistakenly described as the result of enlarging with cubic B-spline windowed Jinc Radius 4, with 4 lobes).
The first one is EWA Robidoux: http://web.cs.laurentian.ca/nrobidoux/misc/madVR/robot/EWARobidoux.png which is obtained withconvert small.png -distort Resize 700% EWARobidoux.png
The second is EWA cubic B-spline windowed Jinc Radius 3, with 3 lobes: http://web.cs.laurentian.ca/nrobidoux/misc/madVR/robot/EWASplineJincRadius3.png which is obtained withconvert small.png -define filter:window=Spline -define filter:blur=.9264075766146068 -distort Resize 700% EWASplineJincRadius3.png
EWA Robidoux is much cheaper because, when enlarging, it only uses 4 scanlines to produce one. EWASplineJincRadius3, being a Radius 3 method, requires 6.
P.S. EWA Spline Jinc Radius 3 is noticeably sharper, and has a minuscule amount or additional halo, than EWA Robidoux (on this test image).
IMHO, the additional sharpness is worth the halo.
strumf666
15th October 2012, 18:36
Is it normal for madvr auto resolution matching to switch to 23,98Hz for 25p sources instead for 50Hz (my projector doesn't support 25p)? If it is, is there a way to bypass/force it?
3 questions:
(1) What is the list of display modes you entered into the madVR display mode switcher?
(2) What does the madVR debug OSD (Ctrl+J) say about the "movie fps (says source filter)"?
(3) What is the exact file name of the movie you want to play?
(1) 1080p23, 1080p24, 1080p50, 1080p60
(2) 25fps - says source filter
(3) avshd-expendables1080p.mkv
It's the expendables 2 1080p rip, russian source. It's dropping approx. 1 frame per second if refresh is set to 23,98Hz but plays smoothly when I set it to 50Hz.
It's does happen with other 25p sources too, but I rarely stumble upon them.
Added missing info.
Log (http://www.filehosting.org/file/details/384794/madVR_-_log.rar)
Thanks :)
NicolasRobidoux
15th October 2012, 19:04
Mathias:
There are actually a couple of other EWA schemes that have this "look", except that they are less jaggy and have a little more halo: They are the "classic" (built-in) and "new" versions of the EWA Lanczos2Sharp schemes, which are deblurred EWA Jinc-windowed Jinc 2-lobe methods.
The "new" version is obtained with this code:convert small.png -filter Lanczos2 -define filter:blur=.9580278036312191 -distort Resize 700% EWALanczos2SharpNew.png
In terms of cost, they sit between EWA Robidoux and the EWA Radius 3 schemes: You need 5 scanlines to compute 1.
The result: http://web.cs.laurentian.ca/nrobidoux/misc/madVR/robot/EWALanczos2SharpNew.png
(http://web.cs.laurentian.ca/nrobidoux/misc/madVR/robot/EWALanczos2SharpNew.png)
NicolasRobidoux
15th October 2012, 19:15
...
I wonder which algorithm those web designers would have chosen if ImageMagick had a good AR filter... :)Indeed. I also wonder what they would have chosen if I had thought of telling them to downsample through linear light.
NicolasRobidoux
15th October 2012, 19:17
Really really cheap.Probably cheap enough to get rid of the LUT, esp. if you use the low flop formulations of Keys cubic splines I figured out.
madshi
15th October 2012, 19:18
Little suggestion: I think a checkbox to disable fps detection by filename for display modes would be nice since they tend to be incorrect or not precise enough. :)
I hate making the settings dialog more complicated than necessary. :( I'll think about it.
If somebody were to ask me ;) what would be a reasonably easy to implement approach for dealing with images that have slightly blurry natural scenes but also sharp text or text-like stuff, I'd say this:
Choose a good scheme for natural images.
Choose a good scheme for "text-like stuff".
Independently resize with both.
Now, at every output pixel, have a measure, between 0 (text) and 1 (natural) that estimates whether "what's happening around there" is text (kill ripples) or natural images (enjoy the antialiasing).
I already have built in such a detection (although a very cheap one) into the AR filter yesterday. Needs some improvement, though.
I'll try EWA Robidoux later. I'm not sure I'll use it, though, since straight Jinc with AR looks better to my eyes, now with the modified AR filter.
Log (http://www.filehosting.org/file/details/384794/madVR_-_log.rar)
Thanks :)
You told me you were using "1080p23, 1080p24, 1080p50, 1080p60". Which was not true. You are actually using "1080p23, 1080p24, 1080p25, 1080p30, 1080p50, 1080p60". madVR consequently selects 1080p25 for 25Hz content, but unfortunately your GPU reports "bad mode" when trying to switch to 1080p25. You should only enter valid display modes into the madVR display switching field.
madshi
15th October 2012, 19:23
@Nicolas, in case you're interested, here's what Jinc AR gives me now (400% upscale):
Jinc AR (http://madshi.net/pc-jinc-ar.png)
Can you spot the artifacts I still need to work on? :)
NicolasRobidoux
15th October 2012, 19:29
The fact that I have to scrutinize tells it all:
You've done wonders. And you don't really need low halo methods, because you're doing well at killing them. (Provided some other artifacts don't pop up with other kinds of images.)
NicolasRobidoux
15th October 2012, 19:32
Comment: Don't lose sight of the fact that (I would guess) you never have to enlarge by a very large ratio. The minuscule "gremlins" should be invisible, I would guess, in almost all viewing conditions.
madshi
15th October 2012, 19:33
The fact that I have to scrutinize tells it all:
You've done wonders. And you don't really need low halo methods, because you're doing well at killing them. (Provided some other artifacts don't pop up with other kinds of images.)
Thanks... :) I'm still waiting for more test pictures from 6233638 and cyberbeing, though. Optimizing the AR algorithm for just one image is easy. Optimizing it to work well for all sorts of difficult situations is the hard thing.
Comment: Don't lose sight of the fact that (I would guess) you never have to enlarge by a very large ratio. The minuscule "gremlins" should be invisible, I would guess, in almost all viewing conditions.
Very true. Sometimes I have to really fight with the urge to achieve perfection. It's often not healthy.
NicolasRobidoux
15th October 2012, 19:35
Would it break everything to add some median filtering based on a 2 by 2 cross (or plus sign) pattern at the end of the toolchain?
Or post-filter with something like
0 a 0
a 1-4a a
0 a 0
with a close to zero (no more than 1/8, for sure)?
madshi
15th October 2012, 19:37
I'm not sure. I might experiment with post processing like that. My biggest worry is that fixing these artifacts might harm in other situations.
madshi
15th October 2012, 19:41
Here's a different image which makes the artifacts more visible:
Jinc AR (http://madshi.net/small2-jinc-ar.png)
The bigger the zoom factor, the bigger the artifacts. So a simple 2 by 2 cross wouldn't work for really large zoom factors. But then, as you say, in real life such big zoom factors are unlikely to be used.
NicolasRobidoux
15th October 2012, 19:43
These gremlins would drive me nuts. (Even though nobody will notice and things really look great.)
I'm glad it's your scheme!
I hope a little bit of post-filtering will chase them away without too much blur.
P.S. I wrote this before your latest post.
When you enlarge enough, these gremlins get fat, ouch!
NicolasRobidoux
15th October 2012, 19:51
What makes the gremlins stand out is that they have a "bright" boundary.
"Cross" filtering may actually help more than you think???
madshi
15th October 2012, 19:52
Yes, they're fat and ugly. I'm considering doing some more pre-processing to avoid producing those gremlins in the first place. That should be easier than trying to remove them afterwards.
madshi
15th October 2012, 19:53
Ok, maybe I should give cross filtering a try, at least when the zoom factor is bigger than 2x. With zoom factors smaller than 2x the problem doesn't seem to occur.
NicolasRobidoux
15th October 2012, 19:55
Hopefully, I'm not wasting your time (again).
But you could increase a as you enlarge more.
The true maximum reasonable a is 1/5.
NicolasRobidoux
15th October 2012, 20:02
Actually, just use variable radius Gaussian blur. Set the radius based on the enlargement ratio.
Hopefully, you can balance gremlins and ... blur.
P.S. You're right, the gremlins get too big for crosses. You need the big gun. Vade retro won't do.
NicolasRobidoux
15th October 2012, 20:11
On your variant of the "glyphs" image, Gaussian blur with radius 6 in nip2 (I think it uses the same convention as GIMP between the radius and sigma) erases the gremlins without making things unbearable.
NicolasRobidoux
15th October 2012, 20:34
Mathias:
Having double checked, it would appear to me that having a final Gaussian blur step with a radius dependent on the enlargement ratio may be the ticket. Gremlins die before the blur is annoying. Gaussian blur with a reasonably small radius should be cheap (enough).
My guess is that the radius (or, equivalently, sigma) should obey a simple proportionality constant with the enlargement ratio. (Gaussian radius = half of enlargement ratio, I would guess, is about right. This means that the "effective area" over which the blur is noticeable is about the size of an original pixel, or a bit smaller.)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.