Transparency for Poly3DCollection plot in matplotlib

I made a slight modification to the OP code and got the transparency working. It appears that the facecolors argument of Poly3DCollection overrides the transparency argument, so the solution was to set the color in a separate call to either Poly3DCollection.set_color or Poly3DCollection.set_facecolor: from matplotlib import pyplot as plt from mpl_toolkits.mplot3d.art3d import Poly3DCollection fig = … Read more

Java: Filling a BufferedImage with transparent pixels

After you clear the background with the CLEAR composite, you need to set it back to SRC_OVER to draw normally again. ex: //clear g2.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); g2.fillRect(0,0,256,256); //reset composite g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); //draw g2.setPaint(Color.RED); g2.fillOval(50,50,100,100);

How to make completely transparent navigation bar in iOS 7

From this answer [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.navigationBar.translucent = YES; self.navigationController.view.backgroundColor = [UIColor clearColor]; self.navigationController.navigationBar.backgroundColor = [UIColor clearColor]; Also, as suggested by Josh in the comments, to put the bar back to default: [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];

How to make a transparent JFrame but keep everything else the same?

Basically, you need to make a transparent window and a translucent content pane. This will mean anything added to the content pane will continue to be rendered without additional alphering… public class TranscluentWindow { public static void main(String[] args) { new TranscluentWindow(); } public TranscluentWindow() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try … Read more

How do I make Tkinter support PNG transparency?

Here’s an example (the PNG file example.png has lots of transparency in different places): from Tkinter import Tk, Frame, Canvas import ImageTk t = Tk() t.title(“Transparency”) frame = Frame(t) frame.pack() canvas = Canvas(frame, bg=”black”, width=500, height=500) canvas.pack() photoimage = ImageTk.PhotoImage(file=”example.png”) canvas.create_image(150, 150, image=photoimage) t.mainloop() You need to make sure the image has been stored as … Read more

Converting transparent gif / png to jpeg using java

For Java 6 (and 5 too, I think): BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB); g = bufferedImage.createGraphics(); //Color.WHITE estes the background to white. You can use any other color g.drawImage(image, 0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), Color.WHITE, null);

php GD create a transparent png image

Set imagealphablending($image,true); on each new layer. Try this: <?php $image = imagecreatetruecolor(485, 500); imagealphablending($image, false); $col=imagecolorallocatealpha($image,255,255,255,127); imagefilledrectangle($image,0,0,485, 500,$col); imagealphablending($image,true); /* add door glass */ $img_doorGlass = imagecreatefrompng(“glass/$doorStyle/$doorGlass.png”); imagecopyresampled($image, $img_doorGlass, 106, 15, 0, 0, 185, 450, 185, 450); imagealphablending($image,true); /* add door */ $img_doorStyle = imagecreatefrompng(“door/$doorStyle/$doorStyle”.”_”.”$doorColor.png”); imagecopyresampled($image, $img_doorStyle, 106, 15, 0, 0, 185, 450, 185, 450); … Read more