Added auto reduction test as a property, so we can turn it off if the results are contra productive. Updated the readme.txt

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1714 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-03-20 17:04:41 +00:00
commit d3246b4368
3 changed files with 20 additions and 14 deletions

View file

@ -100,7 +100,8 @@ namespace Greenshot.Helpers {
break; break;
} }
// If Quantizing is enable, overwrite the image to save with a 256 - color version // check for color reduction, forced or automatically
if (conf.OutputFileAutoReduceColors || reduceColors) {
IColorQuantizer quantizer = ImageHelper.PrepareQuantize((Bitmap)imageToSave); IColorQuantizer quantizer = ImageHelper.PrepareQuantize((Bitmap)imageToSave);
int colorCount = quantizer.GetColorCount(); int colorCount = quantizer.GetColorCount();
LOG.InfoFormat("Image with format {0} has {1} colors", imageToSave.PixelFormat, colorCount); LOG.InfoFormat("Image with format {0} has {1} colors", imageToSave.PixelFormat, colorCount);
@ -110,10 +111,13 @@ namespace Greenshot.Helpers {
imageToSave = ImageHelper.Quantize((Bitmap)imageToSave, quantizer, 255); imageToSave = ImageHelper.Quantize((Bitmap)imageToSave, quantizer, 255);
// Make sure the "new" image is disposed // Make sure the "new" image is disposed
disposeImage = true; disposeImage = true;
} catch(Exception e) { } catch (Exception e) {
LOG.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e); LOG.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e);
} }
} }
} else {
LOG.Info("Skipping color reduction test, OutputFileAutoReduceColors is set to false.");
}
try { try {
// Create meta-data // Create meta-data

View file

@ -3,7 +3,7 @@ Greenshot: A screenshot tool optimized for productivity. Save a screenshot or a
CHANGE LOG: CHANGE LOG:
0.9.0 Build 1667 0.9.0 Build 1714
We changed the version to 0.9.0 as the amount of features in 0.8.1 was more than planned. We changed the version to 0.9.0 as the amount of features in 0.8.1 was more than planned.
@ -25,7 +25,7 @@ Features added:
* Added Ctrl/shift logic to the editor, hard to explain (see help) but hold one of the keys down and draw.. * Added Ctrl/shift logic to the editor, hard to explain (see help) but hold one of the keys down and draw..
* Added a color picker in the color dialog. * Added a color picker in the color dialog.
* Added shadow & torn edges * Added shadow & torn edges
* Added color reduction as an option and auto detection for image with less than 256 color. When using reduction this results in smaller files.
0.8.1 Build 1483 0.8.1 Build 1483

View file

@ -92,6 +92,8 @@ namespace GreenshotPlugin.Core {
public OutputFormat OutputFileFormat = OutputFormat.png; public OutputFormat OutputFileFormat = OutputFormat.png;
[IniProperty("OutputFileReduceColors", Description="If set to true, than the colors of the output file are reduced to 256 (8-bit) colors", DefaultValue="false")] [IniProperty("OutputFileReduceColors", Description="If set to true, than the colors of the output file are reduced to 256 (8-bit) colors", DefaultValue="false")]
public bool OutputFileReduceColors; public bool OutputFileReduceColors;
[IniProperty("OutputFileAutoReduceColors", Description = "If set to true the amount of colors is counted and if smaller than 256 the color reduction is automatically used.", DefaultValue = "true")]
public bool OutputFileAutoReduceColors;
[IniProperty("OutlookEmailFormat", Description = "Default type for emails. (Text, HTML)", DefaultValue="HTML")] [IniProperty("OutlookEmailFormat", Description = "Default type for emails. (Text, HTML)", DefaultValue="HTML")]
public EmailFormat OutlookEmailFormat; public EmailFormat OutlookEmailFormat;