3 Replies - 261 Views - Last Post: 19 October 2017 - 02:48 PM Rate Topic: -----

#1 noles123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-October 17

Anti-Alias on image with python

Posted 19 October 2017 - 10:30 AM

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

Posted Image

Is This A Good Question/Topic? 0
  • +

Replies To: Anti-Alias on image with python

#2 DK3250  Icon User is offline

  • Pythonian
  • member icon

Reputation: 318
  • View blog
  • Posts: 1,048
  • Joined: 27-December 13

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/
Was This Post Helpful? 1
  • +
  • -

#3 noles123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-October 17

Re: Anti-Alias on image with python

Posted 19 October 2017 - 11:07 AM

View PostDK3250, 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/


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
Was This Post Helpful? 0
  • +
  • -

#4 DK3250  Icon User is offline

  • Pythonian
  • member icon

Reputation: 318
  • View blog
  • Posts: 1,048
  • Joined: 27-December 13

Re: Anti-Alias on image with python

Posted 19 October 2017 - 02:48 PM

View Postnoles123, 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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1