Log in

View Full Version : I want to upscale a Super Nes video in HD


Pages : [1] 2 3 4 5 6

SuperLumberjack
18th August 2016, 14:28
Hello :)

I'm new on this forum and I'm French. I try to upscale video captured with a Super Nes emulator (Snes9x) which are in a resolution of 256x224, in a resolution of 1408x1080.

[with Higan Emulator, the output resolution is 584x448 (or 584x480 with black bars), and it is known to be the more accurate emulator, so I took a proportional resolution]


My principal problem is this :

Pixel Aspect Ratio and Sampling

Analogue RGB signals from retro consoles use composite video or composite sync in addition to the color information. This type of sync doesn't contain information about the horizontal pixels. This is commonly called RGBS as opposed to RGBHV, where H and V stand for the horizontal and vertical sync. RGBHV is used in more modern devices for VGA for example. On CRTs it doesn't matter that there is no horizontal sync information, because each line of the picture is drawn across the whole screen. On LCD screens and for capture this is a problem. In the process of creating a digital version of the signal the picture lines are sampled and pushed into a mask of pixels. The number of pixels is fixed and doesn't take the original console into account. Usually there are 720 or 640 horizontal pixels after the sampling step.
sampling

https://blz.la/rgb/img/2014/sampling.png

240p signal with non-square pixels sampled and linedoubled to 720x480 pixel.

Retro consoles usually only have a low amount of pixels in the horizontal resolution. These pixels are stretched to fill a whole line on the screen. In the case of the SNES there are 256 pixels horizontally in each line on the console. To fill the screen the pixels are slightly stretched, resulting in pixels that are wider than tall. The actual pixel ascept ratio (PAR) for the SNES is 11:10. On a PC each pixel has the same width and height, or in other words a pixel aspect ratio of 1:1. In the sampled version of the signal each non-square pixel from the console influences the color of 1 or 2 horizontally adjacent square pixels making it slightly blurry on the horizontal axis.

(source : https://blz.la/rgb/)


Do you see what I mean ?

When I do an enlargement oh the image with classic resize filter, it becomes inaccurate horizontaly.

The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors :(

Have you an idea for this ?

We can took this picture to begin :

http://image.noelshack.com/fichiers/2016/33/1471598760-dk3-image-originale-basse-definition.png


Thanks for your help ! ;)

wonkey_monkey
19th August 2016, 18:58
The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors

You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:


r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)


(not tested)

SuperLumberjack
19th August 2016, 18:59
I tried the SimpleResize with this base of code :

w=<new width, integer>
h=<new height, integer>


## Last=YV24
YToUV(
\ UToY.SimpleResize(w, h)
\ , VToY.SimpleResize(w, h)
\ , Last.SimpleResize(w, h)
\ )

But, it's not perfect.

http://forum.doom9.org/showthread.php?p=1777501#post1777501

Strangly, I noticed on my notebook (with Intel HD4600 chipset), that in VirtualDub a upscaling was effective with previews.

See the picture in fullscreen. The upscaling by the Intel HD is effective in the left window. In the right window, I upscaled the image 4X with Nearest Neighbor filter.

http://image.noelshack.com/fichiers/2016/33/1471561397-upscaling-actif-par-defaut-sur-pc-portable.png

This upscaling is effective in other programs (like ACDSee) too.

http://image.noelshack.com/fichiers/2016/33/1471561661-upscaling-actif-vs-bicubic.png

Intel HD upscaling vs. Bicubic

But it's enough impressive, because when we enlarge a picture, it's almost transparent. It's like stretching chewing-gum :p

http://image.noelshack.com/fichiers/2016/33/1471562134-tirement-image-upscaling-actif.png

Here is the image in ACDSee, when I zoom at 1000% :

http://image.noelshack.com/fichiers/2016/33/1471598634-upscaling-intel-hd-image-zoomee-1000x.png

Zoom 2000% :

http://image.noelshack.com/fichiers/2016/33/1471598669-upscaling-intel-hd-image-zoomee-2000x.png

