It is possible to create an Image Texture from the Vertex Color layer. The process is a little convoluted (for the time being)
Method 1
- Establish the vertex color map
- Make a material from the vertex colors
- Bake Mode: Texture
- Make a material node tree to brighten the original texture with the baked one
Method 2 (cycles specific.. but can be done in BI too)
Establish the Vertex color map
Add Node Material to rgb Mix this:
- Texture node
- Attribute node referencing 'Col'
Establish the vertex color map. Here i'm remapping from average distance to the median of each polygon, I suspect you can modify it to behave the way you want. For this to work you need to be in vertex paint mode
import bpy
from mathutils import Vector
obj = bpy.data.objects["Plane.001"]
mesh = obj.data
mesh.vertex_colors.new()
color_layer = mesh.vertex_colors.active
verts = mesh.vertices
polys = []
# first scan through to figure out min and max stretch
for poly in mesh.polygons:
face_median = Vector()
for idx in poly.vertices:
face_median += verts[idx].co
face_median /= poly.loop_total
qdist = lambda idx: (verts[idx].co - face_median).length
stretch = sum([qdist(idx) for idx in poly.vertices])
polys.append( stretch / poly.loop_total )
# now colour them as a function of their relative stretch
min_val = min(polys)
max_dif = max(polys) - min(polys)
i = 0
for g, poly in enumerate(mesh.polygons):
c = (polys[g] - min_val) / max_dif
for idx in poly.loop_indices:
color_layer.data[i].color = (c,c,c)
i += 1
## set to vertex paint mode to see the result
bpy.ops.object.mode_set(mode='VERTEX_PAINT')
1 - c
would give the inverse

Node Tree
The two methods differ mostly in how the Node Tree is constructed:
mix(baked, original texture)
mix(vertex_color_layer, original_texture)
.
It may end up something like this, the setup is pretty similar for Cycles and Blender Internal

But really there are many ways to set up this node tree, probably deserving their own Question/Answer.