Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
24th June 2016, 17:48 | #1 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
DitherPost Image Corruption
I have this script working fine.
Code:
ColorBarsHD(200, 200) ResizeShader(600, 500, kernel="bicubic") This also works fine, which means the output of the first resize gives a valid output Code:
ColorBarsHD(200, 200) ResizeShader(800, 600, kernel="bicubic", lsb_out=true) ResizeShader(600, 500, kernel="bicubic", lsb_in=true) Code:
ColorBarsHD(200, 200) ResizeShader(600, 500, kernel="bicubic", lsb_out=true) DitherPost(mode=6) The only thing I could think about is that values outside the 16-235 range could confuse DitherPost. I added a Clamp between 50 and 200 within the shader. Some colors were gone but the weird image corruption was still there! This is the only thing I found to work Code:
ColorBarsHD(200, 200) ResizeShader(600, 500, kernel="bicubic", lsb_out=true) Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y", lsb_in=true) r = SelectEvery (3, 0) g = SelectEvery (3, 1) b = SelectEvery (3, 2) Dither_convert_rgb_to_yuv (r, g, b, matrix="709", lsb=true) DitherPost(mode=6)
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 27th June 2016 at 04:34. |
27th June 2016, 03:54 | #3 | Link |
Registered User
Join Date: Dec 2015
Posts: 59
|
as it seems to me, that "corruption" is more like a moral judgement, first thing I would ask you - to define what you deem wrong in the result, using very specific and purely technical expressions.
second, I would anticipate the first posted picture to have 800*600px, and the second, 600*500px. the current difference is too small to be an issue to me, it just seems one has a tad brighter colors. |
27th June 2016, 04:31 | #4 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
I'll confess when I looked at the images my reaction was "what corruption?" but I refrained from asking in case doing so eventually made me look silly.
There's a tiny difference in colour (or probably more accurately, luminance or gamma), but isn't that somewhat normal when resizing? The scripts indicate different resizing while the screenshots are the same resolution and that may have been a typo but it was too confusing for my poor brain. |
27th June 2016, 04:33 | #5 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
That a typo When I originally posted it, the internet went down and the whole post was lost. I retyped it quickly but that error leaked in. Fixed the scripts.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 27th June 2016 at 04:36. |
|
28th June 2016, 02:33 | #6 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Curious. I tried magnifying the distortion to make it more visible. If I change brightness/constrast, or if I upscale the image in Photoshop, the distortion lines disappears. I can't make a more visible version of it.
It's most visible in the lower-right corner of the picture I posted. |
28th June 2016, 03:22 | #7 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Dither is doing exactly what it is designed to do.
Perhaps this will help - first image, cropped and enlarged 4x (click to view in a new tab) Second image, cropped and enlarged 4x. Can't see the difference? Click here. EDIT I suspect you are seeing some interaction between the dither pattern and your screen. Last edited by raffriff42; 16th March 2017 at 23:11. Reason: (fixed image links) |
28th June 2016, 05:57 | #8 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Here's a way to see the difference. Looking at the raw Stack16 data before DitherPost.
Code:
// distortion ColorBarsHD(200, 200) ResizeShader(600, 500, kernel="bicubic", lsb_out=true) Code:
// OK ColorBarsHD(200, 200) ResizeShader(600, 500, kernel="bicubic", lsb_out=true) Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y", lsb_in=true) r = SelectEvery (3, 0) g = SelectEvery (3, 1) b = SelectEvery (3, 2) Dither_convert_rgb_to_yuv (r, g, b, matrix="709", lsb=true) |
29th June 2016, 05:23 | #9 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
It may not be a big issue, but closing my eyes on that one can lead to other problems. I think that many C++ and especially ASM programmers around here are familiar with that truth. |
|
29th June 2016, 05:26 | #10 | Link |
Registered User
Join Date: Dec 2015
Posts: 59
|
What disturbs me most, is the color subsampling and the "Gibb" with it.
Frequency spectrum among the two is definitely different, the halos have different width and intensity. The spectral transfer diagram is quite important to judge influence on noise. E.g. after the dithering to do some filtering again is likely to have chaotic results on the appearance of the noise. Last edited by geometer; 29th June 2016 at 05:32. |
29th June 2016, 06:39 | #11 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Quote:
The chroma is softer in the second image, as would be expected from the extra processing. A simple bicubic resize looks slightly better (IMHO), I'm sorry to say. Code:
## "16bit bicubic" ColorBarsHD(200, 200) Dither_convert_8_to_16 Dither_resize16(600, 500, kernel="bicubic") DitherPost Last edited by raffriff42; 29th June 2016 at 06:49. |
|
29th June 2016, 07:22 | #12 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I'm only using Bicubic in both cases.
Quote:
Why would this work while doing the Bicubic via ResizeShader result in output distortion? Is it only "random luck based on subtle difference"? Copy/paste the image into Photoshop and you'll see the problem instantly gets worse (??) |
|
29th June 2016, 09:22 | #14 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I'm testing it again with v1.5.1 (just released) and I'm not seeing the same distortion anymore. Not sure what changed.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 29th June 2016 at 09:41. |
|
|