Zoom 5000% :

http://image.noelshack.com/fichiers/2016/33/1471598704-upscaling-intel-hd-image-zoomee-5000x.png

Zoom 10000% :

http://image.noelshack.com/fichiers/2016/33/1471598729-upscaling-intel-hd-image-zoomee-10000x.png

Where can I find a filter like this for AviSynth ? :)

It could be the solution for this problem :o

https://blz.la/rgb/img/2014/sampling.png

Thanks for your help ! :thanks:

SuperLumberjack
19th August 2016, 19:28
You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:


r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)


(not tested)

In the same moment ! :p Thanks for the answer :)

Yes, someone told me for the SimpleResize with YV24 color format (it was better than with RGB24, because it was directly in YV24) ;)

SuperLumberjack
19th August 2016, 19:40
How can I reduce the size of the images on this thread please ? It's too big :p

mastrboy
19th August 2016, 19:45
Tried pointresize(1024,896) ? (basically 256*4x224*4)

SuperLumberjack
19th August 2016, 19:53
Yeah ! But it's ugly :D

In reality, the output resolution must be proportional to : 584x448.

It's the Higan (the Super Nes emulator known as the more accuracy) resolution.

So, I need to change the aspect ratio :)

I want 1408x1080 for the output resolution.

mastrboy
19th August 2016, 20:01
I see, well then my idea is of course completely useless ;)

SuperLumberjack
19th August 2016, 20:04
No, because I tried with PointResize and others filters too ;)

I tried many things :D

feisty2
19th August 2016, 20:09
Take a look at HQx

feisty2
19th August 2016, 20:10
https://en.wikipedia.org/wiki/Hqx

raffriff42
19th August 2016, 20:15
http://avisynth.nl/index.php/PointSize
a collection of specialized resizers for pixel-art and other low resolution graphics (e.g. old or portable video game captures).
(including HQx)

SuperLumberjack
19th August 2016, 20:46
Thanks ! :)

But I don't like HQx and emulator filters :p

For me, the biggest problem is to get a transparency change of the aspect ratio. So the problem is this :scared: :

https://blz.la/rgb/img/2014/sampling.png

But for the upscaling, I prefer maybe Spline16 or Bicubic. A filter which doesn't cause this around the objects :

http://www.repaire.net/forums/attachments/madvr-jinc-sans-anti-ringing-png.34435/

Spline36, Lanczos, Blackman, Sinc, etc., it's bad for me ! :D

Or I need to begin with Spline16 and Bicubic, and after continue with an other filter.

But I think I must change the aspect ratio in the end. It would be the best with a filter like the Intel HD upscaling. It's amazing when we enlarge a picture :)

trip_let
20th August 2016, 06:28
But it can't be transparent, at least as long as the display device has square pixels. Either it's going to have to be interpolated and stretched by some resampler now or on playback, if you want the displayed aspect ratio correct.

Isn't the preview you're looking at just with some bilinear upsize or something like that?

