MathGroup Archive 1996

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

Search the Archive

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


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,
                                                           Consultant                        

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!)



==== [MESSAGE SEPARATOR] ====


  • 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