Page 1 of 1

get all channel depths

Posted: 2019-03-14T05:59:44-07:00
by dirk1976
I need to get the depth for all channels. The simplest way is to use identify with the verbose option. But in IM7 this command is very time consuming. I think this belongs to the signature calculation.
Is it possible to get this information without signature calculation?
I already search for a format option, but don't find anything.

Thanks

Re: get all channel depths

Posted: 2019-03-14T06:34:47-07:00
by snibgo
"identify -verbose" will find the minimum number of bits needed for each channel. To do this, it needs to examine every value in every pixel, to find the number of significant binary digits. (This process could finish early if all channels need N digits, where N is the Q-number. But if the same code also calculates the signature, it won't finish early).

At the CLI, I don't think you can request just these depths for each channel. I suspect it can't be done even at the MagickCore level.

Re: get all channel depths

Posted: 2019-03-14T08:51:34-07:00
by fmw42
You can try using the string format %[depth] on each channel.

Code: Select all

magick image -separate -format "%[depth]\n" info: