Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: Integrating over a Minimum
  • Next by Date: World map
  • Previous by thread: array into tiff format
  • Next by thread: Integrating over a Minimum