# Bicubic image resizing

This topic is 4489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
You can also use 5x5 filter so you get the same contribution from left and right

##### 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 on other sites
You do the cubic interpolation on the 4x4 field

first rows than columns or vice versa and this gives you the averaged color for the 8x8 image

##### 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]

*bump*?

##### Share on other sites
Typically when downsampling, you dont interpolate.

Instead you usualy simply take the mean (sometimes weighted) of the area the output pixel represents.

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 16
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632659
• Total Posts
3007692
• ### Who's Online (See full list)

There are no registered users currently online

×