Posts for SuperLumberjack


Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
I think that I found ! :-) For the fullscreen mode of Sonic Mania, I think it's simply this with the "None" filter (with extremely subtle differences, but finally negligible) :
Language: AviSynth

Imagesource("H:\source image.png") ## 1080p None Filter PointResize(1696, 960) # Simple 4X BilinearResize(1920, 1080)
I was too focused on the perfection of the reproduction and the technic with the blended images ^_^ So in fullscreen it's another technic, the picture needs to be upscaled 4X with a PointResize filter and then, it's simply a bilinear filter to achieve the 1080p resolution ! And for the "Clean" filter, it's simply that :
Language: AviSynth

Imagesource("H:\source image.png") ## 1080p Clean Filter PointResize(848, 480) # Simple 2X BilinearResize(1920, 1080)
So, there is no magic ! :-P However, the scripts that I posted above are still correct for the windowed mode of the game. To conclude, I will just say as I said before, that really I think that the Bilinear filter is the best to smooth the image and correct the aspect ratio of these old games. It's the most natural I find ! I tried with Bicubic, Lanczos, Spline36, etc., but the ringing... ugh ! And with the anti-ringing filter, it's strange ! In fact, I would only use one these filters to upscale a high resolution image to a higher resolution (Spline36 + anti-ringing personally). But for the low resolution image, I think the bilinear filter is better. So, I still prefer the "Clean" filter in "Sonic Mania", with the resolution doubled with a Point resize filter and then the picture upscaled to the 1080p resolution with the bilinear filter. Oki ! End of the story ! :-D Edit : I changed my mind and finally have adopted the "None" filter, because with some phases of gameplay, it's easier when you see better ! ^_^ And it's more clean in fact (than the "Clean" filter...). But is just for playing ! Because even in 2160p, I would prefer the association of a "Simple X4" filter with a bilinear filter, than simply a "Simple X8" or "X9" filters, too blocky I find and therefore unsightly. In fact, I tried with lots of low resolution images (224p, 240p, 480p...) and for me the ideal would be to have the half of the output resolution with the PointResize filter and then achieve the output resolution with the Bilinear filter. In a perfect world, it would be the perfect compromise I think (particularly with 480p contents). If I take for example a Super Nes game with a resolution of "256 x 224", in the ideal I would like to get this :
Language: AviSynth

Imagesource("H:\source image.png") PointResize(1024, 896) BilinearResize(2048, 1792)
Or this still for example :
Language: AviSynth

Imagesource("H:\source image.png") PointResize(2048, 1792) BilinearResize(4096, 3584)
But it's not the ideal for our current standards. So in 2160p, this is better, with the correction of the aspect ratio in addition :
Language: AviSynth

Imagesource("H:\source image.png") PointResize(1024, 896) BilinearResize(2820, 2160)
Si it's still equivalent to the Clean filter of Sonic Mania. But the only problem is that it seems a bit too blurry in 1080p. But with a 2160p resolution, I'm sure it's perfect ! ;-) I know it's a question of tastes, but I think it's the ideal for the old games ! For the modern 2D games in pixel art, it's another story... With recent games like "Celeste" or "Axiom Verge", I would never have the idea to use a Bilinear filter, and a pixel perfect mode is of course better ! But as I said before, these new games were thought to be displayed on modern screens, whereas the old weren't ! And I think that lots of people know how the blurriness of some cables and screens were important to have some proper effects in lots of these games with the dithering for example, etc. The interesting posts concerning the subject of the thread (the aspect ratio correction) : http://tasvideos.org/forum/viewtopic.php?p=486114#486114 (the end of the post) http://tasvideos.org/forum/viewtopic.php?p=486163#486163
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello again :-) I just come back here, because I succeeded in my goal to reproduce the "None" filter and the "Clean" filter of Sonic Mania with a great help from a guy on the Doom9's Forum :-D I just failed in the 1080p resolution in fullscreen :-( I don't know what algorithm the game uses to put the picture in fullscreen, but it's more precise than a PointResize filter and a lot less blurry than with a LanczosResize filter (don't forget than the picture has to be streched a bit). But for the picture scaled 1X, 2X and 3X, it works and the "None" filter is applied in the exact same way ! The "Clean" filter is only available with the 3X scaling in-game, but it's the same principle. Here is my source image (that I still found on internet, because the filters are active in-game) : A screenshot in-game that I took in windowed mode with window size 3X and the "None" filter (edit : it shouldn't be blurry) : And the "None" filter that I reproduce with an AviSynth script :
Language: AviSynth

A=Imagesource("H:\source image.png",end=0).convertToRGB24 A=A.PointResize(1272, 720) ## None Filter x = 1.0 y = 0.0 OP= 0.25 B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP) A=Last # Make A as above x = 0.0 y = 1.0 OP= 0.25 B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP)
Screenshot in-game windowed mode 3X with the "Clean" filter : The "Clean" filter reproduced with an AviSynth script :
Language: AviSynth