Just a quick check of a couple things:
bilinear, convert to YUV444 (https://my.mixtape.moe/dldgca.png)
nnedi3 doubled three times to 2048x1792, then Catmull-Rom (bicubic b=0, c=1/2) down to target and convert to YUV444 (https://my.mixtape.moe/tcfrdt.png)

SuperLumberjack
20th August 2016, 09:40
Hello. Thanks for your answer ! :)

Bilinear, it's a bit too sweet.

I tried with Nnedi3 too. But with this filter in first position, we have some deformations of straight lignes.

See here :

http://image.noelshack.com/fichiers/2016/33/1471681733-mario-nnedi-3-catmull-rom.png

AviSource()
ConvertToYV24()
nnedi3_rpow2(rfactor=4, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(b=0, c=0.5, 1408, 1080)

I noticed, when we begin with a filter like Bicubic or Spline16, we haven't this problem.

See here :

http://image.noelshack.com/fichiers/2016/33/1471681753-mario-spline16-nnedi-3-catmull-rom.png

AviSource()
ConvertToYV24()
Spline16Resize(512, 448)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(b=0, c=0.5, 1408, 1080)

I know, I'm too perfectionist :p

But it's not only for Super Nes videos. I want to use this for others low resolution videos later.

I search for a natural renderer. But not too sweet (and not too sharp). It's why I want to upscale my videos :o

For the transparency of the enlargement, I exactly find that it's not so bad with the upscaling of Intel HD chipset. But I don't know where I can find a similar thing.

feisty2
20th August 2016, 09:47
xbrz(6)
xbrz(6)
BicubicResize(1408, 1080,b=-1,c=0)

http://i.imgur.com/GQCAkdn.png

SuperLumberjack
20th August 2016, 10:09
No sorry, it's too ugly ! :D

As I said, I don't like filters like emulators filters.

I low pixel art, but I don't want neither it's like Nearest Neighbor :p

I want to find the good balance. I will show you an example after ;)

SuperLumberjack
20th August 2016, 10:24
This is sweet, but is a good compromise :

http://image.noelshack.com/fichiers/2016/33/1471684649-dk3-catmull-rom-simpleresize.png

AviSource()
ConvertToYV24()
BicubicResize(b=0, c=0.5, 512, 448)
## Last=YV24
YToUV(
\ UToY.SimpleResize(1408, 1080)
\ , VToY.SimpleResize(1408, 1080)
\ , Last.SimpleResize(1408, 1080)
\ )
ConvertToRGB24()

But it's not perfect ! :(

As I said, the pincipal problem is to get a change of the aspect ratio which is looking natural :)

Like on the CRT-screen, when horizontal resolution wasn't a problem.

All the difficulty comes from the nature of the image, because it's pixel art. When we enlarge an image, we can see the loss.

It's why this upscaling Intel thing seems to be interesting (up on the thread) :p

In fact, I want to preserve the essence of the pixel art, but enhance it to a HD resolution.

It's important that in movement, it remembers the sensations of the era (especially, this real 2D effect).

SuperLumberjack
20th August 2016, 10:48
A little change :

http://image.noelshack.com/fichiers/2016/33/1471686347-dk3-not-bad.png

AviSource()
ConvertToYV24()
BicubicResize(b=0, c=0.5, 584, 448)
## Last=YV24
YToUV(
\ UToY.SimpleResize(1408, 1080)
\ , VToY.SimpleResize(1408, 1080)
\ , Last.SimpleResize(1408, 1080)
\ )
ConvertToRGB24()

It's look more pixel perfect, but there is still a little thing which looks unatural in the relief.

SuperLumberjack
20th August 2016, 11:18
Do you see what I mean by (almost) natural ? :p

http://image.noelshack.com/fichiers/2016/33/1471688014-dk3-spline16-simpleresize-catmull-rom.png

AviSource()
ConvertToYV24()
Spline16Resize(1168, 896)
## Last=YV24
YToUV(
\ UToY.SimpleResize(2816, 2160)
\ , VToY.SimpleResize(2816, 2160)
\ , Last.SimpleResize(2816, 2160)
\ )
ConvertToRGB24()
BicubicResize(b=0, c=0.5, 1408, 1080)

Original picture :

http://image.noelshack.com/fichiers/2016/33/1471688026-dk3-original-picture.png

It remembers me the original picture, but the immersion isn't perfect. It's why I need something more transparent for the change of the aspect ratio.

If somebody knows if I can find a filter like the Intel upscaling (see up in the thread). The enlargement looks almost transparent I find.

SuperLumberjack
20th August 2016, 12:49
I tried to enlarge the image in a resolution of 584x448 in the preview of VirtualDub. So the Intel HD upscaling is effective.

I just wanted to see :)

http://image.noelshack.com/fichiers/2016/33/1471693272-dk3-enlargement-in-virtualdub-intel-hd-upscaling-effective.png

After, I take a screenshot and cut the picture in Paint :

http://image.noelshack.com/fichiers/2016/33/1471693245-dk3-intel-hd-upscaling-584x448.png

I reduce the size to 292x224 :

