I have about 5000 png24 files that I need converted to png8 preserving all transparency data..
Is this possible through terminal with image magick?
I have tried pngquant but no success, I kept getting this error :
NOTE: the -map option is NOT YET SUPPORTED.
Batch Convert png24 files to png8 preserving transparency
-
- Posts: 4
- Joined: 2014-02-10T17:05:31-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Batch Convert png24 files to png8 preserving transparenc
PNG24 (24-bit color) does not include any transparency. Do you mean PNG32 (24-bit color with 8-bit transparency)?
If so, the use mogrify to convert all the images in a folder
Assume image are in folder1 and you have an empty folder2 in which to put the output images (so you do not overwrite your input images)
Generally when doing this with convert, you will get the same results, but I thought that palettealpha data had binary alpha as when using PNG8:image.png for output. But with only -type palettealpha it seems to keep the 8-bit transparency, which is not what I thought was supported.
The above makes a 32-bit png.
give 8-bit alpha
but
gives binary alpha.
If so, the use mogrify to convert all the images in a folder
Assume image are in folder1 and you have an empty folder2 in which to put the output images (so you do not overwrite your input images)
Code: Select all
cd folder1
mogify -path path2/folder2 -format png -type palettealpha *.png
Code: Select all
convert logo: -transparent white PNG32:logo.png
convert logo.png -alpha on -channel a -blur +channel logo.png
Code: Select all
convert logo.png -type palettealpha logo2.png
but
Code: Select all
convert logo.png PNG8:logo3.png