[HELP]How to resize an Image with minimum aliasing?

Hi, I would like to use .png image which can be dynamically resized.

So, my idea is to make an image as large as possible, then shrink it to minimize the aliasing.

But I would like to not only resize an image but also resize the pixel as well for the best quality?

In this regard, what should I do?

//load an image
ofImage img;
img.loadImage(“Pic1.png”);

//draw the image
draw() {

img.resize(w,h); // Is this actually resizing an image?
img.draw(x,y,w,h); // what about this?
}

Please teach me.

Hi, as far as I know ofImage::resize will actually resize your image and new pixel information will be interpolated, so a fairly good anti-aliasing effect will be produced.

If you just want to render it, you should just call ofImage::draw(x,y,w,h) where w and h can scale the image however you want. OpenGL renderer will also interpolate and scale up your image.

AFAIK both methods will use bilinear interpolation by default. I believe you should be able to set anisotropic filters with OpenGL extensions for maximum quality, but I’ve got no experience on that.

1 Like

Hey Thank you so much :smiley: