[Bf-blender-cvs] [b2c1bb7] master: Tweaks to PNG file output

Sergey Sharybin noreply at git.blender.org
Mon Nov 25 11:27:27 CET 2013


Commit: b2c1bb74b213db28a5c45f16813ca14ee985a9fe
Author: Sergey Sharybin
Date:   Mon Nov 25 16:22:55 2013 +0600
http://developer.blender.org/rBb2c1bb74b213db28a5c45f16813ca14ee985a9fe

Tweaks to PNG file output

- Made tooltip for compression a bit more clear.
- Use default compression of 15%. Gives around
  two times boost on export movie file here in
  test with only 10% increased file size.

Reviewers: Jonathan Williamson

===================================================================

M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 6a411f8..3dee2d4 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -976,7 +976,7 @@ int BKE_imtype_to_ftype(const char imtype)
 		return RADHDR;
 #endif
 	else if (imtype == R_IMF_IMTYPE_PNG)
-		return PNG | 90;
+		return PNG | 15;
 #ifdef WITH_DDS
 	else if (imtype == R_IMF_IMTYPE_DDS)
 		return DDS;
@@ -1340,7 +1340,7 @@ void BKE_imformat_defaults(ImageFormatData *im_format)
 	im_format->imtype = R_IMF_IMTYPE_PNG;
 	im_format->depth = R_IMF_CHAN_DEPTH_8;
 	im_format->quality = 90;
-	im_format->compress = 90;
+	im_format->compress = 15;
 
 	BKE_color_managed_display_settings_init(&im_format->display_settings);
 	BKE_color_managed_view_settings_init(&im_format->view_settings);
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 985eae1..a681363 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -435,7 +435,7 @@ Scene *BKE_scene_add(Main *bmain, const char *name)
 	sce->r.im_format.imtype = R_IMF_IMTYPE_PNG;
 	sce->r.im_format.depth = R_IMF_CHAN_DEPTH_8;
 	sce->r.im_format.quality = 90;
-	sce->r.im_format.compress = 90;
+	sce->r.im_format.compress = 15;
 
 	sce->r.displaymode = R_OUTPUT_AREA;
 	sce->r.framapto = 100;
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 6a0f174..82fa58b 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -46,6 +46,7 @@ void BLO_update_defaults_startup_blend(Main *main)
 
 	for (scene = main->scene.first; scene; scene = scene->id.next) {
 		scene->r.im_format.planes = R_IMF_PLANES_RGBA;
+		scene->r.im_format.compress = 15;
 
 		for (srl = scene->r.layers.first; srl; srl = srl->next)
 			srl->freestyleConfig.sphere_radius = 0.1f;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 686672e..97a29d3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3665,7 +3665,9 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
 	RNA_def_property_int_sdna(prop, NULL, "compress");
 	RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
-	RNA_def_property_ui_text(prop, "Compression", "Compression level for formats that support lossless compression");
+	RNA_def_property_ui_text(prop, "Compression", "Amount of time to determine best compression: "
+	                                              "0 = no compression with fast file output, "
+	                                              "100 = maximum lossless compression with slow file output");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
 	/* flag */




More information about the Bf-blender-cvs mailing list