Recently we had to move to a new server with a new imagemagick version. We always used the following to convert BMP's to transparent PNG's:
convert -limit memory 256mb -limit map 512mb TEST.bmp -transparent white -depth 8 -type PaletteMatte -shave 1x1 TEST.png
On the new server however the result is much different. The old server had ImageMagick 6.3.7, the new server version 6.6.2-6
On the old server I got a PNG with BitDepth 2, ColorType 3 and chunks: IHDR, PLTE, tRNS, BKGD, vpAG, IDAT and IEND
On the new server I get a PNG with BitDepth 8, ColorType 6 and chucks: IHDR BKGD, vpAG, IDAT, IDAT, tEXt, tEXt and IEND
The problem is that I am obligated to get a PNG with PLTE, tRNS chunks, BitDepth 2, ColorType 3. How would I achieve this result?
Old VS New ImageMagick BMP to Transparent PNG
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Old VS New ImageMagick BMP to Transparent PNG
PNG has undergone quite some development, though there are still some issues with -type. You might try upgrading. You might also try removing the -type palettmatte (what you need, though I don't see that option is -type bilevelmatte, though png may not support that) and then add PNG8: to your result image.
try this, though no guarantee that it will work:
convert -limit memory 256mb -limit map 512mb TEST.bmp -transparent white -depth 8 -shave 1x1 PNG8:TEST.png
The PNG developer will have to comment further as I am not an expert on PNG.
try this, though no guarantee that it will work:
convert -limit memory 256mb -limit map 512mb TEST.bmp -transparent white -depth 8 -shave 1x1 PNG8:TEST.png
The PNG developer will have to comment further as I am not an expert on PNG.
Re: Old VS New ImageMagick BMP to Transparent PNG
Try this.Your input file probably has only 4 colors or less, including the transparent color, so you can omit the "-colors 3".
You don't want to use PNG8 because that will force the bit-depth to be 8.
Code: Select all
convert -limit memory 256mb -limit map 512mb TEST.bmp -transparent white -colors 3 -shave 1x1 TEST.png
You don't want to use PNG8 because that will force the bit-depth to be 8.