A=Imagesource("H:\source image.png",end=0).convertToRGB24 A=A.PointResize(1272, 720) ## Clean Filter x = 1.0 y = 0.0 OP= 1.0/3.0 B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP) A=Last # Make A as above x = 0.0 y = 1.0 OP= 1.0/3.0 B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP)
But what's really interesting is this game is the "Fullscreen mode". I would even say that it is amazing, because I totally failed to try to recreate it ! Indeed, it looks like if there wasn't any interpolation to display the picture ! I tried with a PointResize filter, but it didn't match : Here is the image in-game zoomed : And my reproduction with the PointResize filter : But as you can see, it's less accurate... You can even try with a LanczosResize filter, it will look blurry and inaccurate. But the most interesting thing about the game, to return to the subject of the thread, is that the picture has in addition to be stretched a bit, because the aspect ratio of the game isn't a perfect 16:9 AR. So, could somebody explain to me how the developers did to create this miracle ? :-P I'm really interested, because it looks like a perfect solution ! :-) It's good to scale the image by a non integrer number and to display the image with another aspect ratio apparently. Bonus : Super Metroid with a Simple 3X filter only : Super Metroid 3X with the "None" filter of Sonic Mania (it's wrong, because it already wasn't correct in Sonic Mania on my desktop PC) : Note : You just need to put this at the beginning of the script :
Language: AviSynth

A=A.PointResize(768, 672)
The rest is always the same. Super Metroid 3X with the "Clean" filter of Sonic Mania : I find this really interesting ! :-) Personnally, it's the "Clean" filter that I prefer ! Edit : You were right Aktan, the picture shouldn't be blurry with the filter on "None", even with the windowed mode. Because on my laptop, I didn't notice any blur in Sonic Mania with no filter. So there is a strange problem with Sonic Mania on my desktop PC with the filter on "None" in the windowed mode.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Yes, I know this video ! The channel is great, with very good explanations ! ;-) It's why for some games like "Super Metroid", "Mr. Nutz" or "Super Mario World" for example, I keep the 8:7 aspect ratio, because lots of elements are thought to be in this AR :-) For the others like the "Donkey Kong Country" games for exemple, I use the 4:3 AR (the coins in these games are for example designed to be stretched in 4:3 and it looks more natural). The link you posted is interesting too, because it joins what it was said in the link I posted above. For the 3rd case you exposed, yes, that's true, some games have elements thought to be stretched in 4:3 and others that were not. In this case, I generally choose the 4:3 AR. But even in Super Metroid there are for example 1 or 2 elements are thought to be stretched in the 4:3 AR like the planet Zebes at the beginning I think. But it's not perfectly circular, with a 4:3 AR or a 8:7 and the big majority of the elements of the game (like the morph ball) are in 8:7, so for me, this game is in 8:7 :-P In addition, I don't think that the developers calculate to the nearest pixel what it will give with the 4:3 AR. I have the impression that everything was rather approximate :-/ It's strange that even Nintendo, with the Super Mario games, forgot totally to design them for a 4:3 AR while it was the standard. So I personnally choose what AR is the best for each game :-) I choose the best compromise ! ^_^
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello, I just come back to tell you that I have succeeded in reproducing the look of Higan :-) It's exactly the same thing, to the nearest pixel (but without the colors filter) ! :-P This will complete the list of the experiments with AviSynth scripts that there are on the 1st page on this topic, if you are interested of course ! ;-) In fact, I wanted to reproduce the look of "Sonic Mania", but it wasn't successful ! I got some help on the Doom9's Forum. However, it was enough to be able to reproduce the style of Higan :-D So, to begin, here is an exact reproduction of the look of this game with Higan in the original aspect ratio of 8:7 :
Language: AviSynth

A=Avisource("G:\name_of_the_file.avi").convertToRGB24.PointResize(512, 448).AddBorders(0, 16, 0, 16) # the picture resolution is doubled and black borders are added to achieve the 480p resolution x = -1.0 # this shift the picture to the left y = 0.0 OP= 0.5 # the blend ratio B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP) # the shifted image and the original image are blended together BilinearResize(1024, 960) # the picture resolution is doubled with a bilinear filter
Here is the same picture with an aspect ratio corrected with a bilinear filter, like Higan does :
Language: AviSynth

