Re: Image[], Graphics[Raster[]]
- To: mathgroup at smc.vnet.net
- Subject: [mg100296] Re: [mg100270] Image[], Graphics[Raster[]]
- From: "David Park" <djmpark at comcast.net>
- Date: Sun, 31 May 2009 06:35:19 -0400 (EDT)
- References: <6147782.1243412890107.JavaMail.root@n11> <200905280829.EAA14200@smc.vnet.net> <1619090.1243671892104.JavaMail.root@n11>
You can use Image, ImageData and ArrayPlot, with a little manipulation, to
meld images into regular graphics. With Presentations it is easy to combine
images and graphics. Example:
Needs["Presentations`Master`"]
imag1 = Image[Import["ExampleData/lena.tif"], "Real"];
Draw2D[
{ArrayDraw[Map[RGBColor, ImageData[imag1, "Real"], {2}],
DataRange -> {{0, 2 \[Pi]}, {-1, 1}}],
Draw[Sin[x], {x, 0, 2 \[Pi]}],
White, Text[Style["Lena and a Sine Wave", 16], {2, -.8}]},
AspectRatio -> .8,
Frame -> True,
ImageSize -> 300]
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/
From: Scot T. Martin [mailto:smartin at seas.harvard.edu]
I'm taking a look at the new V7 Image[] command, and I'm left a bit
confused.
1. Is Image[] any different than Graphics[Raster[]] that I'm more
accustomed to?
2. If not, what was the point of introducing Image[]? Was it any effort to
provide a more streamlined set of commands all revolving around Image[],
e.g., ImageRotate[], etc.?
3. Image[] somehow upsets my unified view of Mathematica. That is, I like
to try to "think" like Mathematica, and so I understand that all commands
like Plot[], ListPlot[], etc., reduce to a Graphics[] object in
FullForm[]. Similarly, I can build my own type of plotting function with
Graphics[]. Most importantly, I can combine many different types of
objects into a single Graphics[]. Am I correct that Image[] represents
then a completely new display object? If so, is there a way, for example,
to have an Image[] and then draw across it with an Epilog rule like you
can do with Graphics[]? It seems a major setback if Image[] and Graphics[]
cannot be readily mixed.
Anyone out there to make the case that Image[] represents an important new
capability? I see it as a little worse than the usual "new command that
does same thing old stuff did" because it seems to lose the capability to
mix Graphics[] and Image[].
Please inform me if I'm completely off base. As I said, I'm just digging
into Image[] now for the first time, and I'm a bit confused about possible
merits---please do inform!
- References:
- Re: new to group - Chemical Equation Solutions
- From: "David Park" <djmpark@comcast.net>
- Re: new to group - Chemical Equation Solutions