Flattening or rasterising an element that is transparent

I have been able to identify transparent elements and not write them back in (effectively deleting them) using the ElementWriter, but some of the elements that have transparency, have other effects in them, so deleting them is obviously out of the question.

I am looking for a way to flatten the elements, as the flattener class seems to be inconsistent with the rasterization of text.