Sign in to follow this  
Funkymunky

Bicubic image resizing

Recommended Posts

I'm wanting to resize an image (up or down) using bicubic interpolation I've found this page: http://astronomy.swin.edu.au/~pbourke/colour/bicubic/ I am confused as to the implementation, however. Why do the summations run from -1 -> 2? Are you always sampling more pixels to the right/below of the one you want than to the left/up?? wtf? And if you're scaling down, wouldn't you need to sample more than a 4x4 grid so as to get the general color from the entire block that the pixel will represent? Any help would be greatly appreciated!!!

Share this post


Link to post
Share on other sites
alright...

but say i was scaling down. i'm going from 32x32 to 8x8. So basically that 32x32 is going to get broken up into 4x4 blocks of color. Do i first create these blocks of color by averaging the 4x4 region of the 32x32 and taking that color as the pixel color in the 8x8? And then apply the bicubic interpolation on this new image to smooth it?

Share this post


Link to post
Share on other sites
PBourkes page seems to only apply to scaling an image up. I still am thoroughly confused as to how to do a bicubic resample. Can anyone explain to me the theory of how it works? I take the weighted value of the surrounding 4x4 grid of a pixel (basically the intensities of these pixels...?) And then I use this to determine the color of the new pixel. Except if I'm scaling down it seems like I'll just be taking the average color of a region and applying that to the pixel, I don't understand how the bicubic interpolation comes into play.

Say the Source image is 512x512, and I want to resample to 32x32. To figure out the colors of the pixels in the 32x32, I do two loops of 0->32, running the bicubic interpolation function at each of the corresponding pixels in the 512x512 image (effectively sampling 32x32 times (in a 4x4 each time) in a grid throughout the 512x512). However, this seems like it would just sample a number of points spread throughout the 512x512. What if that section of the picture is black and happens to have a red dot at the point that I check... the downsized image would be wildly inaccurate! So how is it that this works?!

[Edited by - Funkymunky on June 10, 2006 5:09:50 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this