A=Avisource("G:\name_of_the_file.avi").convertToRGB24.PointResize(512, 448).AddBorders(0, 16, 0, 16) # the picture resolution is doubled and black borders are added to achieve the 480p resolution x = -1.0 # this shift the picture to the left y = 0.0 OP= 0.5 # the blend ratio B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP) # the shifted image and the original image are blended together BilinearResize(1170, 960) # the picture resolution is doubled and the aspect ratio corrected with a bilinear filter
In addition, we can upscale the image in a 2160p resolution, for example with a "Spline36" resizer (the one I prefer, because it's equivalent to "Lanczos3", but with less ringing and artefacts) or a "Lanczos3" resizer : I use the "Resize8" plugin because it uses an anti-ringing filter : http://avisynth.nl/index.php/Resize8 (But be careful ! Other defaults can appear with the anti-ringing, if the scaling factor is too high)
Language: AviSynth

Resize8(2632, 2160, kernel="Spline36", kernel_c="Spline36")
Or we can remove the black borders too :
Language: AviSynth

A=Avisource("G:\name_of_the_file.avi").convertToRGB24.PointResize(512, 448) # the picture resolution is doubled x = -1.0 # this shift the picture to the left y = 0.0 OP= 0.5 # the blend ratio B=PointResize(A,A.Width,A.Height,-x,-y,A.Width,A.Height) A.Overlay(B,Opacity=OP) # the shifted image and the original image are blended together BilinearResize(1170, 896) # the picture resolution is doubled and the aspect ratio corrected with a bilinear filter Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36")
I know that some of you will find this blurry, but it's like Higan does. I will finish with the question of the aspect ratio, or rather remind what I found, to stay within the theme of the topic ;-) Higan use the same aspect ratio for the Super Nes games that the one which is in this list here : https://pineight.com/mw/?title=Dot_clock_rates I will quote some things that I said (sorry for the narcissism ^_^ ) to help you to understand :
SuperLumberjack wrote:
And so, we calculate the new resolution like this : 256 x (8:7) = 292, 57 In fact, the original ratio of 8:7 correspond to : 256 x (1:1) = 256 Otherwise, you can simply do this : (64:49) x 224 = 292,57 With the standard 4:3, we get this : (4:3) x 224 = 298,66 And with the original 8:7 aspect ratio this : (8:7) x 224 = 256 Finally, with a 4:3 AR on a modern screen, we need to choose the resolution : 292 x 224 or 293 x 224 Higan proposes these resolutions in 4:3 : - Small : 585 x 448 (585 x 480) - Medium : 877 x 672 (877 x 720) - Large : 1170 x 896 (1170 x 960) And the Super Nes Classic Mini proposes a resolution of "877 x 672" too (1280 x 720 with borders).
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Yes, I didn't want to be off-topic. I thought this blur interesting and that it was a choice from the developers. My goal was in fact to use this as a model for a new AviSynth script ;-) I will continue to do researches for my part, to know if this blur is voluntary or not too.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
OK. I understand better now ! ;-) Interesting ! I didn't know ! Yes, it's strange ! And so do you think it depends exclusively on the version of Windows or was it a reasoned choice from the developers ? But maybe this kind of blur is in the engine of the game too, to render the pixels less square. Don't you think ? :-) Actually, I don't find this blur so bad, because without that, it's often too blocky. I wonder if it was voluntary from the developers or not. But if it was a choice, I found the use of this blur rather interesting. It's why I wanted to talk about it here.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Sorry, but I'm not sure to understand all the meaning of what you said. It's a bit subject to misunderstanding :-/ I don't know if it's my message or the question of the blur that is disturbing you. If it was my message, I will just quickly explain one again. Only the 2nde picture is in a pure native resolution, without treatment ! I found it on Google. The 1rst is a screenshot in-game that I took. It is in the native resolution too (424 x 240), but there is a little blur added by the game itself. We see this blur for each size in-game ! It's not only a Point resize scaling as we would have expected. (3rd image : 1272 x 720 - windowed mode - window size 3X 4rth image : 1920 x 1080 - fullscreen mode - the windows size doesn't have any influence 5th image : "the 2nd picture, found on Google and upscaled 3 times with PointResize" vs. "a capture in-game with a window size of 3X" [zoom 400%]) I think the blur is a choice of the developers to not have absolute blocky pixels. It's why I found this interesting ;-)
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello, I have interesting things to tell... I think ! :-P I just bought "Sonic Mania" on Steam and I was curious to see how the scaling of the image and the filters work :-) In windowed mode, there are 3 scaling options : 1X, 2X or 3X. Tha native resolution is "424 x 240". There are a filter "None", a "Clean" (a bit more blurry than None) and 2 CRT filters. In fact, I was surprised to notice that the filter "None" isn't only a Point filter. As you can see here, even with a X1 scaling, the picture is a bit blurry (edit : in fact, it shouldn't be blurry, there is an issue with it on my desktop PC) : Note that there is no difference between the "None" and the "Clean" filters when the picture size is 1X or 2X. It begins with 3X. It's strange, because I had to search on Google to find a capture of the game in its native resolution without any blur : So, this little blur with the "None" filter is always active. Here is the game scaled 3X : And in fullscreen in 1080p : It's interesting to notice that the native resolution doesn't correspond exactly with a 16:9 aspect ratio, because : 424/240 = 1,7666666666666666666666666666667 But : 16/9 = 1,7777777777777777777777777777778 So the game has to be slightly stretched in fullscreen mode. I don't know if it's a bilinear filter that is used, something else or nothing. It's hard to compare with this blur. But at least, we can compare how the blur works ! ;-) I upscaled the original picture 3X with a Point resizer to achieve the 720p resolution (image left) and then compared it with the picture in-game (image right). The picture is zoomed at 400% : As you can see, if we observe a big pixel (which has 12 pixels here, because of the 3X scaling and the zoom at 400%), the part which is blurry is all around the pixel (to the left, the right, the bottom and the top) and correspond to 1/3 of the pixel (4 pixels on 12 pixels). If I show you this, it's because I think that this method of representation of the pixel art isn't bad and rather transparent. Maybe we can took our inspiration from this ;-) Who suspected there is a little blur in this game when there is no filter ? :-P The only problem is that I don't know what kind of blur it is... :-/
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
I'm sorry, but I'm not a pro with encoding :-/ I know all the video and audio formats, but for encoding, I'm a noob ! ^_^ It's why I simply use Handbrake with these settings for videos in 2160 at 60 fps : - Quality: CRF 11 - Video Codec: H.264 - Framerate: Same as source - Constant Framerate - Encoder Preset: VerySlow - Encoder Profile: High - Encoder Level: Auto I just know the basics. Edit : I found the problem. Handbrake put me the "Encoder Level" on "L6" with it on "Auto" when I used the "Encoder Preset" on "VerySlow" or "Slower". There is no problem with "L5.2".
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
But the strange thing is that I uploaded for example a video on my private channel and it worked. And some months later, I uploaded the exact same video on my public channel but it failed. The problem is that now, I have this problem for the two channels. And as you can see, the 2nd video uses the settings recommanded by YouTube with a MP4 format and AAC for the audio, etc. Before, I always uploaded my videos with the MKV format and the audio in FLAC and I never had a problem ! But it seems that this problem is only with the videos in 2160p, not in 1080p. I'm stuck and can do nothing ! :-/ I didn't want to be off-topic. The problem is if I want to show you some things I tested, I need to do with this encoding issue. It was just to prevent.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
If you are interested, you can tell me what do you think about the quality of these videos :-) (sorry, I deleted the videos) But I just have an issue for 4 months :-/ My videos in 2160p are always badly reencoded by YouTube. I hadn't this problem before March. And in addition, it's the same on my two channels (I have a private channel too). But even with this issues, you can see if the quality of these videos are good or not ;-) Thanks !
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
I agree that it can create confusion, because the native aspect ratio of the Super Nes game is 8:7 too and you're right, it was displayed with a 4:3 aspect ratio on the CRT TVs. But this 8:7 aspect ratio is apparently only for the horizontal resolution. It's why I wrote some calculations, because it's a bit confusing :-P For a Super Nes game, we know that the original resolution is "256 x 224", with a 8:7 aspect ratio. But to know the exact resolution that must be displayed with a 4:3 aspect ratio (for the modern displays I suppose, because the old CRTs weren't digital), we need to take the horizontal resolution and multiply it by the AR showed in the list, so a 8:7 AR. Yes, it's confusing with the native AR which is 8:7 too ^_^ And so, we calculate the new resolution like this : 256 x (8:7) = 292, 57 In fact, the original ratio of 8:7 correspond to : 256 x (1:1) = 256 Otherwise, you can simply do this : (64:49) x 224 = 292,57 With the standard 4:3, we get this : (4:3) x 224 = 298,66 And with the original 8:7 aspect ratio this : (8:7) x 224 = 256 Finally, with a 4:3 AR on a modern screen, we need to choose the resolution : 292 x 224 or 293 x 224 Higan proposes these resolution in 4:3 : - Small : 585 x 448 (585 x 480) - Medium : 877 x 672 (877 x 720) - Large : 1170 x 896 (1170 x 960) And the Super Nes Classic Mini proposes a resolution of "877 x 672" too (1280 x 720 with borders).
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
By the way, concerning the good aspect ratio in 4:3, it seems that the Super Nes Classic Mini uses a 64:49 AR (8:7 for the horizontal resolution) too instead of 4:3 :-) This is a capture of the Super Nes Classic Mini : I found it here and just cut the borders : http://www.nintendolife.com/news/2017/09/hardware_review_the_snes_classic_mini_is_the_perfect_link_to_the_past There are others here : https://www.eurogamer.net/articles/digitalfoundry-2017-nintendo-classic-mini-super-nes-system-review The resolution is "877 x 672". It's just a Simple X3 (or nearest neighbor) and a bilinear filter to correct the AR. And just to check : 672 x (64:49) = 877 So even the "official" Super Nes Classic Mini doesn't use an exact 4:3 aspect ratio ;-) => List of the aspect ratios
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Two interesting videos to compare the picture from the Super Nes with an OSSC and from an Analogue Super Nt ;-) Link to video Link to video Do you think it's possible to achieve this quality with an AVS script ?
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Yes, of course ! :-P It's just for the comparison, for the idea ! ;-) I should have said too that a progressive image with scanlines it's not the same that a progressive image made for a modern screen. And concerning the interlaced video, I think that they shouldn't exist on the modern screens anymore. I believe that the 240p and 480i are only vestiges of the CRT screens and really only work on this kind of devices. The interlaced videos work on CRT TVs without the need to deinterlace them, as the progressive contents work well with scanlines. If we think about 240p and 480i content, a 480i video non-deinterlaced on a modern screen should be equivalent to a 240p video doubled to a 480p resolution with fake 100% scanlines. Am I wrong ? :-/ I don't know if I'm clear and if you understand what I try to say. But if you follow my logic : what is the equivalent of deinterlacing for the 240p videos (which should work with scanlines) ? I don't talk about progressive content for the modern screens, because they don't have to work with scanlines and of course don't need to be deinterlaced. It's just a reflexion. I really make the distinction between 240p contents which must work with scanlines on a CRT and progressive contents made for the modern screen. I hope you will understand me... ^_^ But the Higan emulator uses a logic like that with blurring the image horizontally. It's the opposite of what I said with the vertical blur, but yes, in fact it's more logical with a progressive image, to keep the vertical definition intact. But I think there is an idea like what I suggested, a kind of reversed deinterlacing (no interlacing of course) for the old progressive content made to work with scanlines. In fact, I analysed what they did with the Super Nes games. With the biggest scaling (the resolution is 1170 x 960), they : - double the resolution to 512 x 480 (448 pxs + black borders) - move the picture from 1 pixel horizontally (it's like a ghost image, it doesn't work with a simple blur) - double the resolution and correct the aspect ratio with a bilinear filter to achieve the resolution of 1170 x 960 It's really smart and work quite well ! :-) But lots of people will find the picture too blurry. But the effect in motion is good and rather natural I think !
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Aktan wrote:
I thought the current script would be point resize to the target resolution or bigger in multiples of 2, then downscale to the target resolution if needed. For example:
Language: avisynth

