Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: 1. Input of screen coordinates; 2. Fast graphics

  • To: mathgroup at
  • Subject: [mg27003] Re: 1. Input of screen coordinates; 2. Fast graphics
  • From: Erich Mueller <emuelle1 at>
  • Date: Tue, 30 Jan 2001 23:22:22 -0500 (EST)
  • Organization: University of Illinois at Urbana-Champaign
  • References: <94vs7q$> <95603s$>
  • Sender: owner-wri-mathgroup at

An alternative to Raster is ListDensityPlot or DensityGraphics, as in


Note that if you don't turn off the mesh you will really slow down the
rendering.  This is really the same as using Raster, look at the above
expression with FullForm[Graphics[%]].

As for using Raster, if you don't need a custom palette, the following
construction is simpler



On 30 Jan 2001, Jens-Peer Kuska wrote:

> Hi,
> I can't answer your first question, 
> Look into the Raster[] outpur if you read a palette
> image (GIF's) The color function is a huge switch statment
> with the palette. in you case it may help
> but
> yourPalette={3,5,67,255,196,...};
> Show[
> Graphics[
>   Raster[your600x600Array,ColorFunction->(Hue[yourPalette[[#]]/MaxColor]
> &)]
>  ]
> ]
> Hope that helps
>   Jens
> > 2nd question - Suppose you have an array 600x600 of numbers (of colors) in
> > Mathematica and you want to get an image of a square (600x600 pixels),
> > each pixel having a color depending on the number in the corresponding
> > position of the array. (If Color is the array and MaxColor the maximum
> > element of the array, the color of pixel {x,y} could be given by
> > Graphics[Hue[Color[[x,y]]/MaxColor]]).
> >         Of course it is very easy to do that by appending instructions
> > Graphics[Hue[color[[x,y]]/MaxColor]], Graphics[Point[[x,y]]], ... and for
> > economy, if the color did not change, you may even suppress the color
> > instruction. This works for small arrays, but it takes a lot of computing
> > time if the array is big, e.g. 600x600.
> >         Is there a fast way of getting the picture?
> >         If not, I would consider saving the corresponding array to a
> > file and using another program to view the image. Any suggestion?
> > 
> >         Thanks in advance.
> > 
> >         Manuel Chaves

  • Prev by Date: Re: Any better way for finding frequencies of list entries?
  • Next by Date: Re: Queries: notebook, matrices
  • Previous by thread: RE: RE: 1. Input of screen coordinates; 2. Fast graphics
  • Next by thread: RE: RE: 1. Input of screen coordinates; 2. Fast graphics