NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Any package to populate image from raw data?



Hi Mayuresh,

> I recently wrote a pyusb based driver to interact with an X ray camera.
> The driver gives me a byte array of a 16 bit grayscale image. I want to
> put this byte array into an image format. No specific format required as I
> can always convert it using ImageMagick.

I always do this kind of stuff with Jeff Poskanzer's PBM tools.
The the pksrc name for the whole toolkit is "netpbm".

In this case, rawtopgm(1) would probably your first step of a command
pipeline, finishing with any of the pgmto... or pnmto... tools to create
your target format; optionally with some transformations wegded in
in between.

						HNY, Martin Neitzel

NAME
       rawtopgm - convert raw grayscale bytes into a portable graymap

SYNOPSIS
       rawtopgm  [-bpp  [1|2]]  [-littleendian]  [-maxval  N]  [-headerskip N]
       [-rowskip N] [-tb|-topbottom] [width height] [imagefile]

DESCRIPTION
       Reads raw grayscale values as input.  Produces a PGM  file  as  output.
       The input file is just a sequence of pure binary numbers, either one or
       two bytes each, either bigendian  or  littleendian,  representing  gray
       values.   They  may  be arranged either top to bottom, left to right or
       bottom to top, left to right.  There may be arbitrary  header  informaâ??
       tion  at  the start of the file (to which rawtopgm pays no attention at
       all other than the header's size).


Home | Main Index | Thread Index | Old Index