Re: array into tiff format
- To: mathgroup at smc.vnet.net
- Subject: [mg32961] Re: array into tiff format
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 22 Feb 2002 01:48:42 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <a526d4$25l$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, make the data: tab = Table[Sin[x*y], {y, -Pi, Pi, 2Pi/128}, {x, -Pi, Pi, 2Pi/128}]; make the Graphics[] object {maxPix, minPix} = {Max[#], Min[#]} &[Flatten[tab]]; bitmap = Graphics[Raster[ Map[Round[255*(# - minPix)/(maxPix - minPix)] &, tab, {2}], {{0, 0}, Reverse[Dimensions[tab]]}, {0, 255}, ColorFunction -> GrayLevel]]; and save it Export["test.tif", bitmap, ExportRaster -> True] Regards Jens Thorsten Matthias wrote: > > Hi > I have an array of pixels where the value shall be related to the gray > level. How can I convert this data to the tiff-format? > Thanks, > Thorsten