As I posted before I was looking for a bicubic resize algorithm for images to be used in Silverlight. I thought I ported the code properly from C# to VB but then yesterday when I was testing the code some more, I realized that there was a weird pattern of noise present in the picture. It looked like a square grid of sorts being overlaid onto the image. My experience told me that, that's because something screwed up when interpolating the pixel values (duh!) I didn't notice it previously because my previous test images didn't cause it to show up.
So what was I left to do? I had to port over the C# version to a lib on it's own then.
Pretty much a direct port of the original code since it was in C# already previously, just changed the way pixels are read and set. Same caveat applies as the previous code, no alpha premultiplication done yet.
The C# code didn't produce the weird grid like overlay pattern. So... what happened? Well my guess would have to be that I haven't properly ported the code to VB, and somewhere there's a fractional number being cast to a whole number causing some problems.
I'll have to be more careful when porting code that involves fractions in the future then.
Tweet
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Marauderz
E-mail