Preheat oven to 350°F (175°C). Spread 1 1/4 cups pistachios on a baking sheet and toast for 8-10 minutes until fragrant and lightly golden. Let cool slightly, then roughly chop. Reserve remaining 1/4 cup for folding in later.
In a medium saucepan, combine heavy cream, milk, and 1/2 cup sugar. Add the toasted chopped pistachios and heat over medium until steaming and sugar dissolves, about 5 minutes. Remove from heat, cover, and steep for 2 hours at room temperature (or refrigerate overnight for deeper flavor).
Strain the pistachio cream through a fine-mesh sieve into a clean bowl, pressing firmly on the nuts to extract all liquid and oils. Discard the solids. Return the infused cream to the saucepan.
In a medium bowl, whisk together egg yolks, remaining 1/4 cup sugar, and salt until thick and pale yellow, about 2 minutes. Reheat the pistachio cream over medium until steaming but not boiling.
Slowly pour 1/2 cup of the hot cream into the egg yolk mixture while whisking constantly to temper the eggs. Then pour the warmed yolk mixture back into the saucepan with the remaining cream, whisking continuously.
Cook over medium-low heat, stirring constantly with a wooden spoon or heatproof spatula, until the custard thickens enough to coat the back of the spoon and reaches 170-175°F on an instant-read thermometer, about 5-7 minutes. Do not let it boil or the eggs will scramble.
Immediately strain the custard through a fine-mesh sieve into a clean bowl. Stir in vanilla extract and almond extract if using. Press plastic wrap directly onto the surface and refrigerate until completely cold, at least 6 hours or preferably overnight.
Churn the chilled custard in an ice cream maker according to manufacturer's instructions until it reaches soft-serve consistency, about 20-25 minutes. Roughly chop the reserved pistachios and fold them into the churned ice cream.
Transfer to an airtight container, press plastic wrap directly on the surface, and freeze for at least 4 hours until firm enough to scoop. Let soften at room temperature for 5-10 minutes before serving for the best texture.