Added some compositing and histogram routines