[Solved] Linear image scaling

I was trying to resize pixelart-images with linear interpolation in OF and wasn’t able to do that.
When I used the resize-function of ofPixels, it left me with a border around the resized image, and using ofSetMinMagFilers with GL_LINEAR had no effect.

So, is there a good way to resize images with linear interpolation?

I am using Win7 and OF-version 0.7.4 for vs2010.
Thanks in advance,


Do you need to resize the data itself or simply draw the images larger? If you need to simply draw them larger then you can do that with the draw() method of the image itself and that will use the min/mag flags that you’ve set. If you need to resize the image data for resaving it out, then you should be able to use ofPixels::resize() to do that you want, particularly if you’re using OF_INTERPOLATE_BICUBIC for the interpolation method (actually, either of them should be fine). If you could post a little bit of code and maybe I could be more helpful.

Oh, I’m sorry. I was thinking GL_LINEAR would be the Filtermode I needed… my google searching was a bit misleading there.

So yeah, what I was searching for was drawing the image resized on the screen, and I have to use GL_NEAREST instead GL_LINEAR.

Still, thanks for the reply, problem solved!