Extract raw file from 16bit grayscale .png - how?

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
jpm9511
Posts: 2
Joined: 2013-09-03T14:12:11-07:00
Authentication code: 6789

Extract raw file from 16bit grayscale .png - how?

Post by jpm9511 »

I have a .png file which contains a 32x32, 16 bit grayscale image (more details are below). I need to extract the raw data file form it (should be 2048 bytes). I am using ImageMagick command line tool "stream", but do not know the correct parameters to pass it to accomplish my goal. Any help? Thanks -- I am new to this.

What I tried from the Linux command line: #stream -map i test.png test.raw

================== More Input Image Info Below ================
[jpm@siyao-vm images]$ identify -verbose test.png
Image: test.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 32x32+0+0
Resolution: 72x72
Print size: 0.444444x0.444444
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 16-bit
Channel depth:
gray: 16-bit
Channel statistics:
gray:
min: 129 (0.00196841)
max: 32899 (0.502007)
mean: 14224.8 (0.217057)
standard deviation: 16173.9 (0.246797)
kurtosis: -1.92379
skewness: 0.276039
Colormap: 65536
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Page geometry: 32x32+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2013-09-03T13:55:00-07:00
date:modify: 2013-09-03T13:55:00-07:00
signature: 146fe9eed955475bb3d71da0faacd4185cdd065ca4e277eee3209d2356c7cf5d
Artifacts:
verbose: true
Tainted: False
Filesize: 183b
Number pixels: 1kb
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract raw file from 16bit grayscale .png - how?

Post by snibgo »

Does ...

Code: Select all

convert test.png test.gray
... do what you want?
snibgo's IM pages: im.snibgo.com
jpm9511
Posts: 2
Joined: 2013-09-03T14:12:11-07:00
Authentication code: 6789

Re: Extract raw file from 16bit grayscale .png - how?

Post by jpm9511 »

That did it - thanks!
Post Reply