How to recognize that PNG is a monochrome image

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
rishabh
Posts: 11
Joined: 2016-03-28T02:33:43-07:00
Authentication code: 1151

How to recognize that PNG is a monochrome image

Post by rishabh »

Hello ,
I just wanted to know how to find out if PNG is monochrome or not? and how to convert any png to 1bit monochrome png.
Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to recognize that PNG is a monochrome image

Post by snibgo »

Code: Select all

identify %[colorspace] in.png
See documentation http://www.imagemagick.org/script/escape.php

There are many different methods to make an image into black and white only. One method is:

Code: Select all

convert in.png -colorspace Gray -threshold 50% out.png
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to recognize that PNG is a monochrome image

Post by fmw42 »

Please always provide your IM version and platform, since syntax may differ.
rishabh
Posts: 11
Joined: 2016-03-28T02:33:43-07:00
Authentication code: 1151

Re: How to recognize that PNG is a monochrome image

Post by rishabh »

Hello . Thank you for response I am using IM 6.6.6 version on wndows platform
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to recognize that PNG is a monochrome image

Post by fmw42 »

6.6.6 is very old (over 250 versions old). Don't you think it is time to upgrade?
Post Reply