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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th April 2015, 13:30   #1  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Lossless upscaling and downscaling

Do you know some upscaling that keeps every detail, even the finest? You know some upscaling that adds true detail in final image (True detail, not noise)?
You know some downscaling that preserves all detail, even the finest?

Thank you.

Last edited by luquinhas0021; 15th April 2015 at 13:33. Reason: Error
luquinhas0021 is offline   Reply With Quote
Old 15th April 2015, 13:53   #2  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
pointresize
feisty2 is offline   Reply With Quote
Old 15th April 2015, 14:07   #3  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Its impossible to downscale and preserve "all" detail. The final image is smaller, therefor it won't be "lossless", and detail has to be dropped.
For upscaling, even though pointresize is technically "lossless", the resulting aliasing artifacts will not make for a pleasant image.

Resampling an image, up or down, is always a excercise in compromise. Retention of detail (aka sharpness) vs. reducing aliasing and ringing.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 15th April 2015, 14:28   #4  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Downscaling is not possible in a lossless manner.

Upscaling is however possible, if the image is an integer multiple - for instance a pixel in the original image corresponds to 4 (2x2) or 9 (3x3) and so one pixels in the new image. Unless the viewing distance is increased, the visual appearance is bad - interpolation algorithms are way better.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 15th April 2015, 15:07   #5  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Lossless upscaling or downscaling

Ghitulescu, is there loss of details when upscaling is a decimal multiple of source image? If yes, it must be because there is change of proportion of each patch of pixels, right?
Will downscaling to be lossless neither if I put image (Including its textures) on vector plane, to do downscaling and then back it for pixel values?
I didn't know point resize was lossless, but I already saw that alias image, but, anyway, Update: I've tested point resize. In fact, it introduces some aliasing and some blocking, but is neither so much and, taking off all this artifacts, without perceptive sharp loss, the result gets good.
Is Spline 100 lossless? I am asking because I've tested it and the results got better even than NNEDI3 under better parameters. And Spline 100 is the best Spline interpolation method, because makes the most sharpened results, without perceptible artifacts, unless those already was in image, but is well smooth. NNEDI3 is so slow, and a little unstable. Someone here knows if NeuronDoubler is top?
Now, about upscaling with true detail add: is there some? (True detail isn't seem like image noise)
Answer me all question, please!

Thank you

Last edited by luquinhas0021; 15th April 2015 at 16:01.
luquinhas0021 is offline   Reply With Quote
Old 15th April 2015, 16:05   #6  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
spline 100? are you talking about 5 taps spline? it can be even sharper, let's say 100 taps (spline40000), it would be slow like hell and produce hell lot of ringings to your upscaled image, so more taps is not always better
resizers other than pointresize = pointresize + convolution, pointresize is lossless, convolution is not, end of the story
"upscaling with true detail add"...? yeah, that, that, that's THE RESIZER everyone wish he has, shame no one ever manages to make one.. maybe we'll have it with AI algorithms in the future
feisty2 is offline   Reply With Quote
Old 15th April 2015, 16:25   #7  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by feisty2 View Post


resizers other than pointresize = pointresize + convolution, pointresize is lossless, convolution is not, end of the story
"upscaling with true detail add"...? yeah, that, that, that's THE RESIZER everyone wish he has, shame no one ever manages to make one.. maybe we'll have it with AI algorithms in the future
If you had written «digital sorcery» instead of "A.I.",
then I might agree with you
filler56789 is offline   Reply With Quote
Old 15th April 2015, 18:18   #8  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
Quote:
Originally Posted by feisty2 View Post
resizers other than pointresize = pointresize + convolution
nope interpolation (bicubic/spline/lanzcos) works with interpolation polynomials.
__________________
powered by Google Translator
Motenai Yoda is offline   Reply With Quote
Old 15th April 2015, 18:44   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Motenai Yoda View Post
nope interpolation (bicubic/spline/lanzcos) works with interpolation polynomials.
If I'm understanding this correctly, lanczos is a windowed sinc, so clearly not polynomial (it got a "sin(x)" within)
And despite if the kernel (cubic, sinc, spline...) is polynomial or not, the actual process is blow the image up with pointresize first, and smooth the aliasings with a kernel next, and how that kernel works is convolve the image with the kernel function, so, a convolution, that's what i always thought about resizing, but correct me if I got the whole idea wrong
feisty2 is offline   Reply With Quote
Old 15th April 2015, 19:23   #10  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Explain

Feisty2, I talked about Spline 5 taps.
About upscaling with true details add... Wait the scenes of next chapters. No lies.
luquinhas0021 is offline   Reply With Quote
Old 18th April 2015, 10:01   #11  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Your posts are moderately incoherent so don't mind me if I'm misinterpreting them.

Quote:
Ghitulescu, is there loss of details when upscaling is a decimal multiple of source image? If yes, it must be because there is change of proportion of each patch of pixels, right?
No, there will never be a loss of detail with nearest neighbour upsampling. It's just that nearest-neighbour upsampling by a noninteger factor makes things look visually bad.

Quote:
Will downscaling to be lossless neither if I put image (Including its textures) on vector plane, to do downscaling and then back it for pixel values?
No, for the reason nevcairiel mentioned. It doesn't matter what algorithm is being used; a counting argument shows that this is impossible.

Quote:
Is Spline 100 lossless? I am asking because I've tested it and the results got better even than NNEDI3 under better parameters. And Spline 100 is the best Spline interpolation method, because makes the most sharpened results, without perceptible artifacts, unless those already was in image, but is well smooth.
Depends on (a) your definition of "lossless" and (b) how exactly you're resampling. (Mathematically, it's an overdetermined linear system and hence reversible; practically, the limited numerical precision makes this not quite correct.) Though the more important question here really should be: why do you care about losslessness when it seems that your main priority is a nice-looking result?

