Post processing in python.

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

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

Post processing in python.

Post by ideasman »

Some have said 'Why cant I render only specular' or 'Id like to render ambient occlusion by its self'

This would be cool and could be done in blender.
BUT, it could also be done in python,
imagine...
you could also use python for post processing, if a set of functions were added it could be quite simple to do post processing.

Perform a smart blur on an AO image and merge it back into the normal render.
I would use the gimp for the filters.

Code: Select all

aoImage = BPostRender(myScene, 'AO')
image = BPostRender(myScene, 'SPEC|DIFFUSE|RAY|MAT|TEX')

aoImage = BPostFilter(aoImage, 'SMART_BLUR', 5)
image = BPostComposite([image, aoImage], 'SUBTRACT')


Koba
Posts: 0
Joined: Thu Apr 15, 2004 9:48 am

Post by Koba »

Python for post processing?

That could be VERY powerfull (and useful) in my opinion. If I remember correctly, the GIMP does have a Python API of sorts. Personally, I have never done any post-processing within Blender so maybe I can't talk. If I had access to GIMP/Photoshop filters via Python in Blender, I would use it. Just think of the things you can do with a couple of filters and a programming languages :D.

I know there are the plugins which can be developed but Python seems to me to be more popular so using Python for postprocessing may well be a good idea.

Koba

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

Post by ideasman »

Id probably just use blender rather then the gimp.
The gimp does not compile with python by default and it would be possible to do many effects with python by applying images to faces and overlaying them with alpha materials or modifying them.

zoom blur, blur, rotate blur, DOF, ripple..

Could all be done this way.

an-toni
Posts: 0
Joined: Wed Mar 17, 2004 5:20 pm

Post by an-toni »

i've found the Python imaging library (PIL) nice for this kind of processing, http://www.pythonware.com/products/pil/

~Toni

Koba
Posts: 0
Joined: Thu Apr 15, 2004 9:48 am

Post by Koba »

Hi

The functionality of the PIL is great (I've had it a while now) but what I would like would be to use Python to apply GIMP/Photoshop filters on a render using Blender only (no external modules). Somehow I doubt this is possible though.

Koba

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

Post by ideasman »

Well you can launch gimp from the command line and get it to run in GUIless mode.

So it IS possible to use the gimp from python by using the OS module. and loading the gimp from the command line.

Koba
Posts: 0
Joined: Thu Apr 15, 2004 9:48 am

Post by Koba »

Hi

I'll have a look into it. Sounds good. Any chance of a demo script? I imagine a tighter connection between Blender and the GIMP would be a good thing. Maybe one day people will submit post processing scripts using the GIMP from Blender :D. Maybe we will also have a "Post processing" section of the scripts menu (now that would be good). Somehow I doubt it will catch on though due to reliance on the GIMP. :?

Koba

Dani
Posts: 143
Joined: Fri Oct 18, 2002 8:35 pm

Post by Dani »

hum... what?

Sorry, but I'm having trouble finding out how this would be useful... it's even quite redundant... post precessing in blender instead of the gimp, but still having the gimp installed and dedicated to this type of exercise...
IMHO, it doesn't make sense...

However, does this open the way to a better texture paint tool? if it does, then it's cool... but would python be responsive enough for this?


Dani

slikdigit
Posts: 133
Joined: Wed Oct 16, 2002 3:52 am
Location: Northampton, MA (US)

Post by slikdigit »

As to how this is useful, one word: automation. If you're rendering stills no problem, but for an animation it might be quite nice to 'script' some gimp filters into each frame as you go.
I know this is possible as a second step, but this way you've saved all rendering steps in the same .blend file. maintainable, esp. for large projects.

I dunno how all this relates to texture painting, 'cuz I assume for that you need gimp brushes and not just filters.

Dani
Posts: 143
Joined: Fri Oct 18, 2002 8:35 pm

Post by Dani »

Oh yeah...

Silly me, was forgetting the animation part. If I remember well, some investigation had been done in the past in this way (or similar) using a sequence plugin.

Check here:
http://www-users.cs.umn.edu/~mein/blend ... in/gimpit/

never used it though. maybe is there something good in the sources... hum?

Oh, about that texture paint stuff, I was just trying to hint people in expanding that deature, I confess :)

Ciao
Dani

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

Post by ideasman »

Gimp Sequencing plugin?

This looks very cool! Mabe it could be included in blender by default?- Added into it.

Post Reply