Preheat oven to 350°F. Grease and flour a 9x9-inch pan.
In a mixing bowl, whisk together flour, baking powder, baking soda, and salt until there are no lumps.
Separately, in a large bowl, beat softened butter and granulated sugar with an electric mixer until light and fluffy.
Incorporate the eggs individually, mixing thoroughly after each one. Then, stir in the vanilla and almond extracts.
Alternately add the dry ingredients and milk to the butter mixture, beginning and ending with the dry ingredients. Mix until just combined.
Incorporate the ground pistachios. If desired, mix in a few drops of green food coloring.
Pour the batter into the pan. Bake for 40-50 minutes, or until a toothpick inserted into the center comes out clean.
Let the cake cool in the pan for 10 minutes. Then, remove it from the pan and cool completely on wire racks.
In a large bowl, beat cream cheese and butter until smooth. Gradually add powdered sugar and beat until fluffy. If desired, add more powdered sugar for added sweetness or thickness.
Frost the cooled cake and sprinkle with extra pistachios before serving if preferred.