From 850944e6cda763f099652bf97d52d22f1deb5daa Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 19 Oct 2020 11:29:47 +0200 Subject: Image: Export emissive colors in 3 channel PNG images Related to T81199. When saving a rendered image with transparency (RGBA) to a 3 channel PNG image the emissive colors were not exported. This change adds the emissive colors to the written file. NOTE: this does not fix the limitation of writing emissive colors to a 4 channel PNG file as the file format does not support this. --- source/blender/imbuf/intern/imageprocess.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'source/blender/imbuf/intern/imageprocess.c') diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 6ad69e72b4f..f8029c08bad 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -458,17 +458,8 @@ void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[ float *fp = rect_float; while (a--) { - if (fp[3] == 0.0f) { - copy_v3_v3(fp, backcol); - } - else { - float mul = 1.0f - fp[3]; - - fp[0] += mul * backcol[0]; - fp[1] += mul * backcol[1]; - fp[2] += mul * backcol[2]; - } - + const float mul = 1.0f - fp[3]; + madd_v3_v3fl(fp, backcol, mul); fp[3] = 1.0f; fp += 4; -- cgit v1.2.3