Fix T52522: VSE renders with alpha transparent PNG image incorrectly

Need some extra checks and should be probably end up in 2.79 since that's a regression.
This commit is contained in:
Sergey Sharybin 2017-09-04 14:46:17 +02:00
parent 885c0a5f90
commit 71f0c32dad
Notes: blender-bot 2023-02-14 09:17:57 +01:00
Referenced by issue #52522, VSE renders with alpha transparent PNG image incorrectly
Referenced by issue #52071, Images with alpha channel broken under non sRGB color space in Sequencer
2 changed files with 13 additions and 7 deletions

View File

@ -482,9 +482,12 @@ void BKE_sequencer_editing_free(Scene *scene)
static void sequencer_imbuf_assign_spaces(Scene *scene, ImBuf *ibuf)
{
#if 0
/* Bute buffer is supposed to be in sequencer working space already. */
if (ibuf->rect != NULL) {
IMB_colormanagement_assign_rect_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
}
#endif
if (ibuf->rect_float != NULL) {
IMB_colormanagement_assign_float_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
}

View File

@ -47,6 +47,7 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_filetype.h"
#include "IMB_filter.h"
#include "IMB_moviecache.h"
#include "MEM_guardedalloc.h"
@ -1635,12 +1636,13 @@ static void *do_processor_transform_thread(void *handle_v)
if (float_from_byte) {
IMB_buffer_float_from_byte(float_buffer, byte_buffer,
IB_PROFILE_SRGB, IB_PROFILE_SRGB,
true,
false,
width, height, width, width);
IMB_colormanagement_processor_apply(handle->cm_processor,
float_buffer,
width, height, channels,
predivide);
IMB_colormanagement_processor_apply(handle->cm_processor,
float_buffer,
width, height, channels,
predivide);
IMB_premultiply_rect_float(float_buffer, 4, width, height);
}
else {
if (byte_buffer != NULL) {
@ -1776,14 +1778,15 @@ void IMB_colormanagement_transform_from_byte_threaded(float *float_buffer, unsig
*/
IMB_buffer_float_from_byte(float_buffer, byte_buffer,
IB_PROFILE_SRGB, IB_PROFILE_SRGB,
true,
false,
width, height, width, width);
IMB_premultiply_rect_float(float_buffer, 4, width, height);
return;
}
cm_processor = IMB_colormanagement_colorspace_processor_new(from_colorspace, to_colorspace);
processor_transform_apply_threaded(byte_buffer, float_buffer,
width, height, channels,
cm_processor, true, true);
cm_processor, false, true);
IMB_colormanagement_processor_free(cm_processor);
}