Page 1 of 1

wrong PNG background color ('bKGD' chunk)

Posted: 2012-09-03T03:51:31-07:00
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

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

Posted: 2012-09-03T07:06:50-07:00
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?

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

Posted: 2012-09-03T07:28:55-07:00
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

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

Posted: 2012-09-03T12:10:19-07:00
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)