AVISource("movie.avi") PointResize(3408, 2928).LanczosResize(2880, 2160, taps=2) ConvertToYV24(matrix="Rec709", chromaresample="point") ConvertToYV12(matrix="Rec709", chromaresample="lanczos") # Notice the change in chromaresample
There is a slight color bleed which is intentional to make the pixel sizes consistent.
Hello ! :-) Very interesting logic ! :-P I tried these kind of things too, with some blurs, etc. ;-)
Aktan wrote:
Yes, Lagarith YV12 is probably using Rec601 color matrix, but since you already know how to use Avisynth, why not capture in RGB and convert it yourself as a last step, then send to Handbrake?
It's what I do ! ;-) In fact, I only use Lagarith when I temporarily want to export my videos in RGB and/or reduce the size of the file :-) And so, why this change of color in the script ? :-P
Aktan wrote:
What he did was upscale it above the target resolution, then downscaled to the target resolution with AreaResize. AreaResize uses weighted averages to figure out the end result.
OK. It's funny, because I tested lots of things like this too some years ago ! ^_^
Aktan wrote:
This is why I personally use Lanczos with 2 taps instead of 3. Less ringing but more blurry.
Yes, I agree ! But too sharp may be worst sometimes ;-) To be honest, I think I tried almost all the resizers that it's possible to try ^_^ I did a lot of scripts, and now, I still wonder what could be the best :-/ Maximum pixels ? A picture a bit blurry ? A compromise ? :-P I don't know ! But I think that the big problem for these old 2D games compared to the modern pixel art games, that are thought for our modern screens, it's precisely the fact that they were designed for the old CRT TV. I think that the scanlines were really important for the trick to work. It created relief and gave the impression that the vertical resolution was doubled. But we haven't this yet or only with CRT shaders. For me, a 240p progressive image with scanlines, it's almost the same than a 480i interlaced image in term of definition. And generally, on a modern screen, the most basic way to deinterlace a image is to blend fields. With VirtualDub, it's equivalent to this with AviSynth :
Language: AviSynth

