MathGroup Archive 1996

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

Search the Archive

Re: Importing gif, tiff... (etc) as an array

  • To: mathgroup at
  • Subject: [mg4858] Re: Importing gif, tiff... (etc) as an array
  • From: Harald Berndt <hberndt9 at>
  • Date: Thu, 26 Sep 1996 22:42:17 -0400
  • Organization: IDT Corporation
  • Sender: owner-wri-mathgroup at

Adriano Barenco wrote:
> Dear Newsgroup,
> apologies if this is a faq. I would like to be able to import in MMA
> pictures. Ideally I am looking for a function that reads in a file and
> return an Array of integer. The size of the array should match the size
> of the picture and the integer could represent the levels of gray of the
> corresponding pixel.
> Any help appreciated.

On the Mac, at least, you can simply
- paste the graphic you want from another application
- select the graphics cell
- select the "Convert To InputForm" option from the Graph menu
- assign the Raster[] data in the generated cell to a variable (and/or 
save the data to disk

The Raster[] object contains the pixel data you want and has just the 
resolution of the pasted image.

Harald Berndt, Ph.D.                              Research Specialist,

Phone:	510-652-5974                                FAX:			510-215-4299
"I am what I am"..................................  .Popeye the Sailor

(KRYTEN:.............Are you sure? I always thought it was Descartes!)
(LISTER:.So did I, man! It's so easy to get those two dudes mixed up!)


  • Prev by Date: Re: programming competition
  • Next by Date: HELP with ListPlotVectorField[]
  • Previous by thread: Re: Importing gif, tiff... (etc) as an array
  • Next by thread: egpacks compilation for windows NT