Hi I am new to python

and I need help with this problem

I have 100 different 2D images, these images are black and white image (i give one sample image, see below)

and I need to give anti-aliasing on every image. especially I need to add anti-aliasing/gradient gray pixel on the edge of the object.

May you give me some clue, how to do this in python step by step? from import the object to give anti-alias

Thank you

# Anti-Alias on image with python

Page 1 of 1## 3 Replies - 261 Views - Last Post: 19 October 2017 - 02:48 PM

##
**Replies To:** Anti-Alias on image with python

### #2

## Re: Anti-Alias on image with python

Posted 19 October 2017 - 10:59 AM

You need to be able to determine if a point is inside, outside or on the edge.

For a ball this is simple, as the perimeter is defined by simple mathematics.

The edge points are those that need anti-aliasing.

For a random object (like the one showed) how do you determine this? Are the objects described by mathematics?

If size-reduction is allowed, you can use the technique described in my other tutorial: http://www.dreaminco...-anti-aliasing/

For a ball this is simple, as the perimeter is defined by simple mathematics.

The edge points are those that need anti-aliasing.

For a random object (like the one showed) how do you determine this? Are the objects described by mathematics?

If size-reduction is allowed, you can use the technique described in my other tutorial: http://www.dreaminco...-anti-aliasing/

### #3

## Re: Anti-Alias on image with python

Posted 19 October 2017 - 11:07 AM

DK3250, on 19 October 2017 - 10:59 AM, said:

You need to be able to determine if a point is inside, outside or on the edge.

For a ball, this is simple, as the perimeter is defined by simple mathematics.

The edge points are those that need anti-aliasing.

For a random object (like the one showed) how do you determine this? Are the objects described by mathematics?

If size-reduction is allowed, you can use the technique described in my other tutorial: http://www.dreaminco...-anti-aliasing/

For a ball, this is simple, as the perimeter is defined by simple mathematics.

The edge points are those that need anti-aliasing.

For a random object (like the one showed) how do you determine this? Are the objects described by mathematics?

If size-reduction is allowed, you can use the technique described in my other tutorial: http://www.dreaminco...-anti-aliasing/

Hey thanks for replying me, I generate the image from 3D STL file, and i have a program that slice the 3D object to 2D layer

this is related to DLP 3D printing, by applying anti-alias, your printed object will be more smooth.

Unfortunately, I cannot reduce the size, it must be 1:1

and yeah random image make this problem more complicated

### #4

## Re: Anti-Alias on image with python

Posted 19 October 2017 - 02:48 PM

noles123, on 19 October 2017 - 07:07 PM, said:

(...) and yeah random image make this problem more complicated

You need to be able to provide exact instructions of how to solve a problem. Otherwise there is no chance of writing a code for the job.

It is not clear (at least not to me) how the generic anti-aliasing should work on the sample figure.

So, it is not a matter of complication, rather of insufficient specification of the task.

I you can specify what you want the code to do, then there is a chance that the code can be made; otherwise not.

The idea here on DIC is that you show an attempt to solve the task i.e. show some code and then ask about errors, problems, etc.

Page 1 of 1