http://image.noelshack.com/fichiers/2016/33/1471693258-dk3-intel-hd-upscaling-reduced-to-292x224.png

Original :

http://image.noelshack.com/fichiers/2016/33/1471688026-dk3-original-picture.png

When we compare to the original picture, the enlargement is almost transparent (a bit blurry, but it's very natural, and maybe it's because I started with a resolution of 584x448 and downsized) compared to others filters, don't you think ? :p

And then, I tried with the same AviSynth script :

http://image.noelshack.com/fichiers/2016/33/1471693296-dk3-avisynth.png

I should try directly in resolution 352x270 for the base. The problem is that I can't use this filter to encode videos.

SuperLumberjack
20th August 2016, 13:12
The picture in 352x270 with Intel HD upscaling :

http://image.noelshack.com/fichiers/2016/33/1471694697-dk3-intel-hd-upscaling-352x270.png

The picture upscaled to 1408x1080 just with Spline16 :

http://image.noelshack.com/fichiers/2016/33/1471694715-dk3-avisynth-2.png

I hoped something better :p But now I know :D

So, the best result for the moment is this with the original picture :

http://image.noelshack.com/fichiers/2016/33/1471688014-dk3-spline16-simpleresize-catmull-rom.png

AviSource()
ConvertToYV24()
Spline16Resize(1168, 896)
## Last=YV24
YToUV(
\ UToY.SimpleResize(2816, 2160)
\ , VToY.SimpleResize(2816, 2160)
\ , Last.SimpleResize(2816, 2160)
\ )
ConvertToRGB24()
BicubicResize(b=0, c=0.5, 1408, 1080)

So, officially, pixel perfect doesn't exist with digital resize :p

I will see if I can enhance this.

Nevilne
20th August 2016, 13:14
what are you even trying to do dude

SuperLumberjack
20th August 2016, 14:20
Hello :)

I want when I see this...

http://image.noelshack.com/fichiers/2016/33/1471688014-dk3-spline16-simpleresize-catmull-rom.png

...that it seems natural like this :p

http://image.noelshack.com/fichiers/2016/33/1471688026-dk3-original-picture.png

But it's not easy, I know :rolleyes:

(it's not the same aspect ratio)

Reel.Deel
20th August 2016, 14:22
The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors

You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:


r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)



ShowRed().ConvertToYV12() is not lossless, ShowRed("YV12") is.


r=clip.ShowRed("YV12")
g=clip.ShowGreen("YV12")
b=clip.ShowBlue("YV12")

r2=r.SimpleResize(... , ...)
g2=g.SimpleResize(... , ...)
b2=b.SimpleResize(... , ...)

MergeRGB(r2,g2,b2)

SuperLumberjack
20th August 2016, 14:36
Yes, I noticed ;) Thansk for the confirmation :)

It's why I choose YV24 :p

Reel.Deel
20th August 2016, 15:08
Yes, I noticed ;) Thansk for the confirmation :)

It's why I choose YV24 :p

If you're source is RGB then you're better off sticking with RGB. Then again I'm not really sure what you're doing. I see you're resampling 3 times? Why no just once to your final resolution? There's also no good reason to be using SimpleResize :)

SuperLumberjack
20th August 2016, 15:43
I see you're resampling 3 times? Why no just once to your final resolution? There's also no good reason to be using SimpleResize :)

It's because, as you see, I'm a complicated person :D No, seriously, I know it's a bit complicated to understand, but I want to get a natural image.

I want that the result remembers me the era where I played Super Nintendo games on a CRT :) I'm just talking about the feeling. I don't want scanlines and others things like that :p

It's complicated to have an enhanced image and to preserve this old feeling proper to these old games. I search the good balance. I tried with just one step and many filters, but I don't get this special thing :(

If you're source is RGB then you're better off sticking with RGB. Then again I'm not really sure what you're doing.

I just convert to YV24 for the SimpleResize.

YV24 is equivalent to RGB24 no ? :)

But, yes, if I don't need to convert to YV24, I prefer to stay with RGB24 ;)

