# What is the most effective way to setup a Notebook with transparent background but solid contents?

I know there is a Notebook option WindowOpacity can be used to adjust the opacity of a whole notebook. But what I want is keeping the text and graphics and so on being Opacity[1] while the other parts of the window being Opacity[0.3], which may look like (the pic is roughly produced by photoshop):

I guess this effect might be achieved by capture the screen prior and set it as the background of a Cell/Cells. But even if that is applicable, it must be very inefficiency.

My questions are: how to achieve this transparent effect in Mathematica (maybe with some help from external applications)? and how to do it effectively?

-
Very cool. Didn't know you can change the opacity. – Mike Bantegui Jan 19 '12 at 5:20
The documentation for Background says "The setting for Background can be any color or opacity specification" so I thought you could locally set Opacity at the cell level to override the WindowOpacity and get the sort of effect you want but I get an error message when I use Opacity with Background. – Mike Honeychurch Jan 19 '12 at 6:26
Fixed the background error but local Opacity settings at the cell level are being overridden by the WindowOpacity. Interesting problem. – Mike Honeychurch Jan 19 '12 at 6:37
@MikeHoneychurch Yes the window level option will override others. I'm working on a GUI application and trying to make it cooler.. – Silvia Jan 19 '12 at 9:47

On Mac this works (but apparently only with WindowFrame->"PopupMenu"):

SetOptions[InputNotebook[], Background -> Opacity[.75, Red],


This is different than WindowOpacity.

-
Thanks ragfield. Unfortunately this seems not working on my Win7 box.. The background turned red, but no transparent. – Silvia Jan 19 '12 at 16:40

If you turn on window opacity slightly, then background opacity will be factored in. Note a cell's background is mixed with the notebook's. Note that "Input" cells have a translucent LightBlue background, RGBColor[0.87, 0.94, 1, 0.6], that appears purplish.

SetOptions[InputNotebook[],
WindowOpacity -> 0.9999, (* something slightly less than 1 *)
Background -> Hue[0.95, 0.8, 1, 0.8]]


There is still a slight problem. It may be hard to see, but the input labels have a rectangle with a slight different color than the window background. It seems that it inherits the window background, and when the two are composited, the result is less translucent. This seems to be an issue whenever translucent backgrounds overlap. Since the OP seems interested only in cells with opaque background, this shouldn't be an issue except for the In/Out labels.

To fix the labels, edit the stylesheet. Enter the style name CellLabel and hit return. With the Options Inspector, change the backgrounds for both Cell Options > Display Options > Background and Formatting Options > Font Options > Background to have 0 opacity, with something like

RGBColor[0, 0, 0, 0]


(Just add the fourth entry 0; the others don't matter. For reasons I didn't track down, once the color was the notebook background, and once it was near white.)

-
Thanks Michael. Unfortunate this, like ragfield's solution, doesn't work in my MMA 9 on Windows 7... – Silvia Aug 20 '13 at 1:55
@Silvia Oh, I'm sorry. I was hoping that WindowOpacity -> 0.9999 would trick it, as it does on Mac OS, for normal windows. Thanks for the question, anyway. – Michael E2 Aug 20 '13 at 3:12
In fact some days ago I had struggled to "simulated" it (with very low performance) with the new option in v9, but I don't have time and computer to arrange an answer current now. I'll post it as soon as I can. – Silvia Aug 23 '13 at 3:58