Whisk together the flour, baking powder, and salt in a medium bowl and set aside.
In the bowl of a stand mixer (or using a hand mixer), cream together the butter and sugar until light and fluffy, about 3-4 minutes.
Beat in eggs one at a time, ensuring each is fully incorporated before adding the next. Add vanilla and almond extract (if using), then scrape down the sides of the bowl.
Gradually add the flour mixture to the wet ingredients on low speed, about ⅓ at a time. Mix just until no flour streaks remain.
Divide the dough in half and form each portion into a flat disc. Wrap tightly in plastic wrap and refrigerate for at least 1 hour, preferably 2 hours.
Preheat your oven to 350°F (175°C) and line baking sheets with parchment paper.
On a lightly floured surface, roll out one disc of dough to about ¼-inch thickness. Use a Christmas tree cookie cutter to cut shapes, transferring them to prepared baking sheets with at least 1 inch between cookies.
Bake for 8-10 minutes or until the edges are just barely turning golden. The centers may look slightly underdone.
Allow cookies to cool on the baking sheet for 5 minutes before transferring to a wire rack to cool completely.
For the royal icing: In a large bowl, combine sifted powdered sugar and meringue powder. Add warm water, starting with 5 tablespoons, and beat on medium-high speed for 5-7 minutes until stiff peaks form. Add vanilla.
Color the majority of your icing green using gel food coloring. Transfer some to a piping bag with a small tip for outlining. Thin remaining green icing with a few drops of water for "flooding" (filling in).
Outline each tree, then fill in with flooding consistency icing. Add sprinkles while wet, or allow to dry completely before adding detailed decorations.
Let decorated cookies dry completely for 6-8 hours or overnight before stacking or packaging.