Controlling JPG resolution and other image properties in parsers

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Mar/2016, at 18:34

Since the version 2.0, there's a conversion step parameter SetSaveOpt.

In previous versions, the default quality value when saving an image after a conversion was80. It was possible to set the quality only on ChangeFormat step parameter.

SetSaveOpt solves the problem and keeps the backwards compatibility. There is a big size difference between an image saved with quality 100% and one saved with quality 80%.

It should be declared after all step conversions.

You can set the quality (integer value 0-100) and the color profile inclusion (integer value: if 0 there is no inclusion, if >0 the profile is saved within the image, default value true).

As the quality does it, the color profile inclusion can change significantly the final size of the output.

Available save options

JpegQuality: (only jpeg) set the image quality to the output file (range values: 1-100; default value: quality of the original image, if not possibile to read (the original image hasn't this information) 90)

JpegSubSampling: (only jpeg) subsampling is a compression option (boolean value; default value: subsampling value of the original image, if not possibile to read (the original image hasn't this information) true)

IncludeProfile: embed or not the color profile if the image format support color profile(boolean value; default value: true)

TiffCompression:  (only tiff) tiff compression alghoritm(allowed values: 2 = Lzw Algorithm; 3 = CoCCITTFax Algorithm; other values = No compression (default))

WriteClipPath: if exists, save clipping path data to output file (boolean value; default value: true)

WriteExifMetadata: if exists, save exif data to output file (boolean value; default value: true)

WriteIptcMetadata: if exists, save iptc data to output file (boolean value; default value: true)

WriteXmpMetadata: if exists, save xmp path data to output file (boolean value; default value: true)

SetSaveOpt step receive these parameters by a string containing a name-value list (name1:value1;name2:value2):

Sample from parser.exe

(note: type all in one line, here is wrapped for better readability)

parser.exe d:\FADE2WHITE.png -convert Scale -p:int 200 -convert ChangeFormat 

-p:string image/jpeg -convert SetSaveOpt -p:string IncludeProfile:true;WriteXmpMetadata:false;

JpegQuality:85;JpegSubSampling:true

A parameter with wrong values/syntax will be ignored.

Same syntax is used in variant parameters.