Blur(0, 1.0)
So I tested this with a 240p image doubled to 480p. With a Super Nes game, I tested this :
Language: AviSynth

PointResize(512, 448) Blur(0, 1.0)
For me, it's only like this that I finally see a convincing relief in the image, like it was on a CRT. But as everybody can see it, the result is blurry and not really nice ! Like a deinterlaced video with blended fields in fact ^_^ But I think that all the problem of the games in 240p is exactly the same that it is with interlaced contents on our modern screen. It's a bit unnatural... :-/ It doesn't work without deinterlacing or something else and even with that, it's far from perfect. For me, it's the only problem ! It really doesn't work on a modern screen ! Only the modern pixel art games are done to perfectly work on a modern screen I think. With the old 2D games, we always have to use a trick to render them acceptable. In the ideal, we should have the double of the definition for the vertical resolution !
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello again ! :-) I just want to show you some things I did. It's not extraordinary, it's even very simple, but I just tried to come close to how the picture was on a CRT (very basically, it was just for help me, because some CRT shaders are really better of course). I compared with some photos that I found here : https://www.neogaf.com/threads/scanline-screenshot-thread-because-240p-is-all-the-ps-i-need.921436/page-2 But here, I will take this capture as a model : (source : https://youtu.be/iPohK0D8qvM ) I know the picture is bad :-P But what is interesting is that the guy used a VGA CRT monitor instead of a CRT TV with the real console and an OSSC. I think it's better to compare with this than with a CRT TV and its scanlines, because it's closer to the conditions we have on a modern screen which hasn't scanlines. But there is the version with a CRT TV too ^_^ : (source : https://youtu.be/OxBXiCPFM78 ) And so, here is a test with (very basic) scanlines and a little boost of gamma to compensate :
Language: avisynth

