Recently I have found the following problem:
I have a scanner that "suposelly" give 14 bits per channel depth but the only "image format"
I get to output / work with that depth is a RAW RGB file with the plain RGB data ...
Problem 1: I do not have always the same width nor height ...
I am using the IrfanView program but despite the image being shown if I "quit" I get asked to insert the correct size ( which I do not know ...)
So I am having several raw images that I can not read ...
IM convert reports that does does not have a decode delegate ...
If I try the identify util I also get the same "error" ...
how can I bypass the delegate and or force the file to be interpreted by IM ?
Is it possible to call convert with something like "convert -depth 14 image.raw JPG:output.jpg" without specifing sizes ?
How to read a RGB 14 bit per channel image
-
- Posts: 88
- Joined: 2010-06-29T14:36:09-07:00
- Authentication code: 8675308
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to read a RGB 14 bit per channel image
Without knowing exactly what they mean by 14 bits per pixel it is hard to say. Is it 2 bytes per value (16 bits) containign a 14 bit integer? Or do they mungle the bits together without regard for byte boundaries. Or perhaps 4 channels making it 4*14 or 56 bits and 7 bytes per pixel?
The "stream" utility may be able to to that latter, generating raw 16bit RGBA values taht normal Imagemagick commands can read.
The "stream" utility may be able to to that latter, generating raw 16bit RGBA values taht normal Imagemagick commands can read.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 88
- Joined: 2010-06-29T14:36:09-07:00
- Authentication code: 8675308
Re: How to read a RGB 14 bit per channel image
hi, after some more fidling I have found that the RAW image is read correclty with Irfanview ( the original program that made the image ... )
with the following options :
24 BPP ( 3bytes per pixel ) ; Color order: RGB ( 32bit RGBA) ; Interleaved (RGB) ...
But I have to "feed" the correct size first !!!
Nonetheless with the help of another uitl I have found that
by the size of the file 4106907 bytes I get something like 987x1387 ...
AFter finding those values I "feed" them to irfanview and got the correct image ...
How can i read this raw image with IM knowing this kind of info ?
with the following options :
24 BPP ( 3bytes per pixel ) ; Color order: RGB ( 32bit RGBA) ; Interleaved (RGB) ...
But I have to "feed" the correct size first !!!
Nonetheless with the help of another uitl I have found that
by the size of the file 4106907 bytes I get something like 987x1387 ...
AFter finding those values I "feed" them to irfanview and got the correct image ...
How can i read this raw image with IM knowing this kind of info ?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to read a RGB 14 bit per channel image
Assuming 24 bit oer pixel. 8 bit depth, RGB order and a size of 987x1387...
See Raw RGB data
http://www.imagemagick.org/Usage/formats/#rgb
Note when 16bits per color value is use you may also need a -endian setting to determine byte order (LSB is default)
I have made use of these settings for generating raw data output for gnuplot graphing.
Code: Select all
convert -depth 8 -size 987x1387 rgb:raw_data image.png
http://www.imagemagick.org/Usage/formats/#rgb
Note when 16bits per color value is use you may also need a -endian setting to determine byte order (LSB is default)
I have made use of these settings for generating raw data output for gnuplot graphing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/