Page MenuHome

Add a Python template for image processing
ClosedPublic

Authored by Élie Michel (elie) on Oct 31 2020, 3:54 PM.

Details

Summary

This is a suggestion of introducing a new Python template to show how to do basic image processing in an efficient way. This is both useful as an example and to reduce boilerplate when there is a need for a quick image processing effect in a scene.

The methods foreach_get/foreach_set have been ported to image pixels in Blender 2.83.3 iirc and are little advertised in current Python templates, though they provide sth like 100x speedup compared to pixelwise copy.

Diff Detail

Event Timeline

Élie Michel (elie) requested review of this revision.Oct 31 2020, 3:54 PM
Élie Michel (elie) created this revision.

Might be a good idea to add an example to the api docs as well

Jacques Lucke (JacquesLucke) requested changes to this revision.Jan 15 2021, 12:15 PM

Besides these small style comments this seems fine. Thanks.

release/scripts/templates_py/image_processing.py
11

By convention comments should end with a dot.

12

Use image instead of img.

22

Example should start with a capital letter.

33

... to the output image.

This revision now requires changes to proceed.Jan 15 2021, 12:15 PM

Fixed JacquesLucke's remarks!

This revision is now accepted and ready to land.Mar 29 2021, 12:08 PM