Quote:
Now, about upscaling with true detail add: is there some? (True detail isn't seem like image noise)
For every possible detail that can be added to an image on upscaling, there are infinitely many other possible details that can be added. Since there's no unique way of adding detail, we shouldn't expect any upscaling algorithm to be able to make this arbitrary decision.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline   Reply With Quote
Old 18th April 2015, 10:06   #12  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by feisty2 View Post
And despite if the kernel (cubic, sinc, spline...) is polynomial or not, the actual process is blow the image up with pointresize first, and smooth the aliasings with a kernel next, and how that kernel works is convolve the image with the kernel function, so, a convolution, that's what i always thought about resizing, but correct me if I got the whole idea wrong
Terminology weirdness aside, this is half correct. The image isn't blown up with a box filter; it's filtered directly.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline   Reply With Quote
Old 18th April 2015, 11:53   #13  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by colours View Post
Terminology weirdness aside, this is half correct. The image isn't blown up with a box filter; it's filtered directly.
you are right, did some more search on Wikipedia and found new pixels are the weighted averaged results of the pixels around them, never again will I just take words from others only because they seem somehow reasonable, yeah, screwed up by rumor yet again.
feisty2 is offline   Reply With Quote
Old 18th April 2015, 21:42   #14  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Colours, I don'r express myself good when I said loss of details when I do a upscaling of decimal factor (Like 1.5 x 1.5 times). Really, the proportions of "lines" of every patch of pixels changes (Example: 1920 x 1080 (1:1.7778)) to 2048 x 1080 (1:1.896)), but, in fact, the details are stretched.
I'm not totally convinced that there's no way of exist some lossless downscaling, neither by to vector space conversion of image.
About true detail add upscaling... There's way of, at least, suppose the new details: if you consider every pixel just like a color, and this color is the mix of n other details (Other colors) and consider that the frame, whatever, is a image in real world and it is being seen by a human. As you might know, the human eye (Specifically the fovea centrallis) has a angular resolution that depends of wavelength and contrast, but, anyway, when I come n times closer, I will see n times more details, taking those initial dot. I considered just one eye because the image in computer is 2D (The 2 eyes, together, see 3D images). And I'm considering that all image is seen in fovea centrallis. This is impossible in practice, but is ideal, ideal for my idea and doesn't introduces artifacts (lol).
I can restrict the uncountable possibilities for the n other details that comes from one color when i do the neighborhood analysis. But, pay attention, for this method works well, is necessary a so fine Edge detector algorithm or a sum of information (True edges) of various edge detectors (And delete the artifacts that one Edge detector detects, but other doesn't, knowing that one type of edge detector detects some type (s) of artifact (s). The neighborhood analysis will be done in pixel that compose the edge, each one. Another neighborhood analysis will be done in pixel that are included in the edge . It's like a internal area of a circle. The question is if is necessary create new edges, and, if yes, where: included in pre-existent edge or in internal area of it, if exist it, course. Other question is what format of new edges will have.
Ben, I am still working on principle of my method, so i wish you help me with it, especially you, Colours, because you seem to be so wise.
Which the best edge detector? If not exist the best in every cases, which is the best in detect one and other type of edge?
Is there some edge detector that doesn't detect artifacts (Noise, aliasing, ringing, halo, jaggies,...)?
luquinhas0021 is offline   Reply With Quote
Old 19th April 2015, 07:14   #15  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by luquinhas0021 View Post
I'm not totally convinced that there's no way of exist some lossless downscaling, neither by to vector space conversion of image.
Okay, here's the counting argument. Say you have a picture with N samples (e.g. N = 3110400 for 1920×1080p YV12), and you want to reduce it to any fewer number of samples, M < N. There are 256^N possible input pictures, and there are 256^M output pictures, and since the latter is a smaller number, there can be no injective (or invertible) function from the set of N-sample pictures to any subset of the set of M-sample pictures.

It doesn't matter what kind of function you come up with. The pigeonhole principle denies you.

Now, it does turn out that if you try to vectorise a picture with a sufficiently sophisticated algorithm, you can indeed (sometimes) store the original picture with fewer bits than storing individual pixels. But this is just the concept of lossless compression. It doesn't mean that you can rasterise the vectors at a lower resolution, re-vectorise this, and then re-rasterise at a higher resolution to get back the original. The first rasterisation step is already lossy, thanks to the pigeonhole principle.

Quote:
Originally Posted by luquinhas0021 View Post
About true detail add upscaling... There's way of, at least, suppose the new details: if you consider every pixel just like a color, and this color is the mix of n other details (Other colors) and consider that the frame, whatever, is a image in real world and it is being seen by a human.
Let's be clear here. Do you mean a convex combination, or just a "mix" in general? In the latter case, you could mix 0 and 1 to get any real number at all, and perhaps you don't already know this, but pretty much every decent rescaling/resampling algorithm uses nonconvex combinations.

Quote:
Originally Posted by luquinhas0021 View Post
The 2 eyes, together, see 3D images
No. Two eyes see two 2D images.

Quote:
Originally Posted by luquinhas0021 View Post
I can restrict the uncountable possibilities for the n other details that comes from one color when i do the neighborhood analysis.
You "can", but only in the sense that you have a non-uniform probability distribution for each sample based on some model you have of images. Which is not saying a lot, and brings me back to the exact same point I mentioned before: how can an algorithm magically know, given your model, which of these possibilities for each sample is the correct one? You could add detail, sure, but this detail would be meaningless unless it actually corresponds to, you know, real detail. And not something your algorithm pulled out of its arse.

Quote:
Originally Posted by luquinhas0021 View Post
But, pay attention, for this method works well, is necessary a so fine Edge detector algorithm or a sum of information (True edges) of various edge detectors (And delete the artifacts that one Edge detector detects, but other doesn't, knowing that one type of edge detector detects some type (s) of artifact (s). The neighborhood analysis will be done in pixel that compose the edge, each one. Another neighborhood analysis will be done in pixel that are included in the edge . It's like a internal area of a circle. The question is if is necessary create new edges, and, if yes, where: included in pre-existent edge or in internal area of it, if exist it, course. Other question is what format of new edges will have.
I'm not sure what you're getting at here, but there's already a wealth of literature regarding edge-directed interpolation and the like.

Quote:
Originally Posted by luquinhas0021 View Post
Which the best edge detector? If not exist the best in every cases, which is the best in detect one and other type of edge?
Is there some edge detector that doesn't detect artifacts (Noise, aliasing, ringing, halo, jaggies,...)?
Rule 12. Also, I don't recall if I bothered elaborating on this in the other thread, but a perfect edge detector basically cannot exist. Don't ask for the impossible.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!

Last edited by colours; 19th April 2015 at 07:17.
colours is offline   Reply With Quote
Old 19th April 2015, 15:24   #16  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
No, Colours, the vision proportioned by two eyes together, and interpreted by the visual cortex, in brain, gives a 3D vision of the world. It's the stereoscopic vision.

The concept of mixing colors isn't mathematical itself, it's fisical.
Look at the color in extreme left (1 x 1) and compare it with 2 x 2 image. Looks like colors were demixed from 1 x 1 to 2 x 2, isn't? When we compare 2 x 2 and 5 x 5 image, we see white pixels. But white isn't seemed with blue. This makes me believe that when i have a upscaling of non-integer factor (Like 2 x 2 to 5 x 5; 5/2 = 2.5. So the upscaling is 2.5 times on line and 2.5 times on column), when we demixe the colors, the result is of image same colors pixels, but different intensities, and of image different colors pixels. If we don't want make mistake (Or intolerable mistake!), we talk the different colors are, usually, white or grey. It's clear it's just a example, but gives an idea of general. This images show us the bigger upscaling factor is, minor is the chance of suppose correctly the details.
Ben, i understood that doesn't exist a perfect edge detector.

My English still isn't very good. And i will continue improving my idea.
luquinhas0021 is offline   Reply With Quote
Old 19th April 2015, 16:00   #17  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
and how are you planning to "demix" a color?
it's like a single equation (the color you wanna demix) with a lot of unknowns (the target image you'd like to get)
the equation you get is actually a curve running through a high dimensional space (the space would have dimensions the same amount of the unknowns in the equation)
you'll never get a constant solution from it
feisty2 is offline   Reply With Quote
Old 19th April 2015, 16:19   #18  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
If I consider the color like being a sinusoidal wave, I can decompose that in it components using Fourier Transform. So the result won't be contant, but any result (Any demix) will be in result of Fourier Transform. Like I say, this project is still in beginner stage. I subscribe me in this forum for get help.
So i wish you, Colours and whoever that know about help me.
luquinhas0021 is offline   Reply With Quote
Old 19th April 2015, 16:39   #19  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
A real and mathematically possible "color demixer" is a deconvolution algorithm, it's been used to "refocus" blurry photos. But still you can't use it to upscale images, it's like a sharp and detailed photo got blurred by some filter, now pixels in this blurred photo got smaller differences than the original one cause pixels were "mixed" with each other (but still they got different values, just the difference got smaller), and a deconvolution algorithm can "demix" these pixels and restore them to their original status. But it won't work on upscaling cause you don't have that many pixels to do it.
feisty2 is offline   Reply With Quote
Old 19th April 2015, 16:52   #20  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Ben, I'm not talking you are stupid, but, how says, one image worth it more than one thousand of words. In that case, more than one image! It's clear, especially in n x y to kn x ky upscaling (K is natural number), that the k x k resultant colors of one color included in n x y colors, are a demix of one that color (Or some so close to demix), and, somehow, the demix has some relationship with neighborhood. So I (Or we) have to know what is this relation and how colors are demixed.
I won't give up on my idea.
luquinhas0021 is offline   Reply With Quote
Reply

Tags
detail preserving, lossless, upscaling

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:22.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.