Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformNode ScaleDown issue #258

Closed
mifth opened this issue Oct 7, 2014 · 26 comments
Closed

TransformNode ScaleDown issue #258

mifth opened this issue Oct 7, 2014 · 26 comments
Assignees
Milestone

Comments

@mifth
Copy link

mifth commented Oct 7, 2014

Hi again.

I found some issues with TransformNode.

  • ScaleDown looks very sharpen and some artifacts appear for small scale sizes.
  • Rotation makes no antialiasing for image's edges. It's especially seen if we scaleDown and rotato to30 degrees.

Nuke: http://i.imgur.com/X6Ef9aX.png
Natron: http://i.imgur.com/u8NIKUK.png
Project: https://dl.dropboxusercontent.com/u/26887202/Natron/test_transforme2.zip

@MrKepzie
Copy link
Owner

MrKepzie commented Oct 7, 2014

Have you compared against Nuke with the exact same settings (especially the Cubic filter) ?
On 7 Oct 2014, at 14:57, mifth [email protected] wrote:

Hi again.

I found some issues with TransformNode.

ScaleDown looks very sharpen and some artifacts appear for small scale sizes.
Rotation makes no antialiasing for image's edges. It's especially seen if we scaleDown and rotato to30 degrees.
Screen: http://i.imgur.com/u8NIKUK.png
Project: https://dl.dropboxusercontent.com/u/26887202/Natron/test_transforme2.zip


Reply to this email directly or view it on GitHub.

@mifth
Copy link
Author

mifth commented Oct 7, 2014

Yes, Nuke is ok about these issues. http://i.imgur.com/X6Ef9aX.png
ScaleDown is smooth. Rotation has antialiasing at the corners/edges.

@mifth
Copy link
Author

mifth commented Oct 7, 2014

Here is the nuke project for testing http://pastebin.com/nW5pbwLp

@MrKepzie
Copy link
Owner

MrKepzie commented Oct 7, 2014

Did the problem exist in RC1 already ? Or we introduced the bug ?
On 7 Oct 2014, at 15:34, mifth [email protected] wrote:

Here is the nuke project for testing file:///home/mifth/Desktop/123/test.nk


Reply to this email directly or view it on GitHub.

@mifth
Copy link
Author

mifth commented Oct 7, 2014

I dunno know. i have just noticed it today. i use autobuild.

@MrKepzie
Copy link
Owner

MrKepzie commented Oct 8, 2014

Nuke seems to in fact apply a pre-blur when downscaling, same as when resizing. We recommend using a blur before downscaling heavily (that's what Nuke does internally).
If you just want to resize, use ResizeOIIO that's better suited for the job.

@MrKepzie MrKepzie closed this as completed Oct 8, 2014
@mifth
Copy link
Author

mifth commented Oct 8, 2014

@MrKepzie this is very vital bug. In other way it will be not possible to downscale any images in Natron. To get pro quality.

If you take the image from the archive and downscale it in any editor like PS/Gimp/Krita/Nuke/Fusion - you will get smooth good quality downscale. This is very important feature as it's usable most time. Belive me this is important to have good downscale quality.

Blur - is not solvation. Thare are already many downscale formulas for images.

Just take a look how scale looks in Gim for example and in Natron:
http://i.imgur.com/FjNw4ly.png
http://i.imgur.com/u8NIKUK.png

This is very very very important to fix.
Could you reopen the issue?

@mifth
Copy link
Author

mifth commented Oct 8, 2014

We need to get the same Downscale quality like other apps have.

@devernay
Copy link
Collaborator

devernay commented Oct 8, 2014

I wouldn't consider this to be either a bug or very very very important, since anyone can do a blur or a resize before applying the Transform, and get even better control on the quality.
Transform does what it says it does, no more no less.
An average-quality solution is to automatically apply resize or blur before transform, but in some cases it fails (as in case of perspective effects). Nuke does this, and I can easily show you how it fails (do a cornerpin with a very small side and a very large one).
A better solution would be to implement mipmapping: a pyramid of images is built, and the correct levels are selected for interpolation, then the values are interpolated linearly between levels. This requires major code modifications.
Reopening as feature request for 1.1 (or 2.0)

@devernay devernay reopened this Oct 8, 2014
@devernay devernay added this to the 1.1 milestone Oct 8, 2014
@mifth
Copy link
Author

mifth commented Oct 8, 2014

Thanks for reopening.

if i want to animate and object which will appear fom distant space - it will be important. And there are many other cases that will need quality of downscale.

As a digital artist i can say that this is important.

You can also ask any studio professionals. I'm sure they will say that they downscale many images in Nuke/Fusion on their daily job.

Mipmapping will solve it. In Krita there was mipmapping issue with downscaling about a hoalf year ago. Dmitry Kazakov implemented super cool mipmapping quality into Krita.

You can also contact to Krita guys in their IRC room. If you need any help.

@mifth
Copy link
Author

mifth commented Oct 8, 2014

Also, about mipmaps i would like to add.
I think it's possibly to generate mipmaps in OpenGL. As all 3D games have mipmaps for textures which are generated by OpenGL.

Here is automatic mipmaps generation in Opengl:
https://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
http://www.g-truc.net/post-0256.html

Also, there are many other articles/code in google.

And GPU mipmaps are fast.

@MrKepzie
Copy link
Owner

MrKepzie commented Oct 8, 2014

We already have mipmap code in Natron when downscaling images, and it is efficient.

OpenGL mipmapping can be used, but in this context it would be slower to set it up than actually do the mipmaping on CPU.

On 8 Oct 2014, at 15:45, mifth [email protected] wrote:

Also, about mipmaps i would like to add.
I think it's possibly to generate mipmaps in OpenGL. As all 3D games have mipmaps for textures which are generated by OpenGL.

Here is automatic mipmaps generation in Opengl:
https://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
http://www.g-truc.net/post-0256.html

Also, there are many other articles/code in google.

And GPU mipmaps are fast.


Reply to this email directly or view it on GitHub.

@mifth
Copy link
Author

mifth commented Oct 8, 2014

Ok, you guys know better what to use. :)

