wrong PNG background color ('bKGD' chunk)

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

wrong PNG background color ('bKGD' chunk)

Post by indiego »

Debian 6.0.5 -32bit, IM 6.6.0-4

The background color ('bKGD' chunk) for 'test-l.png' is set to (254,254,254) instead of pure white.

Code: Select all

convert -define compose:outside-overlay=false \
  preumbra-l.png umbra-l.png -set colorspace rgb -channel Alpha -gravity Center -compose Lighten -composite \
  -units PixelsPerInch -set density 150 -quality 00 -type TrueColorMatte -background white -colorspace rgb test-l.png 
Test images at
https://www.wuala.com/indiego/public/?key=caiCGLasLFmJ
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: wrong PNG background color ('bKGD' chunk)

Post by glennrp »

ImageMagick-6.7.9-2 with libpng-1.5.12 is giving me background color 255,255,255
I don't have 6.6.0-4 but 6.6.6-1 also gives 255,255,255.

Can you upgrade your IM to the current version?
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: wrong PNG background color ('bKGD' chunk)

Post by indiego »

I already have updated by compiling the latest version (6.7.9-2). With this version the color is no longer stored as a color string, it's stored as a palette entry number instead (palette entry 146 is pure white).

6.6.0-4: cKGD: background color = (254,254,254)
6.7.9-2: cKGD: background color = palette entry 146
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: wrong PNG background color ('bKGD' chunk)

Post by glennrp »

If you prefer the previous behavior (but with bKGD=(255,255,255)
you can use png32:test-l.png as the output format.

6.7.9-2 with png32:file.png as ouput: Background color: rgba(255,255,255,1)
Post Reply