in reply to Display a generated image using Mason
I've only just started using Mason myself but one thing I picked up from the docs is that you should put all your code into the INIT block and then immediately call $m->abort(OK). If you wish to dynamically generate an image that is.
Apparently this prevents any additional whitespace being sent. In otherwords you set the content type to the type of the image, print it and immediately quit. Looking at your code you seem to want to have header and footer component calls. If this is correct then I reckon that won't work for you as you'll be mixing content types as image requests form their own HTTP transaction.
In other words the browser grabs the html, figures out the resources (CSS, images etc) and grabs each in turn.
The only way you can display your image directly is to type the script name into the url bar of your browser and code according to the method I have described. Otherwise you are stuck with HTML references (anchors et al).
HTH in some small way :)
SP