image file manipulation?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

image file manipulation?

Post by macouno »

Hey guys.

Ok I'm in the middle of a script... and I will have it render a certain nr of images... probably square images...

I need to put all the rendered images into one bigger image...

A bit like the environment mapping function in blender does now.

But I need to do it with python. I think it's probably possible but I really have no idea how.

If anyone can point me in the right direction I'd really appreciate it.

Brandano
Posts: 0
Joined: Mon Apr 19, 2004 6:03 pm

Post by Brandano »

Hmm, to do this 'outside' blender you will probably need the Python Imaging Libraries, that you can download from http://www.pythonware.com/products/pil/. A workaround to do everything within Blender could be to builda new scene, with a set of UV mapped square meshes perpendicular to the camera, and render the 'composite' image in one go. I believe the texture baker does something similar, but I could be wrong, and it only has to work with one 'image' at a time.

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno »

Hmm yeah well the script I'm working on I am meaning to distribute amongst our fellow blender users.

So I'd like it not to need any additional libraries.

The "re render" sounds possible... but ehr... not too practical.

I saw that script that supposedly gets each pixel value from an image file... would it be possible to write one that puts those into another new or existing file?

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman »

My renderfarm stript renders Tiles and then composites the tiles within blender- No PIL, juts rendering the tiles tigether as a mesh, a bit hackish but works.

If you want have a look at me blenderfarm code... its in a post somewhere..
The composite function takes a list of images and outputs a blender image from memory-
- Cam

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno »

ideasman: that's really interesting... I'll definitely have a look at it.

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno »

I had a look at it ideasman... I'm nearly at the point where I can start with this bit of code.

It looks like you basicly put all images on a mesh (meshes) in a new scene in blender and rerendered.

am I right???

I wonder if there's a way to do it with straight file conversion... so without the render engine or playing around inside a blender 3d scene.

Basicly I'm at the point where I can render a UV correct image for every plane in a mesh... so if I can composite the images correctly (and I tweak it all a bit more) we've got an ao/shadow/raytracing/texturing baker script.

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno »

Had a thought just now.

Render an X and Y part image, but move the camera between the parts... that'd be perfect.

Not possible I think but I'd like it if someone could prove me wrong :twisted:

Post Reply