Maintain hierarchical structure of sprite groups instead of flattening.
Allows opacity and blend mode to be applied correctly to groups.
Sets the foundation for future features like mask layers.
Note:
Requires full image rendering and impacts performance in some scenarios.
Avoids complex code changes for minor performance gains.
Co-authored-by: Guilherme Marcondes <guilherme.marcondes@tecnico.ulisboa.pt>
The code was refactored moving the BlenderHelper class from "render"
to "doc", and now doc::blend_image() supports blending different color
modes.
Some work is still needed to work with grayscale images correctly.