diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 74d61101273..6e495c5db8e 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -73,9 +73,17 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports if (ibuf == NULL) { BKE_reportf(reports, RPT_ERROR, "Couldn't acquire buffer from image"); } - - if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { - BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); + else { + /* temp swap out the color */ + const unsigned char imb_depth_back= ibuf->depth; + const float dither_back= ibuf->dither; + ibuf->depth= scene->r.planes; + ibuf->dither= scene->r.dither_intensity; + if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { + BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); + } + ibuf->depth= imb_depth_back; + ibuf->dither= dither_back; } BKE_image_release_ibuf(image, lock); |