On Windows 11, is there a way to confirm if a background is transparent on a PNG file without having to install a photo editing program like GIMP or Photoshop?
5 Answers
As an alternative to copying to the desktop, you can just click on or hover over the image in its current folder. For this to work you need the folder view/layout to be one which shows thumbnails, e.g. "Large icons".
Simply click on or hover over the file, and explorer will add a tint to the background. If you can see the tint through the image, then it has a transparent background.
-
This worked for me but I had to switch from dark mode in windows to light mode to see the effect. Sep 25 at 22:10
-
@MatthewVerstraete I've not tried the dark mode. Do the images not go from being a dark background to having a lighter background from the selection hightlight? Sep 25 at 22:13
-
7@MatthewVerstraete Added screenshots in dark mode - appears that it should work too Sep 25 at 23:08
-
1After playing a bit more it does work in dark mode, it was just a lot harder to see for this image but thanks for the extra mile. Sep 26 at 1:41
-
2This can fail, though, on some 8-bit PNG images, due to a bug in the thumbnailer which displays transparent pixels as black. I encounter this a lot.– trlklySep 26 at 23:55
The simplest, least technical way to decide is to drag it to the desktop. If you can see the desktop through it, it has transparency. If it's in a white square, it doesn't.
-
This does not seem to work in Win 11 22H2 with Firefox. If I open a local png I know has a transparent background Firefox gives it a white background (even though I am on dark theme) and that white background stays with it when being dragged around. Sep 25 at 22:10
-
Sorry, I've no experience with either Firefox or dark mode. Images above are on the Windows desktop not in a browser, in regular light mode.– TetsujinSep 26 at 9:57
-
I think the confusion is that the answer says "drag it", but means "drag and drop, then inspect", while Matthew interpreted the instruction as "inspect while dragging" Sep 26 at 15:32
-
You don't need to drop it [though you can], as soon as you drag it over something with a different background you should see it. I just can't test Firefox or dark mode.– TetsujinSep 26 at 15:35
-
@BenVoigt was correct, I was thinking about clicking, holding, drag, and looking at the background. Not about dropping it to the desktop and seeing if the desktop background would show through Sep 28 at 12:21
Open the image in Chrome, for example:
- Right click on any image on a web page and click
Open image in new tab
- Drag the image into an open Chrome window
Now right click on the image and click Inspect
.
Make sure the <img> element is selected in Elements
pane.
In Styles
pane, element.style
section, change the background-color
using the color picker. If the background color of the image changes as you choose the color then you have a transparent PNG/WEBP/GIF.
-
1Had not thought of that and it would not be limited to Chrome, Firefox could do that too. Sep 28 at 12:20
-
-
1
-
2
-
@AndreasRejbrand: Looks like the new Edge has Chrome-equivalent developer tools. Today I learned. Sep 28 at 14:57
Powershell is included with windows! :-) It allows you to look at the details of your image file. One item , the pixelformat, shows how many bits per pixel the image stores and also whether an Alpha channel, used for transparency, is present. The Alpha channel is displayed as the Argb at the end. This script will look for .png files in your home folder and show their full name and their Pixelformat
$pngs = get-childitem $env:USERPROFILE\*.png -recurse
add-type -AssemblyName system.drawing
foreach($png in $pngs){
$image = [System.Drawing.Image]::FromFile($png)
write-output "Image $png has pixelformat ($image.pixelformat.tostring())"
}
Unfortunately, Tardisrepairman's method just doesn't work and I don't know enough about Powershell to figure out why. It just tells me that every file is "pixelformat (System.Drawing.Bitmap.pixelformat.tostring())". Which is a bit odd because Bitmap wasn't in there in the first place. Maybe because I'm using Win10, not 11?
Sadly I've lost track of my old account which had a reasonable amount of rep on it, and have had to restart from zero so I'm not yet allowed to comment directly.
The other methods may work but really what I need personally and was looking for when search landed me here is something that will just list off whether or not each file has transparency. Is there any tool or program that will just tell you this info as part of it somehow? An image thumbnailing/cataloguing app perhaps? (I have tried Irfanview Thumbnails and found it lacking in this regard). Or even just the Open File dialogue of some particular image editor? (Hopefully not Photoshop as I ain't paying for that, but I'm happy to use GIMP)...
Context - I was trying to regain a bit of space by running OptiPNG on all my PNGs from Irfanview itself, but realised that the way the program handles transparency is not at all clear, and I don't know whether it will preserve or annihilate what's already there. It looks like the only options in the save menu are to add a transparent colour based on some particular criteria, which is absolutely not what I need... If nothing else I need to find something within the list that has transparency (there will certainly be some with either a transparent colour or an alpha channel, but there's thousands of the things...) so I can test it and see what happens.
It seems rather weird that there's no way to just ... show this, somehow? I can at least get Explorer to show me the dimensions and bitdepth of an image, after all. The presence of Alpha or Transparency should be just another quality like that, as suggested by TardisRepairman's reply, but I'm stuck at the point of extracting it. Tried messing with the script to correct any possible glaring errors with it but all I get back are cryptic error messages that are WAY above my current level.
-
1As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotNov 7 at 16:29
-
Interesting addendum to this btw - I just had a look at one that was supposedly 8-bit but looked like it probably had a transparent background. Opened it in Irfanview ... chose "Show Alpha channel" from the menus ... The obvious foreground stuff showed as white/opaque, the plain background as black/transparent ... but it wasn't a straight hard-edged 1-bit thing. The edges were antialiased, and there were some places with a distinct fade through semitransparent. Would this technically make it 16-bit with an 8-bit alpha, or might the transparency be tied to each of the actual palette entries?! Nov 7 at 16:40