MathGroup Archive 1996

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

Search the Archive

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

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

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