noSmooth() doesn't works with P2D

I’m doing a little game and I’m using pixel art images so I need to use noSmooth() which doesn’t works in P2D…
I would like to know if there is another way to use pixel art in P2D.

Sorry about mistakes, I’m french. :slight_smile:


Hi, are you resizing the image when drawing it?

Can we have a working example to help you with?

Yes i’m resizing images

And here is the game : Flappy Nyan

I think it is due to the resizing. When you work with “pixel art” you don’t want to resize your images because you will end up with blurry lines.

Oh… Okay
So how can i do ?

i found how to do, thanks anyway

Happy to hear that :slight_smile:

Can you explain what you did in case other people come here to find an answer to a similar project?

yes sure

Do that for every images


I found that this

((PGraphicsOpenGL)g).textureSampling( 3 );

instead of noSmooth(); might help? Haven tried it myself.

Source: -> ->

1 Like

I’ll keep this code and try later, thanks

Can confirm now. It works!

PImage img;

void setup() {
  size(500, 700, P2D);
  //size(500, 700);
  img = loadImage("key.png");
  ((PGraphicsOpenGL)g).textureSampling( 3 );

void draw() {
  image(img, 0, 0, 500, 700);


^ There is a very small picture to scale up btw.

1 Like