[Image-SIG] Placing colored pixels next to each other

Steve Lianoglou lists.steve at arachnedesign.net
Mon Oct 30 19:16:10 CET 2006


> Steve Lianoglou wrote:
>
>> I'm using OS X so the show() function is defaulting to use  
>> Preview.app.
>
> and JPEG, I'm afraid:
...
> (I wonder how I missed that).
>
> what formats do Preview.app support?  can you try setting format to  
> None
> (that writes a PPM file using an optimized code path), or perhaps  
> "PNG".

Bingo!

Preview.app supports pretty much any format you can throw at it ...  
except for perhaps PPM(?)

I went into the Image.py file and set the format=None. Preview wasn't  
showing anything here ... it was being called alright, but no image  
was popping up.

I went back in there and changed the format to "PNG" and went through  
my song and dance and it looks to be working just perfectly. No  
artifacts around adjacent pixels.

Thanks for pointing me in the right direction with that. If there's  
anything else you'd like me to test w.r.t functionality on the mac,  
I'd be happy to.

Lastly, if I want to use transparency, would creating an RGBA image  
be the way to go?

I'm setting the color with a 4-tuple, of which I think the last  
number is the transparency (0-255?), but it seemingly has no effect  
on the opacity of the area I'm coloring (or the pixel).

I'm trying to create a "heat map" over my matrix, where full opacity  
would be something like "the strongest signal", and then I'd decrease  
opacity/increase transparency in the blocks/pixels where the signal  
is weaker.

Perhaps merging two images is how I should be doing it? I found this  
post that seems to take this approach:
http://mail.python.org/pipermail/python-list/1999-May/003369.html

Is that the best way to do it?

Thanks again,
-steve


More information about the Image-SIG mailing list