PointResize(512, 448) Scanlines(STRENGTH=75) Levels(0, 1.25, 255, 0, 255) PointResize(1024, 896) BilinearResize(2820, 2160) # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160
Personnally, I wouldn't use scanlines for YouTube. It's just to compare ! :-) The same without scanlines :
Language: avisynth

PointResize(1024, 896) BilinearResize(2820, 2160) # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160
Another capture for model : I tested something softer (without scanlines) :
Language: avisynth

PointResize(512, 448) Scanlines(STRENGTH=75) Levels(0, 1.25, 255, 0, 255) BilinearResize(1170, 896) # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160 Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36") # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160
I choose to change the aspect ratio with the bilinear filter to begin, because I think it's more convincing, but you can choose to do that only with the Spline36 resizer. The same picture without scanlines :
Language: avisynth

PointResize(512, 448) BilinearResize(1170, 896) # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160 Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36") # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160
I tested so many other things (with Nnedi3 too ;-) ) that I can just say one thing : the simpliest is often the best. I know that lots of people hate the bilinear filter, but personnally, I think that the best result is this (from what I suggested of course) :
Language: avisynth

PointResize(1024, 896) BilinearResize(2820, 2160) # Personnally, with some other games like "Super Metroid", "Mr. Nutz" or "Super Mario World", I keep the 8:7 AR, so I choose a resolution of 2468 x 2160
There is no miracle with an upscale ! :-( Some people may think that it's to simple to be good, that it's inaccurate, but was it accurate in those days ? :-) The other problem, as I said above, it's the influence of the modern "pixel art" indie games and their pixel perfect blocky representation... :-P I'm curious to know what you think ! ;-) But I tested enough things (like a lunatic ^_^ ) to know that it's never finished if we are looking for the perfection ! The rest is too subjective... ! Personnally, I keep the PointResize filter with the bilinear. This with 1080p :
Language: avisynth

PointResize(512, 448) BilinearResize(1410, 1080)
This with 1440p :
Language: avisynth

PointResize(768, 672) BilinearResize(1880, 1440)
And this with 2160p :
Language: avisynth

PointResize(1024, 896) BilinearResize(2820, 2160)
Voilà ! :-P Sorry, there is no big revelation ! :-/ Just some reflexions I think.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
This quality is not bad for me ! ^_^ Link to video I think it's not necessarily nice when it's to blocky ! I think there is bilinear filtering somewhere or something else. I don't know. What do you think ?
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello :-D Thanks ! ;-) Yes, I understand the better control with the color space conversion. By the way, I tested to compare what is the best between the result of the conversion with the feos scripts and the UtVideo codec. That's true, feos' script win ! :-P But the only strange thing I noticed is that the colors changed. We see this in the reds and greens. I don't knwo if it was itentional or not. I will show you and the comparison with UtVideo too, so we can see clearly the differences :-) I will write the script each time too. RGB 24 (uncompressed) :
Language: avisynth

PointResize(2048, 1792) Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36")
I know, it's very blocky ! :-P I used the "Resize8" plugin because it uses a anti-ringing filter by default : http://avisynth.nl/index.php/Resize8 The ringing isn't always bad, because it adds sharpness, but I find that the result with the anti-ringing filter is quite good (but it can adds other defaults if the scaling factor is too big). I didn't use the true 4:3 aspect ratio, but : 256 * (8:7) = 2048/7 So : (2048:7)/224 = (64:7)/7 = 64:49 YV24 then YV12 with AVS script (like feos did) :
Language: avisynth

