How to find the coordinates of a bitmap shape

Hello @paulstgeorge,

I would start here:

This example (in tutorial) may be a good place to start:
http://learningprocessing.com/examples/chp15/example-15-13-Convolution

You could modify the convolution function to check the pixels in a matrix for colors and if they are different you will have a point (these will be adjacent pixels and not an exact point).

You may have to consider ranges in your checks if the colors are not homogenous. You can also check for brightness, saturation and hue and ranges for those.

Maybe zoom in to see what a transition looks like and then consider what to check for:

An example with mouse movement:

PImage img;
int count;

void setup()
  {
  size(651, 477);  //Image size
  img = loadImage( "c5d59a8653f86bbf9bf8daa834e885ae4e998ba5.png" );
  println(img.width, img.height);
  mouseX = 1;
  mouseY = 1;
  }

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

  //loadPixels();

  // Each pixel location (x,y) gets passed into a function called convolution()
  // The convolution() function returns true if adjacent pixels different.
  boolean b = convolution(mouseX, mouseY); 
  if (b)
    println(b);

  //updatePixels();
  }

boolean convolution(int x, int y) 
  {
  int xc, yc, loc;
  boolean b;
  //println(x, y);
  
  xc = x;
  yc = y;
  loc = xc + img.width*yc;
  int c0 = img.pixels[loc];
 
  xc = x+10; // Adjacent steps not detected well with coarse mouse movements! Made it 10 for testing with mouse!
  yc = y+0;
  loc = xc + img.width*yc;
  int c1 = img.pixels[loc];
  
  // Only checking c0 and c1, 2 adjacent pixels as mouse moves left to right
  if (c0 != c1)
    {
    println(count, hex(c0), hex(c1));
    b = true;
    count++;
    }
  else 
    b = false;      
  return b; 
  }

That above was just my first pass at this; move mouse slowly left to right along x-axis.

I did something similar scanning the pixel array without mouse.
Borders are simple.
Finding that middle point a bit more challenging.

Since you are generating this you should have the information available to get these points. Just a thought.

:)