Newsgroups: comp.soft-sys.math.mathematica
From: "Steve Luttrell" <steve_usenet@_removemefirst_luttrell.org.uk>
Date: Mon, 28 Feb 2005 08:39:06 +0000 (UTC)
Local: Mon, Feb 28 2005 3:39 am
Subject: Re: Precise bitmaps
I have used precisely the same export/import trick as you in order to use
the Mathematica rendering engine to generate bitmaps for use in image processing applications. My cure to the extra white space problem was to simply discard those pixels after Importing the bitmap, and to anticipate this loss of pixels by Exporting a slightly larger bitmap in the first place. I have just tried to reproduce what I did using Mathematica 5.1 (for Load a package for generating a pretty image. << "Graphics`Shapes`" Generate an image (with a black background so you can see the extra white g = Show[Graphics3D[Torus[], Background -> RGBColor[0, 0, 0]]] Now have a look at the contents of g2. The first part is the image data, so Dimensions[g2[[1,1]]] {101, 101, 3} Make a copy of g2, and then hack it to crop the image. I am dropping the g3 = g2; Have a look at the contents of g3. Dimensions[g3[[1,1]]] {100, 100, 3} That should do what you want. Steve Luttrell "Jan G. Korvink" <korv...@t-online.de> wrote in message > Dear All,
> I am battling to obtain a "precise" Raster[] of some Graphics[] objects. > Export[ /tmp/myfile, Graphics[myGraphics], ImageSize -> {xmax,ymax} > from which I can unpack the Raster[]. Unfortunately the Raster[] > What works is to use Adobe Illustrator as the rendering engine. But this > I do not want to implement a renderer, unless absolutely necessary, and > Can anyone suggest an alternative route? > Thanks in advance, Jan You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||