Skip to main content
Known Participant
October 26, 2024
Answered

Converting Irregular Dots to Perfect Circles

  • October 26, 2024
  • 4 replies
  • 1365 views

Hello everyone,

 

This is my first post on the Illustrator forum, as I’m really not very skilled with this software.

 

Let me explain: I generated an AI image of a face made up of small dots of varying sizes. The image itself is great and fits what I’m looking for, but there’s one issue that bothers me: the dots aren’t perfect circles. I’ve attached the Illustrator file—you’ll quickly see that some dots are oval, others flattened…

 

What I really want is for each of these dots to be a perfect circle. However, I need to keep the differences in size for each dot, otherwise, the face won’t be distinguishable (it’s the size variations that help form the eyes, mouth, etc.).

 

I’ve tried different options: smooth, simplify, round corners… but the best result I could achieve is the attached version, which is still quite far from perfect circles.

 

There’s also the option Effects > Convert to Shape > Ellipse, but again, I couldn’t get exactly what I wanted. The Absolute option is great because it does convert everything into circles, but it doesn’t retain the size differences; as for the Relative option, it’s the opposite.

 

If anyone has an idea on how I could achieve this, that would be fantastic.

 

Thank you very much in advance.

This topic has been closed for replies.
Correct answer Ton Frederiks

It tried the Convert to shape, but it does not create circles.

I once downloaded a free script that could replace objects by the top object, the objects have to be ungrouped first.

Unfortunately it is not available online anymore, so here it is. Copy the script and paste it in a text only document.

Ungroup all, create a circle, select all and run the script using File > Scripts > Other Script...

 

mySelection = activeDocument.selection;
if (mySelection.length>0){
 if (mySelection instanceof Array){
  goal=mySelection[0];
  centerPoint=goal.position[0]+(goal.width/2);
  centerPointVert=goal.position[1]-(goal.height/2);
  for (i=1; i<mySelection.length; i++){
   currItem=mySelection[i];
   centerPoint=currItem.position[0]+(currItem.width/2);
   centerPointVert=currItem.position[1]-(currItem.height/2);
   ratio=100/(goal.width/currItem.width);
   ratioV=100/(goal.height/currItem.height);
   newItem=goal.duplicate();
   newItem.position=Array((centerPoint-(goal.width/2)),(centerPointVert+(goal.height/2)));
   if(ratio<ratioV){
    newItem.resize(ratio,ratio,true,true,true,true,ratio)
   }else{
    newItem.resize(ratioV,ratioV,true,true,true,true,ratioV)
   }
   newItem.artworkKnockout=currItem.artworkKnockout;
   newItem.clipping=currItem.clipping;
   newItem.isIsolated=currItem.isIsolated;
   newItem.evenodd=currItem.evenodd;
newItem.fillColor=currItem.fillColor;
   if(currItem.polarity){
    newItem.polarity=currItem.polarity
   }
   newItem.moveBefore(currItem);
   currItem.remove()
  }
 }
}else{}

 

 

4 replies

Kurt Gold
Community Expert
Community Expert
October 28, 2024

There are several other built-in ways to achieve it.

 

For example, you can convert the objects to horizontal lines and then just use Global Edit or an Art Brush to replace them with circles.

Community Expert
October 27, 2024

Astute Graphics' Find and Replace plugin might be able to help with that task. But it's not a free plugin (although the suite can be tried out free on a trial basis for a limited time).

Ton Frederiks
Community Expert
Community Expert
October 27, 2024

After the script.

Ton Frederiks
Community Expert
Ton FrederiksCommunity ExpertCorrect answer
Community Expert
October 27, 2024

It tried the Convert to shape, but it does not create circles.

I once downloaded a free script that could replace objects by the top object, the objects have to be ungrouped first.

Unfortunately it is not available online anymore, so here it is. Copy the script and paste it in a text only document.

Ungroup all, create a circle, select all and run the script using File > Scripts > Other Script...

 

mySelection = activeDocument.selection;
if (mySelection.length>0){
 if (mySelection instanceof Array){
  goal=mySelection[0];
  centerPoint=goal.position[0]+(goal.width/2);
  centerPointVert=goal.position[1]-(goal.height/2);
  for (i=1; i<mySelection.length; i++){
   currItem=mySelection[i];
   centerPoint=currItem.position[0]+(currItem.width/2);
   centerPointVert=currItem.position[1]-(currItem.height/2);
   ratio=100/(goal.width/currItem.width);
   ratioV=100/(goal.height/currItem.height);
   newItem=goal.duplicate();
   newItem.position=Array((centerPoint-(goal.width/2)),(centerPointVert+(goal.height/2)));
   if(ratio<ratioV){
    newItem.resize(ratio,ratio,true,true,true,true,ratio)
   }else{
    newItem.resize(ratioV,ratioV,true,true,true,true,ratioV)
   }
   newItem.artworkKnockout=currItem.artworkKnockout;
   newItem.clipping=currItem.clipping;
   newItem.isIsolated=currItem.isIsolated;
   newItem.evenodd=currItem.evenodd;
newItem.fillColor=currItem.fillColor;
   if(currItem.polarity){
    newItem.polarity=currItem.polarity
   }
   newItem.moveBefore(currItem);
   currItem.remove()
  }
 }
}else{}

 

 

Monika Gause
Community Expert
Community Expert
October 27, 2024

@Ton Frederiks 

I don't know if you are referring to Nathaniel Kelso's script. 

It is on Github:

https://github.com/nvkelso/illustrator-scripts 

Ton Frederiks
Community Expert
Community Expert
October 27, 2024