Reel.Deel
20th August 2016, 16:13
It's because, as you see, I'm a complicated person :D No, seriously, I know it's a bit complicated to understand, but I want to get a natural image.

I want that the result remembers me the era where I played Super Nintendo games on a CRT :) I'm just talking about the feeling. I don't want scanlines and others things like that :p

It's complicated to have an enhanced image and to preserve this old feeling proper to these old games. I search the good balance. I tried with just one step and many filters, but I don't get this special thing :(


I just don't see how resizing 3 times helps maintain a natural image. But hey, to each is own :)

I just convert to YV24 for the SimpleResize.

YV24 is equivalent to RGB24 no ? :)

But, yes, if I don't need to convert to YV24, I prefer to stay with RGB24 ;)

To an extent, both YV24 and RGB are not subsampled but YV24 is a different color space than RGB. To avoid these unnecessary color space conversions use the example in post #25.

SuperLumberjack
20th August 2016, 17:34
Yeah, I know that it's completely subjective ;)

I just try to find the good alchemy visually :p

I tried this, and its not so bad ! :)

http://image.noelshack.com/fichiers/2016/33/1471710710-dk3-avisynth-new-script.png

The original :

http://image.noelshack.com/fichiers/2016/33/1471688026-dk3-original-picture.png

AviSource()
ConvertToYV24()
Spline16Resize(1234, 1080)
## Last=YV24
YToUV(
\ UToY.SimpleResize(2816, 2160)
\ , VToY.SimpleResize(2816, 2160)
\ , Last.SimpleResize(2816, 2160)
\ )
ConvertToRGB24()
BicubicResize(b=0, c=0.5, 1408, 1080)

But it's in movement and full screen that we see really if it's natural or not.

For the conversion RGB24 to YV24, as I said, it's just for the filters that don't support RGB24 ;)

Reel.Deel
20th August 2016, 17:54
For the conversion RGB24 to YV24, as I said, it's just for the filters that don't support RGB24 ;)

I don't think you understand what I'm saying.

AviSource() # RGB source

Spline16Resize(1234, 1080)

r = ShowRed("YV12").SimpleResize(2816, 2160)
g = ShowGreen("YV12").SimpleResize(2816, 2160)
b = ShowBlue("YV12").SimpleResize(2816, 2160)

MergeRGB(r,g,b)

BicubicResize(b=0, c=0.5, 1408, 1080)

No color space conversion.

SuperLumberjack
20th August 2016, 18:08
I understand, but the reason of the conversion with SimpleResize is that with this


## Last=YV24
YToUV(
\ UToY.SimpleResize(w, h)
\ , VToY.SimpleResize(w, h)
\ , Last.SimpleResize(w, h)
\ )

I get better quality than this :

## Last=RGB24
MergeRGB(
\ ShowRed ("YV12").SimpleResize(w, h)
\ , ShowGreen("YV12").SimpleResize(w, h)
\ , ShowBlue ("YV12").SimpleResize(w, h)
\ )

You can try. It's more blurry with RGB ;) I don't know why. I thought maybe there is a conversion RGB24 to YV12 and YV12 to RGB24. So there is a loss of definition for the chroma. Isn't it that ?

Reel.Deel
20th August 2016, 18:24
You can try. It's more blurry with RGB ;) I don't know why. I thought maybe there is a conversion RGB24 to YV12 and YV12 to RGB24. So there is a loss of definition for the chroma. Isn't it that ?

No there is no RGB to YV12 conversion happening. I tried it with both methods and I do not see any visual difference. Although the suggested method is a bit more accurate since there's no RGB --> YUV --> RGB conversion. Anyways, Groucho2004 gave you solid advice (http://forum.doom9.org/showthread.php?p=1777336#post1777336) in another thread. Use AviSynth's internal resizers instead! There's no reason to be using SimpleResize(). Good luck :)

SuperLumberjack
20th August 2016, 20:16
Thanks ! ;)

But with the internal resizers only, I didn't get what I research.

It's in the movement that there is a big difference.

