Bicubic resampling by Pixel Bender
August 25th, 2009 | Published in Uncategorized | 7 Comments
There is bilinear resampling by Pixel Bender already, why not bicubic too?
With the very helpful Java implementation, I can get bicubic resampling running in Pixel Bender in hours.
Here is my result, along with the resampling results in PhotoShop as a comparison:
There is some difference with PhotoShop’s versions (below), hope it’s not my mistake…
My codes can be downloaded below:
Bicubic resampling sample program source (with PB source)
Update:
Notified by author of the Java version, the Java code was wrong and has been updated. Here below is my updated code:
Bicubic resampling sample program source (with PB source)







November 24th, 2009 at 9:13 am (#)
This filter looks fantastic when upsampling an image, but it is really jagged when downsampling. Any thoughts?
November 24th, 2009 at 10:00 pm (#)
The code I ported from is actually designed for up sampling only as the name bicubic interpolation suggests. It is because it takes the nearest four points to calculate the values in between.
More pixels (>4) are needed for “correct” calculation in high ratio down sampling.
January 15th, 2010 at 5:38 pm (#)
[...] BitmapData, Bitmap, ByteArray, read this article. Continue reading about bilinear resampling and bicubic resampling using pixel [...]
January 16th, 2010 at 10:40 pm (#)
Hi, I have just figured out smoother downscaling
http://blog.yoz.sk/2010/01/how-to-resize-an-image-with-actionscript/
February 26th, 2010 at 5:20 am (#)
Hi, I wrote the Java implementation and made a mistake: the code didn’t do bicubic interpolation, sorry.
I fixed it a few days ago. So this code for Pixel Blender is wrong too and also has to be fixed.
March 1st, 2010 at 2:55 am (#)
@Paul Breeuwsma Thanks for the info! I’ve just updated the code according to your changes.
June 21st, 2010 at 8:47 am (#)
Hi, I changed my code again, already a while ago, the new formula is more smooth than the one used here now. But now, it should be perfect.