Batch Convert BMP to png without compression

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Batch Convert BMP to png without compression

Post by glennrp »

Plisgyn wrote: I am trying to convert a directory of BMP files to png without compression using mogrify.
All the files are converted o/k but are compressed I am using version 6.2.9.3 and
mogrify - format png -compress none *.BMP. Any help appreciated.

There's no uncompressed PNG format. PNG compression is always lossless unless you deliberately reduce the number of colors.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp »

Plisgyn wrote: I found out why I was confused about convert I somehow managed to change bmp to png
files with the same file size. My program which wouldn't read bmp files now read them o/k
, I now realise that I somehow must have just changed the file type from bmp to png and
not reformatted the file. I now rephrase the question how can you change the compression
ratio when converting to png?.

Use the -quality option. The parameter for this option has two digits.
The first digit is the "deflate" level, 1 being the fastest and 9 giving
the highest compression. The second digit is the PNG filter. Good
choices are -quality 90 for drawings and -quality 95 for photos. For
high compression speed, use 20. Regardless of the quality setting,
you will get identical images.
Post Reply