BiCubic antialiasing

BiCubic antialiasing

Post by eri.. » Thu, 28 Oct 1999 04:00:00



I need to write a function that does bicubic antialiasing on a bitmap.
Does anyone have, or know where I can find information on how to do
this?
Any help would be greatly appreciated,


Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

BiCubic antialiasing

Post by Werner Dia » Thu, 28 Oct 1999 04:00:00


If you meant Bicubic inperpolation for
zooming, i can probably help you...

I didnt find anything better on-the-fly, hope it helps:
(parameters are explained on web page in a diagram:
http://freespace.*.net/hugo.elias/models/m_perlin.htm)
____________________________________________________________

function Cubic_Interpolate(v0, v1, v2, v3,x)
              P = (v3 - v2) - (v0 - v1)
              Q = (v0 - v1) - P
              R = v2 - v0
              S = v1

              return Px3 + Qx2 + Rx + S
        end of function
____________________________________________________________

Its from:
http://freespace.*.net/hugo.elias/models/m_perlin.htm

Look for "Cubic Interpolation" (middle of the page)

of cause you have to do it with each color (RGB) separately...

If you want to scale the image with an integer factor, e.g.
4x or 7x, and want it really fast, you better do it with a
loop and using 3 additions per color. Unfortunately havent
got the source here ... perhaps someone can help you with this...

 
 
 

BiCubic antialiasing

Post by eir.. » Fri, 29 Oct 1999 04:00:00


Thank you.
I can see how the curve get its shape, and I understand the
interpolation, but honestly, I don't see how this applies to
antialiasing? The method I currently use, I get the values (for R, G
and B respectively) of the pixels above, under, to the left and to the
right of the current pixel, divide them (and the current pixel) by 5
and use the reulting value for the current pixelposition on the new
antialiased image. The result is not satisfying, so I want something
better, and someone suggested the bicubic interpolation method.

Could you help me out here?

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

BiCubic antialiasing

Post by eri.. » Fri, 29 Oct 1999 04:00:00


Thank you.
I can see how the curve get its shape, and I understand the
interpolation, but honestly, I don't see how this applies to
antialiasing? The method I currently use, I get the values (for R, G
and B respectively) of the pixels above, under, to the left and to the
right of the current pixel, divide them (and the current pixel) by 5
and use the reulting value for the current pixelposition on the new
antialiased image. The result is not satisfying, so I want something
better, and someone suggested the bicubic interpolation method.

Could you help me out here?

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

BiCubic antialiasing

Post by Dave Eberl » Fri, 29 Oct 1999 04:00:00



> Thank you.
> I can see how the curve get its shape, and I understand the
> interpolation, but honestly, I don't see how this applies to
> antialiasing? The method I currently use, I get the values (for R, G
> and B respectively) of the pixels above, under, to the left and to the
> right of the current pixel, divide them (and the current pixel) by 5
> and use the reulting value for the current pixelposition on the new
> antialiased image. The result is not satisfying, so I want something
> better, and someone suggested the bicubic interpolation method.

I am sure there are a number of available places to get this.
I have one at my web site, link Image Analysis | Gray Scale Images,
file bicubic.cpp.

--
Dave Eberly

http://www.magic-software.com

 
 
 

BiCubic antialiasing

Post by Werner Dia » Fri, 29 Oct 1999 04:00:00


As i understand it, you want to BLUR the image
(at least that happens with your method), and
the problem is that it probably blurs TOO MUCH...

Perhaps the one giving you the "bicubic interpolation"
meant that u should do a weighted blur, that
would be something like

- multiply middle point by 4 (or s.th. else >1),
- add the 4 (or 8) surrounding pixels
- divide result by 8 (4 points, 12 for 8 points)

if you use 8 surrounding points, you shuold weight
them according to the distance to the central point
(would be multiply by sqrt(2)/2 )

this is classic filtering, many posts in this forum
are about it, e.g. the "unsharp mask" discussion...

 
 
 

BiCubic antialiasing

Post by Dave Eberl » Fri, 29 Oct 1999 04:00:00



Quote:> As i understand it, you want to BLUR the image
> (at least that happens with your method), and
> the problem is that it probably blurs TOO MUCH...

> Perhaps the one giving you the "bicubic interpolation"
> meant that u should do a weighted blur, that
> would be something like

> - multiply middle point by 4 (or s.th. else >1),
> - add the 4 (or 8) surrounding pixels
> - divide result by 8 (4 points, 12 for 8 points)

> if you use 8 surrounding points, you shuold weight
> them according to the distance to the central point
> (would be multiply by sqrt(2)/2 )

> this is classic filtering, many posts in this forum
> are about it, e.g. the "unsharp mask" discussion...

Any mask to interpolate whose values are nonnegative
and add to one is a "smoother" and causes some type
of blurring.  Your method is effectively a proposal for
Gaussian blurring.

A more sophisticated approach is to use the methods
of nonlinear diffusion that relate to level curve evolution.
These tend to smooth in relatively homogeneous
regions of intensity, yet enhance contrast in
inhomogeneous regions (near "edges" so to speak).

An alternative approach using generalized order
statistical filters has similar effects.

--
Dave Eberly

http://www.magic-software.com

 
 
 

1. Bicubic, Bicubic Spline, B-Spline

Hi,
   I know similiar topics have been discussed before but I just
couldn't find anything that could clear my confusion:
   I am working on a 24bit bitmap scale algorithm and I need to
implement Bicubic interpolation like what photoshop offers. But after
some search using google I found several terms are frequently used
that confuse me: Bicubic, Bicubic Spline, B-Spline - are they the same
thing? Also I found this article:
http://astronomy.swin.edu.au/~pbourke/colour/bicubic/
but in the article the author says "There are two methods in common
usage for interpolating the 4x4 pixel, cubic B-Spline and a cubic
interpolation function, the B-spline approach will be discussed here."
    Is the algorithm in this article the same as what most image
processing applications use? From what I've learned so far Bicubic
should involve a lot more computation than Bilinear but for the
article described in the article seems a LUT will make it around the
same as bilinear except that you have more pixel to sample (16 vs 4)
   I'd really appreciate it if anyone could point out a direction on
the implementation, I don't need the source code, just the principle
and some ideas on optimization.
   Thank you!

-Xiaotian

2. selection with NVIDIA RIVA TNT2

3. TIFF antialiasing without antialiasing?

4. Wacom Tablets

5. Full Scene Antialiasing [LONG] (was Re: Antialiasing fonts)

6. How can I print antialliased character to a canvas?

7. Bicubic Interpolation Image Scaling Help Wanted Please !!

8. problem saving into working directory

9. Bicubic Image Scaling Help Wanted

10. Resampling with bicubic, lanzcos, mitchell, hamming or other

11. looking for a slow bicubic patch / ray intersection

12. blobs, meshes and bicubic patches