Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can get most of this information from the files extended properties like this:</p> <pre><code>$path = 'D:\image.png' $shell = New-Object -COMObject Shell.Application $folder = Split-Path $path $file = Split-Path $path -Leaf $shellfolder = $shell.Namespace($folder) $shellfile = $shellfolder.ParseName($file) $width = 27 $height = 28 $Dimensions = 26 $size = 1 $shellfolder.GetDetailsOf($shellfile, $width) $shellfolder.GetDetailsOf($shellfile, $height) $shellfolder.GetDetailsOf($shellfile, $Dimensions) $shellfolder.GetDetailsOf($shellfile, $size) </code></pre> <p>You can also get the size in other ways such as <code>(Get-Item D:\image.png).Length / 1KB</code>.</p> <p>The bit depth property doesn't seem to be listed in the extended properties though even though its available when you right click the file.</p> <p><em>Update</em> Another option is to use .NET proper to avoid using COM:</p> <pre><code>add-type -AssemblyName System.Drawing $png = New-Object System.Drawing.Bitmap 'D:\image.png' $png.Height $png.Width $png.PhysicalDimension $png.HorizontalResolution $png.VerticalResolution </code></pre> <p><em>Update 2</em> The PixelFormat property gives you the bit depth.</p> <pre><code>$png.PixelFormat </code></pre> <p>The property is an enumeration of possible formats. You can view the complete list here:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.drawing.imaging.pixelformat.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.drawing.imaging.pixelformat.aspx</a></p> <p>For example <code>Format32bppArgb</code> is defined as </p> <blockquote> <p>Specifies that the format is 32 bits per pixel; 8 bits each are used for the alpha, red, green, and blue components.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload