Set up an ice water bath: fill a large bowl halfway with ice and water. Place a smaller bowl into the larger one and set a strainer over the smaller bowl. Set aside.
In a medium heatproof bowl, whisk together the sugar, flour, eggs and 2 tablespoons of the milk.
Whisk for approximately 2 minutes or until the sugar crystals have dissolved and the eggs turn a lighter yellow color.
In a medium saucepan, heat the remaining milk just until it begins to boil.
Whisking constantly, temper the eggs by slowly adding the hot milk into the sugar and egg mixture.
Pour the egg-milk mixture back into the saucepan
Whisking constantly, heat the mixture over medium heat until the custard thickens a bit and coats the back of a spoon, leaving a path as you pull your finger across it. This will take approximately 3-4 minutes. Do not allow the custard to come to a boil. If you wish, you can use a thermometer, and it should reach 180° Fahrenheit.
Pour the custard into the sieve over the ice water bath. This stops the cooking process instantly. Remove the sieve.
Whisk the heavy cream, food coloring, if using, and the almond extract into the cooling custard. Blend well.
After the ice cream base is cool, lift it out of the ice water bath and cover it with plastic wrap.
Chill it in the refrigerator for several hours or overnight.
Process the base in an ice cream machine according to the manufacturer’s directions.
When the ice cream is finished, stir in the pistachios until well blended.
Place ice cream in an airtight container and freeze for several hours before serving.