Bilinear filtering enable/disable for pixel art images and fonts for PIXEL ART based apps

When scaling pixel art or using the images in a retina display the edges are blurred as a result of the OpenGL textures having bilinear filter turn on by default. I would like Corona to be able to turn/on off this feature when creating images or setting in dynamically, it should be a fairly straightforward feature to implement

Assuming you create your textures like so
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
change it to:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

This would be an essential feature when creating a game featuring pixel art, like I’m doing now

As of now I’m forced to make larger textures to make them crisp, otherwise they look blurred when scaled up.

I guess it’s just one of the issues of not having an enterprise license or access the the source code to make these things happen. sigh [import]uid: 88628 topic_id: 33779 reply_id: 333779[/import]

As a photographer I spend a lot of time dealing with various resampling methods and bi-linear is one of the overall best quality options though its not perfect in all cases. There has to be a balance between quality and speed since high frame rates are important to our apps as well.

I know that if you’re images are not evenly divisible by 2 that you can get unnecessary blurring. Try padding some of your images with an extra pixel of transparency to get them on an even boundary and see if that makes an improvement. In the mean time I’ll ask the team about it.
[import]uid: 199310 topic_id: 33779 reply_id: 134335[/import]

As a photographer I spend a lot of time dealing with various resampling methods and bi-linear is one of the overall best quality options though its not perfect in all cases. There has to be a balance between quality and speed since high frame rates are important to our apps as well.

I know that if you’re images are not evenly divisible by 2 that you can get unnecessary blurring. Try padding some of your images with an extra pixel of transparency to get them on an even boundary and see if that makes an improvement. In the mean time I’ll ask the team about it.
[import]uid: 199310 topic_id: 33779 reply_id: 134335[/import]

It has little to do with images divisible by 2 (although you will get more blurring if the image is not pixel to pixel aligned), and everything to do with how the image is rendered being rendered with the filter turned on.

My images are all power of 2 anyway, (they get stored that way in memory that way anyway)

bi-linear is actually a more graphics intensive feature than just drawing nearest pixel, but in modern cards it’s not a very noticeable performance hit

I’ve used OpenGL for years

Thanks for the response, hope it gets implemented as it’s a relatively easy feature [import]uid: 88628 topic_id: 33779 reply_id: 134832[/import]

It has little to do with images divisible by 2 (although you will get more blurring if the image is not pixel to pixel aligned), and everything to do with how the image is rendered being rendered with the filter turned on.

My images are all power of 2 anyway, (they get stored that way in memory that way anyway)

bi-linear is actually a more graphics intensive feature than just drawing nearest pixel, but in modern cards it’s not a very noticeable performance hit

I’ve used OpenGL for years

Thanks for the response, hope it gets implemented as it’s a relatively easy feature [import]uid: 88628 topic_id: 33779 reply_id: 134832[/import]

+1 for crisp pixel scaling! [import]uid: 70635 topic_id: 33779 reply_id: 137849[/import]

+1 for crisp pixel scaling! [import]uid: 70635 topic_id: 33779 reply_id: 137849[/import]