Codea antialiasing

Is there a way to disable the anti aliasing of drawn images, as this creates problems with image:get if you want to get the value of all red pixels in a drawn ellipse then the edges where the antialiasing occurs aren’t taken in because they’re a different colour. I’ve looked around and there doesn’t seem like there is an option… Even with noSmooth() there are blurred pixels around the ellipse…
This shows the effect of the antialiasing:

@Luatee I thought adding strokeWidth as the same color as the ellipse would work, but it didn’t. Since antialiasing extends 2 pixels around the ellipse, can you extend “whatever” you’re doing to go 2 more pixels ignoring their color value. Or calculate the ellipse 2 pixels larger.

Hmm well if its a fill algorithm then its going to be quite hard judging where to place the pixels, and even getting the averages is hard to calculate the colour of the outside as it all varys! I was using an ellipse as an example but it needs to work with all shapes, even the meshes have it.

Tried messing with the ellipse shader to try and rid the smoothing but it only goes to 1 pixel

Your only option may be to keep the various shapes in different images, like Photoshop layers, but that is not a great solution

I’m not sure I follow you @ignatz, I’m going to put a layering system in later on but I don’t see the benefits of this in terms of the problem of anti aliasing

I thought that if you kept the colours completely separate, it might not anti alias them, but I test, and it seems to do it even if you have just one colour on a blank background

@luatee you can make a kind ow workaround: i assume you draw a mesh or sprite of a single color red. Then you can draw it in an image with background (0,0,0,0) and anything not (0) in this image is your object (slightly bigger). Depending on what you want to do, it may be enough for you? Or you could simply accept that the fully red pixels are a bit less than you object? Is the border that important?

It blends even with 0,0,0,0 which is the problem, it blends with all colours to make it look nicer, I don’t want that though I need true value pixels all around so the pixel getting works correctly.

You can rewrite the ellipse shader to remove the anti-aliasing, would that help?

I did that but still got a 1 pixel smooth going round, Ill just have to keep it as it is, shouldn’t hurt too much…