ImageMagick(2) identify展示图像详细信息

版权声明:本文为博主ouening原创文章,未经博主允许不得恶意复制转载,需要注明出处,尊重知识成果!技术交流请联系[email protected]! https://blog.csdn.net/ouening/article/details/90576147

identify可以展示图像的详细信息,比如

  • 图像格式(format)
  • 图像尺寸(geometry)
  • 颜色空间(colorspace)
  • 图像深度(depth)
  • 图像通道数(channel)
  • 通道统计数据(channel statistics):包括RGBA各通道的统计数据(min,max,mean,std,skewness,entropy等),总像素数量
  • 图像统计数据(image statistics)
  • Gamma值
  • 质量(quality)
  • 属性(properties):创建时间,修改时间等
  • 图像文件大小(filesize)
  • 总像素数量(number pixels)

查看详细输出需要添加输入参数 -verbose,例如:

identify -verbose sport.jpg 

输出结果为:

Image: sport.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 183x275+0+0
  Units: Undefined
  Colorspace: sRGB
  Type: TrueColor
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Pixels: 50325
    Red:
      min: 0  (0)
      max: 255 (1)
      mean: 166.014 (0.651037)
      standard deviation: 56.3408 (0.220944)
      kurtosis: 0.0955807
      skewness: -0.654689
      entropy: 0.930072
    Green:
      min: 0  (0)
      max: 255 (1)
      mean: 170.397 (0.668224)
      standard deviation: 56.0181 (0.219679)
      kurtosis: 0.477013
      skewness: -1.05591
      entropy: 0.914691
    Blue:
      min: 0  (0)
      max: 255 (1)
      mean: 117.763 (0.461816)
      standard deviation: 71.2012 (0.27922)
      kurtosis: -0.85185
      skewness: 0.695633
      entropy: 0.917692
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 151.392 (0.593692)
      standard deviation: 61.1867 (0.239948)
      kurtosis: -1.02735
      skewness: -0.315713
      entropy: 0.920818
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 183x275+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 76
  Orientation: Undefined
  Properties:
    date:create: 2019-05-26T05:56:04+00:00
    date:modify: 2019-04-20T02:05:49+00:00
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    signature: db4af19ab88c64cc83633e97df3feb4c6b2b21c85352da91509858a57ad4555a
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 12202B
  Number pixels: 50325
  Pixels per second: 34.9039MP
  User time: 0.000u
  Elapsed time: 0:01.001
  Version: ImageMagick 7.0.8-46 Q16 x86_64 2019-05-26 https://imagemagick.org

如果没有使用参数-verbose,其输出内容较少,包括:文件名,图像格式,图像大小,图像深度,颜色空间,文件大小,用户时间等,例如:

$ identify sport.jpg 
sport.jpg JPEG 183x275 183x275+0+0 8-bit sRGB 12202B 0.000u 0:00.000

猜你喜欢

转载自blog.csdn.net/ouening/article/details/90576147
今日推荐