I'm doing a video that I will upload on YouTube to show you differents resultats of the scripts I already did the other days.

raffriff42
20th August 2016, 20:24
I want that the result remembers me the era where I played Super Nintendo games on a CRT :)
I'm just talking about the feeling. I don't want scanlines and others things like that :pWell I'm gonna suggest scanlines anyway, because AFAIK there is no filter for "feeling."
http://forum.doom9.org/showthread.php?t=170732
https://www.dropbox.com/s/52biuuwy64smlxg/SuperNES-crt_display-crop.jpg?raw=1
(cropped to save bandwidth because the image is not very compressible)
LoadPlugin(pathBase + "MaskTools2\tp7masktools\masktools2.dll")
Import(pathBase + "Dither\v1.27.1\dither.avsi")
Import(pathBase + "crt_display\crt_display.avsi")

ImageSource("SuperNES-originale-basse-definition.png", pixel_type="RGB32")

par = 8.0 / 7.0 ## Pixel Aspect Ratio
crt_display(4*par, 4, ppp=2*par, maskpp=2, blurh=1.1,
\ vcs=0.071, cromaclear=1, scandist=1.5, glowgain=0.5,
\ glowh=2, glowv=0.5, halgain=0.03, cutoff=0.9)
return Last


More on CRT artifacts:
http://bogost.com/games/a_television_simulator/

SuperLumberjack
20th August 2016, 20:33
Whaou ! It's strong ! :p

Thanks raffriff42 ;) Maybe I will try, juste for fun ! :)

SuperLumberjack
21st August 2016, 00:21
Here is a video to show you what are the sensations in movement :p :

https://youtu.be/-Q6fyxXDTJU

For each script, a different feeling ! ;)

But the purest feeling is with the original resolution. It's what I try to retrieve in HD.

SuperLumberjack
21st August 2016, 10:06
Do you like ? :p

What script ? One in particular ? All ? Nothing ? :D

StainlessS
21st August 2016, 13:17
SuperLumberjack, I'm not sure what you want either, no idea how you measure this 'feeling' thing.

But curious to know what does the below plugin 'feel' like ?
(~40KB)
http://www.mediafire.com/download/1d8383ginz38ek5/Rgb_Test_v0.0_dll_20160329.zip

Plug was hacked up some time ago (will be quite slow), to try and bring out some detail from a car number plate, (burglar driver),
dont bother with the r,g,b modification stuff, just resizing arg SZ.

Doc supplied in zip (zip incl source)



Rgb_Test(clip c, Int "SZ",float "Rr"=1.0,Float "Rg"=0.0,Float "Rb"=0.0,
\ float "Gr"=0.0,Float "Gg"=1.0,Float "Gb"=0.0,float "Br"=0.0,Float "Bg"=0.0,Float "Bb"=1.0)

Filter to both upsize clip and modify R,G,B, RGB24 ONLY, null audio.

Output frame is c.Width*SZ x c.Height*SZ pixels, RGB24.
Views source frame as a c.Width*SZ x c.Height*SZ frame of micropixels where each source pixel is SZxSZ micro pixels.
Each output pixel is result of summing SZxSZ source micropixels.
The R,G and B channels are modified via the other arguments,
eg red component comes from Int((rSum * Rr + gSum * Rg + bSum * Rb) / (SZ*SZ) + 0.5) # Range 0 -> 255.0 if Rr+Rg+Rb sum to 1.0)
The result pixel Red channel is then limited to range 0->255.
Same for the other channels.

Defaults:

SZ = 5, output clip 5x5 size of input clip. Range ODD ONLY, 1 -> 9. (1=No resize)

Rr = 1.0 Rg = 0.0 Rb = 0.0 Should sum to 1.0 (valid -3.0 to 3.0)
Gr = 0.0 Gg = 1.0 Gb = 0.0 Should sum to 1.0 (valid -3.0 to 3.0)
Br = 0.0 Bg = 0.0 Bb = 1.0 Should sum to 1.0 (valid -3.0 to 3.0)


