Menu

#672 Transparency does not seem to be preserved for true color image with tRNS chunk

v1.0_(example)
open
None
5
2025-06-09
2022-08-05
Aya Helmy
No

I am trying to query the attached PNG using GraphicsMagick. The PNG has its transparency colour included in the tRNS chunk. I am confused as to why the transparency info is not being detected by GM. The opacity channel is all zeros even though I would have expected it to include the transparency info in the tRNS chunk (transparency colour is #B4B4FA00 and there are many pixels of this colour value in the image).

I see that this colour is being shown as the background colour in the returned info but it is not being interpreted as the transparency colour.

When I query the PNG using TweakPNG it shows that RGB(180,180,250) i.e. #B4B4FA00 is both the background colour and transparency colour, however I am not seeing this being returned by GM.

Thank you in advance.

GM version: GraphicsMagick 1.3.36 20201226 Q16 running on Windows 11

>> gm identify -verbose "Test.png"
Image: C:\Downloads\Test.png
  Format: PNG (Portable Network Graphics)
  Geometry: 2263x1338
  Class: DirectClass
  Type: true color
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
    Opacity:  1 bits
  Channel Statistics:
    Red:
      Minimum:                 23130.00 (0.3529)
      Maximum:                 65278.00 (0.9961)
      Mean:                    46915.58 (0.7159)
      Standard Deviation:       4119.95 (0.0629)
    Green:
      Minimum:                 16448.00 (0.2510)
      Maximum:                 59881.00 (0.9137)
      Mean:                    45827.89 (0.6993)
      Standard Deviation:       3635.53 (0.0555)
    Blue:
      Minimum:                  7710.00 (0.1176)
      Maximum:                 64250.00 (0.9804)
      Mean:                    60638.11 (0.9253)
      Standard Deviation:      11772.15 (0.1796)
    Opacity:
      Minimum:                     0.00 (0.0000)
      Maximum:                     0.00 (0.0000)
      Mean:                        0.00 (0.0000)
      Standard Deviation:          0.00 (0.0000)
  Resolution: 37.8x37.8 pixels/centimeter
  Filesize: 345.3Ki
  Interlace: No
  Orientation: Unknown
  Background Color: #B4B4FA00
  Border Color: #DFDFDF00
  Matte Color: #BDBDBD00
  Page geometry: 2263x1338+0+0
  Compose: Over
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Png:IHDR.color-type-orig: 2
  Png:IHDR.bit-depth-orig: 8
  Signature: 9743f056d8f3458d3c492a49b54fd59711939e0bd96d4e4914ed42bd2512c0be
  Tainted: False
  User Time: 0.031u
  Elapsed Time: 0m:0.023190s
  Pixels Per Second: 124.5Mi
1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2025-06-09
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2025-06-09

    I have not looked at this issue up until now. I have verified that the issue still exists.

     

Log in to post a comment.

MongoDB Logo MongoDB