smallest filesize for transparent single pixel image

First of all, there is honestly no valid reason to use spacer GIFs in 2020 and beyond (unless you’re working with retro style websites), so this post is mostly just for the curious. Anyway let’s begin: The smallest valid transparent GIF is 35 bytes. data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAIBAAA= 47 49 46 38 39 61 01 00 01 00 …

Read more

WPF Window with transparent background containing opaque controls [duplicate]

Instead of setting the opacity of the window, set its background’s opacity: <Window x:Class=”WpfApplication3.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Title=”MainWindow” Height=”350″ Width=”525″ AllowsTransparency=”True” WindowStyle=”None”> <Window.Background> <SolidColorBrush Opacity=”0.5″ Color=”White”/> </Window.Background> <Grid> <Button Width=”200″ Height=”50″>button</Button> </Grid> </Window>

Setting Background color to transparent in Plotly plots

For a fully transparent plot, make sure to specify both the paper bgcolor and the plot’s: import plotly.plotly as py from plotly.graph_objs import * py.sign_in(”, ”) data = Data([ Bar( x=[‘Sivaranjani S’, ‘Vijayalakshmi C’, ‘Rajeshwari S’, ‘Shanthi Priscilla’, ‘Pandiyaraj G’, ‘Kamatchi S’, ‘MohanaPriya’, ‘Madhumitha G’, ‘Franklin Alphones Raj J’, ‘Akfaris Almaas’, ‘Biswajit Champati’, ‘Priya R’, …

Read more

Merging two images

Just create a new BufferedImage with transparency, then paint the other two images (with full or semi-transparency) on it. This is how it will look like: Sample code (images are called ‘image.png’ and ‘overlay.png’): File path = … // base path of the images // load source images BufferedImage image = ImageIO.read(new File(path, “image.png”)); BufferedImage …

Read more