PointResize(2048, 1792) Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36") luma = ConvertToYV24(matrix="Rec709", chromaresample="point").ConvertToYV12(matrix="Rec709", chromaresample="point") chroma = ConvertToYV24(matrix="Rec709", chromaresample="point").ConvertToYV12(matrix="Rec709", chromaresample="point") MergeChroma(luma, chroma)
We can notice different pinks, reds and greens ! But the result is good ! ;-) YV12 with the "UtVideo YUV420 BT.709 VCM" codec : The conversion of the color space is most blurry and less clean than the conversion with the AVS script. Maybe bicubic or something else is used to reduce the chroma resolution. But in theory, the reduction of the chroma needs interpolation too, like when we upscale a picture, so "PointResize" or something else, it's a question of taste I suppose ;-) However, the color matrix is good and the file is taggued with it :
MediaInfo wrote:
General Complete name : H:\UtVideo.avi Format : AVI Format/Info : Audio Video Interleave File size : 229 MiB Duration : 2 s 567 ms Overall bit rate : 750 Mb/s Writing library : VirtualDub2 build 41585/release Video ID : 0 Format : YUV Codec ID : ULH0 Codec ID/Info : Ut Video Lossless Codec Codec ID/Hint : Ut Video Duration : 2 s 567 ms Bit rate : 749 Mb/s Width : 2 820 pixels Height : 2 160 pixels Display aspect ratio : 4:3 Frame rate : 60.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Compression mode : Lossless Bits/(Pixel*Frame) : 2.048 Stream size : 229 MiB (100%) Audio ID : 1 Format : PCM Format settings, Endianness : Little Format settings, Sign : Signed Codec ID : 1 Duration : 2 s 567 ms Bit rate mode : Constant Bit rate : 1 024 kb/s Channel(s) : 2 channels Sampling rate : 32.0 kHz Bit depth : 16 bits Stream size : 321 KiB (0%) Alignment : Aligned on interleaves Interleave, duration : 21 ms (1.23 video frame) Interleave, preload duratio : 500 ms
I use this codec because I had a problem of wrong color matrix when I used the Lagarith codec (because there is no tag for the color matrix) and then encode the video with Handbrake. I'm not a professional for encoding, it's why I use Handbrake. I think the result is really good ! :-) But I got the right color matrix with the AVS script if I don't specify it. YV24 then YV12 with AVS script (good color matrix) :
Language: avisynth

