Page 1 of 1

Extracting properties from JSON output

Posted: 2019-03-27T02:37:26-07:00
by salttrail
Hello,

Is it possible to pick specific properties once image is converted to json output instead of getting everything?

Re: Extracting properties from JSON output

Posted: 2019-03-27T06:22:18-07:00
by snibgo
When IM writes to "json:", it writes all the properties. You can then use an external program such as grep to filter the results, eg:

Code: Select all

magick toes.png -format %wx%h json: |grep gamma

    "gamma": 0.45455,
      "png:gAMA": "gamma=0.45454544 (See Gamma, above)",

Re: Extracting properties from JSON output

Posted: 2019-03-28T06:17:24-07:00
by salttrail
Thanks,

It will not work in my case since we are expecting and parsing actual json object