Suggest something like RGB_Test(5) # or RGB_Test() as SZ=5 is default.

SuperLumberjack
21st August 2016, 13:48
Thanks ! ;)

But I didn't understand everything :o

Have you an exemple with an output resolution of 1408x1080 please ? :)

StainlessS
21st August 2016, 14:03
Just do something like

#ImageSource("1471688026-dk3-original-picture.png",end=0)
ImageSource("1471598760-dk3-image-originale-basse-definition.png",end=0)

RGB_test()


EDIT: Output would be 256*5=1280, * , 224*5=1120. (Not exactly what you want, but how does it feel this rez).

SuperLumberjack
21st August 2016, 14:11
In fact, I didn't understand how to do the entire script :D It's mysterious for me :p

StainlessS
21st August 2016, 14:30
As I said previously, the plugin was created to try to bring out detail on a car number plate, a Doom9 user had been robbed by a burglar,
but the user had captured footage of the burglar's vehicle.

The r,g,b stuff is irrelevant here, just ignore it. Only the SZ arg is of any use and multiplies the original size in odd number steps from
1 (no change) up to 9 where result would be 9*Original_Width x 9*Original_Height.

I only posted because the result of SZ=5, seemed to me, quite like what you were describing as 'feeling' good.
A further resize using point resize or whatever would be needed to convert to final requirement.

EDIT: Resize, and/or Addborders.

EDIT:
Below resizer, thick black lines mark original source pixels.
Thin (dotted) black lines mark the output pixels (where SZ=5).
The red square is an OUTPUT pixel, and is sum of the input micro pixels marked in purple (but then divided by SZ*SZ).

https://s20.postimg.org/ber0uouil/grid_zpscaoyn4xw.jpg (https://postimg.org/image/ngmeou3qx/)

EDIT: AVS script to create grid using Grid() by V.C Mohan (colored in by hand)

SZ=5
BlankClip(Width=256,height=256,color=$FFFFFF)
grid(Bold=SZ,vbold=1)


EDIT: Perhaps above is identical to BiLinearResize where output dimensions are exact ODD multiple of input dimensions.
I have never looked at any resize code before, so no idea if same (The original reason for doing as above was to
achieve the color mods simultaneous to resize and without any additional error due to rounding).

SuperLumberjack
21st August 2016, 16:16
As I said previously, the plugin was created to try to bring out detail on a car number plate, a Doom9 user had been robbed by a burglar,
but the user had captured footage of the burglar's vehicle.

The r,g,b stuff is irrelevant here, just ignore it. Only the SZ arg is of any use and multiplies the original size in odd number steps from
1 (no change) up to 9 where result would be 9*Original_Width x 9*Original_Height.

I only posted because the result of SZ=5, seemed to me, quite like what you were describing as 'feeling' good.
A further resize using point resize or whatever would be needed to convert to final requirement.

EDIT: Resize, and/or Addborders.

EDIT:
Below resizer, thick black lines mark original source pixels.
Thin (dotted) black lines mark the output pixels (where SZ=5).
The red square is an OUTPUT pixel, and is sum of the input micro pixels marked in purple (but then divided by SZ*SZ).

http://i1136.photobucket.com/albums/n494/StainlessStephen/grid_zpscaoyn4xw.jpg

EDIT: AVS script to create grid using Grid() by V.C Mohan (colored in by hand)

SZ=5
BlankClip(Width=256,height=256,color=$FFFFFF)
grid(Bold=SZ,vbold=1)


EDIT: Perhaps above is identical to BiLinearResize where output dimensions are exact ODD multiple of input dimensions.
I have never looked at any resize code before, so no idea if same (The original reason for doing as above was to
achieve the color mods simultaneous to resize and without any additional error due to rounding).

Thanks. I will try maybe ;)

The right way to judge an upscaler IMHO (not talking about Super NES or other pixel-art sources for the moment) is to take a good quality test source, downscale it (say from 1080p to 720p), re-upscale it, and compare to the original. That way you know what a "perfect" upscale should look like.