I just know that Nuke 7/8 moved most things to GPU. Possibly, because of better poductivity.

@devernay
Copy link
Collaborator

Switching to GPU processing has some downsides.

OpenGL processing for example (which is what OFX supports) is almost useless because it means that only one node can do the processing at a given time.

On the other hand, multicore CPU architectures are becoming more and more commonplace.

However, you can expect to see CUDA support in Natron pretty soon.

Le 8 oct. 2014 à 15:59, mifth [email protected] a écrit :

Ok, you guys know better what to use. :)

I just know that Nuke 7/8 moved most things to GPU. Possibly, because of better poductivity.


Reply to this email directly or view it on GitHub.

@mifth
Copy link
Author

mifth commented Oct 13, 2014

No problem if it will be on CPU.
But the most important thing is Downscaling algorithm which you will implement.
I talked to Dmitry Kazakov who is Krita developer. He said that Krita uses Multisampling Filtration to scale image down.

I guess first 10 links can say more than me. :) https://www.google.ru/search?q=Multisampling+Filtration&oq=Multisampling+Filtration&aqs=chrome..69i57&sourceid=chrome&es_sm=93&ie=UTF-8

This is very important for good quality production.

Also, i think you will need to split Scale and Rotate operations. Firstly Scale, then Rotate. Or Firstly Rotate, then Scale. This can be important too.

Just my 2 cents.

@mifth
Copy link
Author

mifth commented Oct 16, 2014

I was looking at blender internal renderer. How they did downscale filtering.
They have Mipmaps and they have ScaleFilters. ScaleFilters are Box, Area, EWA. Also scaleFilter some kind of blur/sharpen size.
Here is my video test http://youtu.be/u38zUgvGffc. Possibly it will be helpful for you.

@mifth
Copy link
Author

mifth commented Jan 30, 2015

@MrKepzie @devernay Hi.
Sorry for bothering. I just would like to ask when mipmaps will be implemented? In what Natron version we could expect them?
This is one of important things which Natron misses. ScaleDown feature.

Thanks.

@mifth mifth changed the title TransformNode some issues TransformNode ScaleDown issue Jan 30, 2015
@MrKepzie
Copy link
Owner

MrKepzie commented Feb 3, 2015

Hi We Did not havé a chance to do it yet, I have no eta on this though

@mifth
Copy link
Author

mifth commented Feb 10, 2015

Ahh.. It's too bad. I still cannot use Natron for production as i need to ScaleDown a lot images/effects. But i'll wait for sure!

Anyway you do great job!

@devernay
Copy link
Collaborator

devernay commented Mar 4, 2015

almost done

@mifth
Copy link
Author

mifth commented Mar 4, 2015

@devernay great news! Waiting to test it!

@devernay
Copy link
Collaborator

devernay commented Mar 4, 2015

still have to fix image borders

devernay added a commit to NatronGitHub/openfx-supportext that referenced this issue Mar 4, 2015
- related to MrKepzie/Natron#258
- there is still an issue with image borders
devernay added a commit to NatronGitHub/openfx-misc that referenced this issue Mar 4, 2015
@mifth
Copy link
Author

mifth commented Mar 5, 2015

@devernay Hello!

I tested latest snapshot. Downscaling works perfectly! Thank you a lot! Now i can use Natron for my production.

The only issue i found that Downscaling algorithm is always the same. I guess it's always Cubic for all algorithms. Also, Impulse works in Natron too. But other algorithms do not work.

Here is a comparison with Natron and Nuke downscale algorithms http://youtu.be/bEwNX1Q747U
The testing file is at the first post.
I will reopen the issue for a while if you don't mind.

@mifth
Copy link
Author

mifth commented Mar 5, 2015

Ahh... i have no rights to reopen the issue.

@devernay
Copy link
Collaborator

devernay commented Mar 5, 2015

Unless you point me to a peer-reviewed publication, or an image processing or computer graphics textbook saying that anything else than bilinear should be used for supersampling, this should be considered a Nuke bug and not a Natron bug.
Please report this to The Foundry, not us.
There is absolutely no reason to use bicubic or other sophisticated interpolation functions for supersampling: supersampling is supposed to approximate the integral of the image over the surface of a pixel using many samples. What would motivate using an interpolation function to compute an integral over several pixels? Nothing, sorry.
I used bilinear, not impulse, to avoid aliasing due to supersampled pixel borders, and it does this job perfectly. Cubic is just overkill. Compile your own Natron with cubic or whatever you want: it's just doing it wrong.

I can show you more Nuke bugs related to supersampling if you want. Do that shape in Nuke, you'll notice horizontal artifacts. Do you still think Nuke should be considered as the gold standard?

   /
  / |
 /  |
|   |
|   |
 \  |
  \ |
   \|

@mifth
Copy link
Author

mifth commented Mar 6, 2015

@devernay hi.
It seems you misunderstood a bit.
I meant that Nuke has many interpolation methods, when we change scale method(Linear, Cubic, Lacoz, Sinc etc.)
But Natron has only one interpolation method.
I'm sure that Fusion and AE have many downscale interpolation methods too.

Here is a screenshot of my explonation from Nuke:
cache0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants