Hi Alan,

On 19.09.06, Alan G Isaac wrote:
> On Tue, 19 Sep 2006, Simon Burton apparently wrote: 
> > if you really do have a bitmap then PIL is the answer. 
> 
> OK.  If I understand correctly,
> I can use the same string for both.
> That is, if my string is called 'colorstring' then
> where I was doing:
>     image_rgb = pyx.bitmap.image(xn,yn,"RGB",colorstring)
> I can now also use PIL to do:
>     im = Image.fromstring('RGB',(xn,yn),colorstring)
> and save as a JPEG.
> 
> Is this right? (I'm new to images...)
> Seems to work. 

Fine. But please have another look at the description of the bitmap
class:
http://pyx.sourceforge.net/manual/module-bitmap.html

pyx.bitmap.image is a simple "container" to store the image data in
PyX *without* needing the PIL. On the other hand, if you already use
the PIL anyway, you can use a PIL image instance directly for
pyx.bitmap.bitmap. (The intention of pyx.bitmap.image was to be able
to deal with bitmap data *without* having the PIL.)


André

PS: If your whole image is a bitmap image and you want to use PyX to
just convert it to PostScript or PDF, you can also use the
imgconvert.py script in the contrib directory. Since PyX does a quite
good job in creating compressed bitmap images, the result of a
png/jpg/whatever -> PS/EPS/PDF is usually quite good.

PPS: Finally we've added a pipeGS method to canvas instances in PyX
0.9, which can be used to write png/jpg/whatever directly from within
PyX by using ghostscript. I'm really leaving the subject now, but
maybe some of our long-time users have not yet seen this new feature
of PyX 0.9, which sometimes can be useful ...

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to