Page MenuHome

Scale and Transform nodes don't interpolate when scaling images down
Closed, ArchivedPublic

Description

--- Operating System, Graphics card ---
Linux SuSE 12.2 (x86_64)
NVidia GTX560ti (official driver)

--- Blender version with error, and version that worked ---
latest buildbot binaries 2.66.6 (r56187) and at least as far back as 2.62 (r44136)

--- Short description of error ---
The Scale and Transform nodes don't interpolate when scaling images down (particularly noticeable using a scale value less than 0.5). Effect is most noticeable on sharp, high res images.

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
Use either Render Layers or Image node as a source and route through Scale or Transform node reducing the size by 0.2

Details

Type
To Do

Event Timeline

Ton Roosendaal (ton) closed this task as Archived.Apr 22 2013, 3:14 PM

Just to the note -- Transform node will do exactly the same crappyness, unfortunately :(

The bilinear or bicubic interpolation used here is never going to give good result scaling so much, the filter size is too small for that. Something like mipmapping or EWA filtering is needed here.

The compositor already has EWA filtering (implemented for the UV mapping) this could be implemented for other nodes etc. The downside of this is that scale/rotate etc will become 'complex nodes' and loosing a lot of the functionalities that the simple nodes have. And those features (composite outside screen area) were developed for the scale/rotate nodes.

We could also adjust the current node interface to add the deltax, deltay that is needed for the EWA filtering so that every node can handle this kind of filtering. but it will slow down the system a bit. This would be a better option, but IMO clearly a todo/feature request.

If GIMP gives better results when set to linear scaling, doesn't it suggest a specific issue with Blender's implementation?

A quick workaround; use a Tent Blur node before either the scale/transform and a bit of math to pre-blur the image inversely proportional to the scale amount;

Scale Blur
1.0 1.0
0.5 2.0
0.25 4.0
see prefilter_before_scale.png attachment

Moved from Blender 2.6 Bug Tracker to Todo

Will move this item to todo tracker as a new algorithm needs to be investigated. We think that having a feature like this is useful.

Thanks for showing this!
Regards,
At Mind

@Jeroen Bakker (jbakker) any chance we can revisit this and implement the cubic prefilter approach? It is likely one of the best in breed for pixel manipulations given it doesn't overshoot nor undershoot, and delivers stable math on the output.