Skip to content

How to check the format of an image ? #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lpatiny opened this issue Sep 18, 2015 · 1 comment
Open

How to check the format of an image ? #5

lpatiny opened this issue Sep 18, 2015 · 1 comment

Comments

@lpatiny
Copy link
Member

lpatiny commented Sep 18, 2015

You can use on unix system the "file" command. It seems installed by default on mac and linux ?!

> file grey8.png 
grey8.png: PNG image data, 30 x 90, 8-bit grayscale, non-interlaced

And it show that all the pictures in the 'format' folder are really the expected one.

@lpatiny
Copy link
Member Author

lpatiny commented Sep 18, 2015

identifyalso provides information and seems to be a standard unix command:

> identify grey16.png
grey16.png PNG 30x90 30x90+0+0 16-bit sRGB 258B 0.000u 0:00.000

If you want the full information you may also use the 'verbose' flag

> identify -verbose grey16.png
Image: grey16.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 30x90+0+0
  Resolution: 28.35x28.35
  Print size: 1.0582x3.1746
  Units: PixelsPerCentimeter
  Type: Grayscale
  Base type: Grayscale
  Endianess: Undefined
  Colorspace: Gray
  Depth: 16/15-bit
  Channel depth:
    gray: 15-bit
  Channel statistics:
    Pixels: 2700
    Gray:
      min: 0 (0)
      max: 65535 (1)
      mean: 53078.7 (0.80993)
      standard deviation: 16992.3 (0.259286)
      kurtosis: 1.57013
      skewness: -1.48351
      entropy: 0.84523
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant