diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs
index 784d9aa11..8e6789132 100644
--- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs
+++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs
@@ -4,7 +4,6 @@
using System;
using System.Buffers;
using System.Buffers.Binary;
-using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.CompilerServices;
@@ -188,6 +187,7 @@ namespace SixLabors.ImageSharp.Formats.Png
chunk.Data.GetSpan().CopyTo(alpha);
this.paletteAlpha = alpha;
this.AssignTransparentMarkers(alpha, pngMetadata);
+ pngMetadata.HasTransparency = true;
break;
case PngChunkType.Text:
this.ReadTextChunk(metadata, pngMetadata, chunk.Data.GetSpan());
@@ -295,6 +295,7 @@ namespace SixLabors.ImageSharp.Formats.Png
chunk.Data.GetSpan().CopyTo(alpha);
this.paletteAlpha = alpha;
this.AssignTransparentMarkers(alpha, pngMetadata);
+ pngMetadata.HasTransparency = true;
if (this.colorMetadataOnly)
{
@@ -380,8 +381,8 @@ namespace SixLabors.ImageSharp.Formats.Png
///
/// Reads the least significant bits from the byte pair with the others set to 0.
///
- /// The source buffer
- /// THe offset
+ /// The source buffer.
+ /// THe offset.
/// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static byte ReadByteLittleEndian(ReadOnlySpan buffer, int offset)
@@ -392,7 +393,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// specified number of bits.
///
/// The bytes to convert from. Cannot be empty.
- /// The number of bytes per scanline
+ /// The number of bytes per scanline.
/// The number of bits per value.
/// The new array.
/// The resulting array.