Photoshop: Add more resample/interpolation algorithms

  • 3
  • Idea
  • Updated 9 months ago
  • (Edited)
It would be nice, in addition to bicubic, bicubic, and more bicubic, to also be able to choose from some of the other algorithms out there like Lanczos. Also, I heard on a forum somewhere that Lightroom has a better bicubic method than Photoshop that is a blended version. If that's true, it'd be nice if those of us with the much more expensive Creative Suite instead of Lightroom could get in on that as well.
Photo of David Petrofsky

David Petrofsky

  • 4 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 3
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 848 Reply Likes
Lightroom uses code similar to Photoshop's bicubic smoother and bicubic sharper.

Do you have specific requests that are known to perform well for images?

Lanczos works well in some instances, but has disturbing artifacts when applied to images. (we tried it during a beta test, it was rejected as one of the worst performing interpolation kernels).
Photo of Royi

Royi

  • 31 Posts
  • 5 Reply Likes
Maybe something which isn't based on Convolution (Bilateral Interpolation)?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 848 Reply Likes
How about the "preserve details" upsampling method?
Photo of Jayant Singh

Jayant Singh

  • 1 Post
  • 0 Reply Likes
which algo do preserve details uses?
Photo of David Petrofsky

David Petrofsky

  • 4 Posts
  • 0 Reply Likes
Interesting. I just like to have various options to try for a given image to see which one looks best and had heard good things about some of the algorithms that I didn't want to spend $200 per plug-in on, like Lanczos, s-spline, fractals, etc. I've also seen very good results in how Smugmug generates multiple sizes per image (all downsamples from the original), and they say they use Lanczos. Even if bicubic is the safe one for the most images, having a couple of options that might work better for some images could be useful. Do the bad artifacts in Lanczos occur on downsampling too or just upsampling?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 848 Reply Likes
Lanczos artifacts occur with any respampling, but are more visible when upsampling. For thubmnails they may be difficult to spot.

And we tested 6 different kernels, and kept the best of them. (which gave you sharper and smoother)

We try not to add too many options just for the sake of adding options. We try to have good reasons for the options and make sure that they give good results. There are many kernels out there that give worse results than what we already have.

S-spline, level sets, "geniuine fractals", etc. fall into a very different category for resampling, and we are investigating better methods similar to those.
Photo of Royi

Royi

  • 31 Posts
  • 5 Reply Likes
Sounds interesting!
We'd be happy to see some results.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 848 Reply Likes
See the "preserve details" upsampling method.
Photo of David Petrofsky

David Petrofsky

  • 4 Posts
  • 0 Reply Likes
Fair enough.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15850 Posts
  • 2443 Reply Likes
We did add an option called "Bicubic Automatic" which selects the preferred interpolation scaling up or down.
Photo of Chris Moeller

Chris Moeller

  • 1 Post
  • 0 Reply Likes
Windowed sinc resampling is signficantly better at shrinking images than bicubic filtering, although Lanczos is not the best kernel window choice. Perhaps some Nuttall 3 term? That works nicely for audio resampling, at least.

The best part about windowed sinc resampling is that a sinc window and kernel may be computed to fit the exact ratio of the resizing job, from upsampling to downsampling.

Although, technically, a fractal algorithm similar to Genuine Fractals is much better at upsampling than most general purpose interpolation filters.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 842 Reply Likes
Unfortunately, again, windowed sync typically shows visible artifacts in images - unless the window is so small that you match the bicubic kernels.
Bicubic kernels can also be scaled for the exact ratio needed (and are in Photoshop).

The "fractal" algorithms work by faking (hallucinating) texture and details that don't exist in the original image - which sometimes works, and sometimes leads to really bad artifacts. Plus, Photoshop already has an image self similarity upsampling method ("preserve details", designed not to create so many artifacts).
Photo of Chase Rebecca

Chase Rebecca

  • 2 Posts
  • 0 Reply Likes
We still need more options!
https://imgur.com/gallery/pbatq0q

Here is an example of why. There needs to be some solution for selections that have been rotated 45 degrees. I understand that pixels are being selected fractionally and that the marching-ants do not truly represent the selected pixels.

How can I rotate a pixel-perfect selection, at a degree in which anti-aliasing is not necessary, without getting blurred/feathered/anti-aliased/interpolation/etc???
Photo of JasonPetersen

JasonPetersen

  • 1 Post
  • 0 Reply Likes
I do not see a significant difference between Lanczos-3 and Bicubic (normal) with dowscaling factors down to 25%. Moire on a brick wall only appears below that. A solution is to do the scaling in two passes, which is easier than exporting to another program. Lanczos is only a tiny bit crisper. Bicubic sharper and smoother are always worse for dowsampling, leading to a very grainy image where the undershoot halos are deep or wide (smoother).

Some kind of edge-adaptive scaling could be useful, which uses bilinear or similar kernel without ringing for edges and bicubic for solid areas (at the final size) prone to aliasing. I sometimes do this manually on two layers and a 2x size intermediate cubic step which aligns both images. Gamma 1.0 can really only be used with bilinear.

And an even sharper scaler, maybe with the roll-off offset accepting some blur, to remove scanned halftone patterns. Again, not much difference between bicubic and lanczos there.