converted png to raw then identify says unexpected EOF

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
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

converted png to raw then identify says unexpected EOF

Post by manit »

Here is what I did

$ identify ~/Downloads/sd04/png_txt/figs_0/f0001_01.png
/home/lxuser/Downloads/sd04/png_txt/figs_0/f0001_01.png PNG 512x512 512x512+0+0 8-bit RGB 256c 212KB 0.000u 0:00.000

$ convert ~/Downloads/sd04/png_txt/figs_0/f0001_01.png f0001_01.rgb

$ identify f0001_01.rgb
identify: must specify image size `f0001_01.rgb' @ error/rgb.c/ReadRGBImage/144.

$ identify -size "512x512" f0001_01.rgb
f0001_01.rgb RGB 512x512 512x512+0+0 16-bit TrueColor sRGB 786KB 0.020u 0:00.020
identify: unexpected end-of-file `f0001_01.rgb': No such file or directory @ error/rgb.c/ReadRGBImage/237.

I am using
$ convert --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
on 64 bit ubuntu OS .
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converted png to raw then identify says unexpected EOF

Post by snibgo »

You saved the RGB image as 8 bits/channel, but you are using Q16, so that is the default depth for reading. Use "-depth 8" in the read:

Code: Select all

identify -size "512x512" -depth 8 f0001_01.rgb 
snibgo's IM pages: im.snibgo.com
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converted png to raw then identify says unexpected EOF

Post by manit »

ok , i will try and report back.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converted png to raw then identify says unexpected EOF

Post by manit »

Can the rgb image I have made in original post be called raw pixmap ?
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converted png to raw then identify says unexpected EOF

Post by manit »

I am trying to convert a png image to format suitable for this utility .
It mentions raw pixmap as an option.
https://github.com/lessandro/nbis/blob/ ... an1/cwsq.1
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converted png to raw then identify says unexpected EOF

Post by snibgo »

In the context of grayscale fingerprints, "raw pixmap" might mean a headerless image file with one byte per pixel, 0=black and 255=white. IM can make this with ".gray" format, eg:

Code: Select all

conver rose: out.gray
snibgo's IM pages: im.snibgo.com
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converted png to raw then identify says unexpected EOF

Post by manit »

i will try that
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converted png to raw then identify says unexpected EOF

Post by manit »

That works.
Thanks a lot snibgo .
For somebody else who wants to convert image to wsq so that mindtct can detect minutae in it.

convert <input_image> sth.gray
identify -size <imgXximgY> -depth 8 sth.gray # to verify sth.gray
cwsq <compressionratio> wsq sth.gray -raw_in <imgX,imgY,8>

0.75 will make smaller wsq file in comparison to 3 .
I am guessing, they have recommended compression ratio of 3 .
Cannot understand tags (.br,.RE,.RS,.I,.TP) strewn all over https://raw.githubusercontent.com/lessa ... an1/cwsq.1 .
Post Reply