Set Opacity?

Hello everyone,

I would like to ask if you do not know how to set the transparency for the set of graphics objects?
I know that uses the “Opacity” but the problem is with the intersection of objects that is darker.
I would like to merge graphics objects and set uniform opacity (no darker color for objects intersection).
I have basic example:

Graphics[{Red,Text[Style["Text",160]],Black,Opacity[0.5],Disk[],Disk[{0.5,0}]}] 

My real task contains monochrome graphics object and directives like: Line, Thickness, Disk, Text, JoinForm, CapForm

Thanks

I’m quite sure this is currently not easily possible.

Style[{disk1, disk2},Opacity[0.5]]

does not give the intended result. Also GraphicsGroup does not give the right result. You could do it like this:

joineddisks=MeshPrimitives[BoundaryDiscretizeGraphics[{Disk[],Disk[{0.5,0}]},MaxCellMeasure->0.002],2];
Graphics[{Red,Text[Style["Text",160]],Black,Opacity[0.5],joineddisks}]

giving:

I would like to thank Sander Huisman for his response and answer.

Adam Sandler?

Very sorry for the garbled names. I corrected it.

Solution is very good. Problem is with Line with defined Thickness. If I add line then this line is not converted to mesh.

Thanks Mirek

Second argument of MeshPrimitives is in the above example ‘2’ meaning it will get surfaces (like disks). You can also do ‘1’ in order to get lines… Look at the documentation!!

Thanks, but what you describe about documentation is probably not result for my task.

If I add line to my graphics like this:

Graphics[{Red, Text[Style["Text", 160]], Black, Opacity[0.5], Disk[], 
  Disk[{0.5, 0}], Thickness[0.05], Line[{{0, 0}, {3, 1}}]}]

I tried modify code:

joineddisks = 
 MeshPrimitives[
  BoundaryDiscretizeGraphics[{Disk[], Disk[{0.5, 0}], Thickness[0.05],
     Line[{{0, 0}, {3, 1}}]}, MaxCellMeasure -> 0.002], 
  2]; Graphics[{Red, Text[Style["Text", 160]], Black, Opacity[0.5], 
  joineddisks}]

OR

joineddisks = 
 MeshPrimitives[
  BoundaryDiscretizeGraphics[{Disk[], Disk[{0.5, 0}], Thickness[0.05],
     Line[{{0, 0}, {3, 1}}]}, MaxCellMeasure -> 0.002], 
  1]; Graphics[{Red, Text[Style["Text", 160]], Black, Opacity[0.5], 
  joineddisks}]

Result is incorrect - Line with specific thickness is missing.
I mean that Line is not transformed to edge form.

Use StadiumShape such that it is a 2D object, not a 1D object. Again, it is not really supported at the moment, so you have to do some tricks to get the same effect.

Other method would be to Rasterize graphics objects first, then use SetAlphaChannel, then use Inset or Texture to put it back.

Thanks!

StadiumShape is good substitution.

/.Line[a_List]:>StadiumShape[a,0.05]