Grain boundaries


I have cell data which correspond to grains. I would like to outline the edges that share 2 different grain IDs, a.k.a. grain boundaries.

I did an example (see picture) with 1 grain. I did:

threshold of 1 grain + feature edge view representation

I am not willing to do this by brute force (going 1 by 1). I am wondering if there is a simple solution to do this.

Many thanks,