[chimera-dev] pil background Image

Greg Couch postmaster at cgl.ucsf.edu
Tue Jun 29 14:10:46 PDT 2010


Hi Ludovic,

This is possible, but a little tricky.  It requires writing Python 
code.  So if I were to code a solution (and I may if you don't, but I 
need to fix a few bugs first), I'd make a chimera extension that would 
load an image into an OpenGL texture, then in the 2D drawing pass, I'd 
draw it underneath everything that is currently drawn.  The reason for 
using a texture instead of a bitmap is to allow for high resolution 
backgrounds for saving images.

If you are inclined to write this yourself, code for a chimera extension 
that does OpenGL in Python can be found in the CHIMERA/share/Ilabel 
package.

     -- Greg

On 6/23/2010 2:14 PM, Eric Pettersen wrote:
> On Jun 22, 2010, at 1:25 PM, Ludovic Autin wrote:
>
>> Hi,
>>
>> I would like to know if its possible to use a PIL or a raw image as a 
>> background image.
>> And/Or can you help me figure out how to do it (maybe using some 
>> volume from image functinoality).
>> Ideally, I would like to be able to update in realtime this 
>> background image (either using a thread, or a callback)
>
> Hi Ludovic,
> The developer who could authoritatively answer your question (Greg 
> Couch) is out this week, so I'll take a stab at it:  I don't think so. 
> :-)  However, if your goal is to, say, make a movie with a background 
> you provide then you could write out image files with a transparent 
> background (described in this message: 
> http://www.cgl.ucsf.edu/pipermail/chimera-users/2008-January/002197.html) 
> <http://www.cgl.ucsf.edu/pipermail/chimera-users/2008-January/002197.html%29> 
> and use most any image-processing program to compose the Chimera 
> images with the background(s) you prefer.
> Despite my flippant answer in the first sentence, I don't really know 
> if it is possible to directly change the background.  When Greg gets 
> back I hope he will comment on that.  Perhaps you could say more about 
> what your ultimate goal is?
>
> --Eric
>
> Eric Pettersen
>
> UCSF Computer Graphics Lab
>
> http://www.cgl.ucsf.edu
>

Hi Ludovic,

Everything is possible.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20100629/3494a13b/attachment.html>


More information about the Chimera-dev mailing list