Page MenuHome

White Balance modifier for the VSE
ClosedPublic

Authored by Thomas Beck (plasmasolutions) on Dec 27 2015, 10:18 PM.

Details

Summary

This snippet creates a white balance modifier for the video sequence editor. It is useful for everyone who likes to set a new white point in the video source (easily via the eyedropper). Just select a point in the source file where you know that it should be white. The algorithm will then shift the colors towards your new white point.

See attached the image for a quick demo.

Diff Detail

Repository
rB Blender

Event Timeline

Thomas Beck (plasmasolutions) retitled this revision from to White Balance modifier for the VSE.
Thomas Beck (plasmasolutions) updated this object.
Thomas Beck (plasmasolutions) set the repository for this revision to rB Blender.

Nice work!

Generally it's good, but I'd like premultiplication for byte images to be taken into account before giving it the final LGTM.

source/blender/blenkernel/intern/seqmodifier.c
196

mul_v3_v3 with a float[3] can be used here instead of using a matrix.

207

for byte data you have to premultiply and unpremultply before/after use, check color_balance_byte_byte for instance.

210

use mul_v3_v3 instead

224

don't forget to unpremultiply

Also need to convert byte images to linear space too (in addition to premultiply)

source/blender/blenkernel/intern/seqmodifier.c
234

also convert to linear before copying (property is in gamma space so it needs conversion)

Thomas Beck (plasmasolutions) edited edge metadata.
  • Review points solved
  • Picked color value was not in correct color space (display) - thanks to Psy-fi for detection and assistance

OK, one more thing which is missing is read-write from file save. As far as I can see writing should be explicit but make sure to load the scene back in lib_link_sequence_modifiers

  • After changing the ...new_modfier function we have to set scene on file load, otherwise an invalid scene access happens
Antony Riakiotakis (psy-fi) edited edge metadata.

LGTM, fire away!

This revision is now accepted and ready to land.Dec 28 2015, 12:03 PM
This revision was automatically updated to reflect the committed changes.