Here is a script that does that test by flipping between a selection of upscale filters (which you can change of course). I won't post my personal conclusions, because I don't expect to change anybody's mind. Judge for yourself. ## downscale/upscale test ...
## (add, remove or rewrite upscaler tests as you wish)

## current dependencies = MaskTools2, nnedi3, SimpleResize, AviSynthShader

## <view in frame jog mode only>

<Last=YV12>
O=Last
w=Width
h=Height

## downscale (emulate 1080b->720p or 720p->480p with typical bicubic)
BicubicResize(Round(0.667*w), Round(0.667*h))

## compare upscale methods:
return Interleave(
\ O.Subtitle("org", size=14, align=5)
\
\ , BicubicResize(w, h, b=0, c=0.5)
\ .Sharpen(0.8)
\ .Subtitle("Bicubic+Sharpen", size=14, align=5)
\
\ , Spline64Resize(w, h)
\ .Sharpen(0.8)
\ .Subtitle("Spline64Resize+Sharpen", size=14, align=5)
\
\ , SimpleResize(w, h)
\ .Sharpen(0.8)
\ .Subtitle("SimpleResize+Sharpen", size=14, align=5)
\
\ , nnedi3_rpow2(
\ 2, nns=4, qual=2, cshift="BicubicResize",
\ fwidth=w, fheight=h)
\ .Sharpen(0.8)
\ .Subtitle("nnedi3+Sharpen", size=14, align=5)
\
\ , SuperRes(Passes=2, Str=1.00, Soft=0.0,
\ Upscale="""nnedi3_rpow2(2, nns=4, cshift="BicubicResize", """
\ + "fwidth="+String(w)+", fheight="+String(h)+", Threads=2)",
\ PlanarOut=false)
\ .Sharpen(0.8)
\ .Subtitle("SuperRes+Sharpen", size=14, align=5)
\ )


Thanks ;) Yes, generally I do like that to compare with the upscale and the originale video. But here, it's more complicated because it's not a multiple of the original resolution and I must strech the image to change the aspect ratio :(So It doesn't match perfectly with the originale. But I try somme things :)

I'll be back later :p I must move a bit :D

raffriff42
21st August 2016, 17:27
Thanks ;) Yes, generally I do like that to compare with the upscale and the originale video. But here, it's more complicated because it's not a multiple of the original resolution and I must strech the image to change the aspect ratio :(So It doesn't match perfectly with the originale. But I try somme things :)You are right, my post did not apply to your case. Which is why I moved it to a different thread (http://forum.doom9.org/showthread.php?p=1777884#post1777884).

SuperLumberjack
21st August 2016, 18:41
But it's still a good advice ;)

SuperLumberjack
21st August 2016, 18:49
I tried the Grid StainlessS, but I just have a grid :D

I really don't understand how it works :p

Edit : I think I understand the role of this filter now :) I thought it was for an other thing. It's a good idea ;)

MysteryX
21st August 2016, 19:50
it's more complicated because it's not a multiple of the original resolution and I must strech the image to change the aspect ratio :(So It doesn't match perfectly with the originale.
I haven't read the whole conversation but that's not a problem. Upscale more and then downscale into the desired proportion.

SuperLumberjack
21st August 2016, 19:54
Hello.

Yes, it's what I usually do ;) But it's not pixel perfect. The depth of the image change a bit.

SuperLumberjack
21st August 2016, 23:25
I thought one thing when I saw this video (very interesting :) ) :

https://youtu.be/RAi8AVj9GV8

The feeling is associated to the technology of the era too.

The scanlines give to the image an illusion of more 3D and definition.

So my last scripts are more in this direction and I tried to get more relief, but without scanlines. I will upload a new video where we see the effect of the scanlines too :p

But I had to upsize the image 4X because I lost a lot with the colors after the convertion of RGB24 to YV12. In RGB24, we see better the benefit of scanlines in this lower resolution :

http://image.noelshack.com/fichiers/2016/34/1471818152-donkey-kong-country-3-scanlines.png

And I used the trick of the grid for the last script of my video. It's very useful ! ;)