New Python Function - Image

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo »

i only want to export alpha if it is necessary. probably i will simply check if all values are 1.0 then. :)

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

Yes, you will not care about alpha values if they are all 1.0. Otherwise, you will :D

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

Post by macouno »

mchs3d: looking good... I'm impressed... looks like you've got some nice things going in the wiki as well.

My question though... since we can read the data... would it be possible to imput the data as well???

I'm looking for ways to stick a load of small images into one big one... And preferably without the PIL.

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

Post by Brandano »

I second that.
Actually, i can see two other uses for the ability to write pixels on the image:
To write image importers for unsupported formats, like the DDS textures.
To write procedural texture scripts.
Oh, yes another: to rewrite textures mapped on a different UV channel so that they match Blender's own single UV channel per mesh

Naturally, the ability to read the pixels allows us to write image exporters for unsupported formats, and things like resamplers for light probes and QTVR like images...

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

Yes, well, actually I wrote both Image.setPixel() and Image.Save() and posted them to the tracker. As you can see, however, they haven't been committed yet. :cry:

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

try this page - page

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

As you can see, however, they haven't been committed yet.
After our wiki discussion on naming and implementation, I was waiting for the float and integer versions of the get/setPixel methods or at least setPixelF().

I made the getPixelF() change since we did not want to release with a method name that would not be supported.

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

I guess I'm lost. Lately I've been going through some serious OS changes, so I haven't been on top of this. I thought I posted those, but I must have not. Give me some time, I'll clean up the code and add the needed functionality.

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

The updates are finally posted to the tracker. :wink:

mchs3d
Posts: 0
Joined: Thu Feb 03, 2005 6:05 am
Location: Loveland, CO

Post by mchs3d »

Sorry, I guess I wasn't specific enough in my last post. I have posted to the tracker (here)
the following functions and their docs:

- Image.getPixelI(x, y)
- Image.getMinXY()
- Image.setPixelF(x, y, [r, g, b, a])
- Image.setPixelI(x, y, [r, g, b, a])
- Image.save()

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

Your 16-jun msg was specific enough. Just haven't gotten to it yet.

I noticed you included a test script. Nice!

Post Reply