PointResize(2048, 1792) Resize8(2820, 2160, kernel="Spline36", kernel_c="Spline36") luma = ConvertToYV24(chromaresample="point").ConvertToYV12(chromaresample="point") chroma = ConvertToYV24(chromaresample="point").ConvertToYV12(chromaresample="point") MergeChroma(luma, chroma)
Oki doki ! :-) For the Nnedi3, yes, I already tested it ! ;-) It gives excellent results, but gives sometimes some artefacts too :-/ But I like it too. What did you use to upscale to the final resolution ? Lanczos3 ? I forgot to say that personnally, I prefer the "Spline36" algorithm rather than "Lanczos3" (I did lots of comparisons to be sure). The result is quite similar, but there is a bit less ringing ! ;-) Later, I will show you other scripts that I tested, often softer that what I showed here (maximum pixels, very blocky ! :-P ), not crazy things, but some things that I find pleasant... but never perfect of course ! ^_^ It's too subjective !
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Yes, I know this picture ! ^_^ The difference is really amazing, that's true ! :-) All of that to say that I'm still in research to find the better way to represent these old games in these days ! But I saw that I'm not the only one, because there are lots of AVS script on the previous page ! :-P By the way, concerning these scripts and the conversion of the color space, personnally I don't convert the video to a YV12 color space. I work with RGB24, but I export the video with a lossless codec that convert the RGB24 to the YV12 color space. It's the codec "UtVideo YUV420 BT.709 VCM" : https://www.videohelp.com/software/Ut-Video-Codec-Suite If it can be useful ;-) I think it's less complicated and the result is very good. And we got a lossless file ready for the encoding with the good color space and the good color matrix. Here is a screenshot zoomed X4 to compare (left RGB 24 - right YUV 4:2:0 with the codec) : RGB 24 : YV12 with the UtVideo codec :
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
I always regret having sold my Super Nes :-( I think I would have used it with an OSSC too on a modern screen ;-) Today, I play on emulator of course, but I plug my PC on the TV. I use generally a "Simple X2" filter with bilinear filtering in 1080p (before I prefered to use a "XBRZ X2" filter, but I think it's to artificial). It's not perfect, but enough natural I find. The real problem is when we want to do some videos of gameplay. I think I am on the good topic ! ^_^ What is the best way to represent these games when we want to show them to other people ? It's so subjective ! Personnally, I think there is a big problem with the approach to representing what we call now "pixel art" ! I think there is a confusion between the "old 2D games" and the "modern pixel art". I thought about all of this, and I think that "pixel art" has become a deformation of what the old 2D games were. OK. In these days, we see "pixels" with these games on a modern screen. But I don't remember that I have seen any pixels when I was a child and played with my Super Nes on a CRT TV. There were only graphics, often great graphics, I saw what it was supposed to be represented, but not the pixels ! It was all the magic of the trick ! In addition, it's clear that CRTs softened the image and did like a sort of natural anti-aliasing. To see pixels, I had to put my nose close to the screen :-D It's why I'm also not a fan of the "CRT shaders", even if I find that some are really great and impressive ! :-) But for me, it's a part of the new deformation of what retro games should be. Because the "scanlines" and "the pixels"... I only noticed them when I was glued to the screen ^_^ So, all of that to say that all the modern, indies, "pixel art" games have tended to make us forget what were the old games on an old screen, the sensations, the feeling, the immersion, etc. It's like the "modern retro" for me. We create a new myth of what it was in the past. I will attempt to conclude ! :-P For me, the modern "pixel art" aren't a real evocation of what the 2D games were. It's something different, because the old 2D games were nice on an old screen and are now pixelated on a modern screen. It's just a consequence ! So, I think there are the "modern pixel art games", that tends to expose the pixels and render them aesthetic. It's a kind of new "aesthetic", clearly a modern approach ! And there are the old 2D games, that were only art because developers arrived to create amazing graphics with big technical limitations. For me it's not the same. It wasn't supposed to be "pixel art" ! Sorry if I'm long ! But through this, I want to ask one question : is it now better to represent these old games with big perfect pixels or is it better to soften a bit the image ? Aren't we too focused on the quality and the perfection of the image today, but at the cost of the soul, the emotions and the ambiance of what we want to represent ? ;-)
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Whaou ! Impressive knowledges ! :-P I must admit that I'm not really familiar with all of this, so I just copy what I read here and there ^_^ It's not always easy to understand, it's a big jungle ! But so, do you agree with the question of the aspect ratio, or it seems fanciful for you ? ;-) Is it better to choose a real 4:3 aspect ratio or to choose these particular AR for each console ?
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Here are all the exact PAR for the different consoles ;-) : https://pineight.com/mw/?title=Dot_clock_rates Exemple for the Sega Genesis and PlayStation 320px mode which have a exact PAR of 32:35 : If I take "Sonic the Hedgehog" and its resolution of "320 x 224", we will get this : 320 x (32:35) = 292,57 So a resolution of : 292 x 224 or "584 x 448" or "1410 x 1080" or "2820 x 2160" if I keep even numbers only.
Experienced Forum User
Joined: 7/9/2019
Posts: 24
Location: France
Hello :-) I'm French and new on these forums. I don't want to do TAS videos, but I love the videos of the "TASVideosChannel" on YouTube and often watch them. However, I like to do some simple videos of gameplay that I share with my friends on Facebook, particularly of Super Nes games, just for fun ;-) So I tried lots of things with AviSynth's scripts too, to get a perfect picture, but as you all know, it's almost impossible to have something authentic, as in our memories, on our modern screens :-/ Despite this, I continue to test some new thing, but without stress ! But it's only some days ago that I got the idea to read some interesting things on your forums. If I had known this before... ^_^ So, I fell on this topic, which is very captivating, because it talks about the question of the aspect ratio and propose lots of interesting AVS scripts. The only thing I can say is that for the Super Nes games, I personnally don't use the perfect 4:3 aspect ratio. I take the same aspect ratio than Higan or the Super NT that suggest to take a resolution of "1410 x 1080" for example in 1080p. Here is a picture with 4:3 AR and a resolution of 1170 x 896 : Here is a picture with the original AR of 8:7 and a resolution of 1024 x 896 : I read this too :
Now here comes the important part: People generally get wrong how to aspect correct the SNES. They think you take the 256×224 active area and stretch that to a 4:3 image. That's not how it works. Instead, a formula is devised based on the pixel clock rate. In the case of the NES, SNES, and Genesis's 256×224 mode, the formula is 256 * 8/7, which equals about 293×224 for proper aspect correction. When scaling, the most accurate approach is to scale first and then apply the formula. So 2x scale would be (256 * 2) * (8/7) = 585×448 and 3x scale would be (256 * 3) * (8/7) = 878×672 and so on. Of course it's better to use multiples of 2 when it comes to digital displays, so for 1x scale: 292×224, and 2x scale: 584×448.
(source : https://www.neogaf.com/threads/best-nes-snes-and-gba-emulators.1433788/page-6 ) And this :
At 5.37 MHz, exactly 280 pixels fit into 52.148 μs. The ColecoVision, Master System, NES, and Super NES fill 256 of these with picture and the rest with black or solid-color side borders that fit in the overscan part of the signal that a TV doesn't display. To stretch 280 pixels on 240 scanlines to a 4:3 frame requires stretching each pixel horizontally by a factor of 8/7, giving an 8:7 pixel aspect ratio. Vertically, the NES always produces 240 scanlines, and the Super NES is switchable between 224 and 239. But it's traditional to crop the image at 224 lines as a rough approximation of what a TV cuts off. Thus in 720p mode, the device scales the 256x224 pixels produced by the built-in emulator to about 256*8/7*3 = 878 pixels wide and by 224*3 = 672 pixels tall. Elsewhere, I've collected a list of dot clock rates for classic arcade, console, and home computer platforms' picture generators and their resulting pixel aspect ratios.
(source : https://gaming.stackexchange.com/questions/318935/what-is-the-difference-between-the-43-mode-and-the-pixel-perfect-mode ) What do you think about all of that ? :-) (excuse me if my English isn't perfect :-/ )