Comcast is buying DreamWorks Animation, the film company behind the Shrek, Madagascar and Kung Fu Panda franchises, for approximately $3.55 billion.

DreamWorks stockholders will receive $41 for each share they own. That's a 24 percent premium to the company's Wednesday closing price of $32.20. The companies put the deal's value at about $3.8 billion.

DreamWorks will become part of the Universal Filmed Entertainment Group, which includes Universal Pictures.

Once the deal closes, DreamWorks co-founder and CEO Jeffrey Katzenberg will become chairman of DreamWorks New Media. He'll also serve as a consultant to NBCUniversal, a unit of Comcast Corp.

Both companies' boards have approved the transaction, which is targeted to close by year's end.