vipsthumbnail sharpen defaults to mild

and add a "none" option
This commit is contained in:
John Cupitt 2013-05-06 14:01:29 +01:00
parent f80bf594ce
commit 7eb3513d46
3 changed files with 3730 additions and 9 deletions

View File

@ -68,10 +68,11 @@ to see a list of valid interpolators. The default is
.B bilinear.
.TP
.B -r, --sharpen=MASKFILE
Images can look a little soft after shrinking. This option lets you specify a
sharpening mask. Use "mild" to select a built-in mask which sharpens slightly.
The built-in mask is:
.B -r, --sharpen=none|mild|MASKFILE
Images can look a little soft after shrinking. This option lets you specify
a sharpening mask. Use "none" to disable sharpening, or "mild" to sharpen
lightly, or give the filename of a custom mask file to use. The default is
"mild". The built-in mild sharpen mask is:
3 3 24 0
-1 -1 -1

3717
po/vips7.33.pot Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,7 @@ static char *output_format = "tn_%s.jpg";
static char *interpolator = "bilinear";
static char *export_profile = NULL;
static char *import_profile = NULL;
static char *convolution_mask = NULL;
static char *convolution_mask = "mild";
static gboolean delete_profile = FALSE;
static gboolean verbose = FALSE;
@ -79,8 +79,8 @@ static GOptionEntry options[] = {
N_( "INTERPOLATOR" ) },
{ "sharpen", 'r', 0,
G_OPTION_ARG_STRING, &convolution_mask,
N_( "sharpen with MASKFILE" ),
N_( "MASKFILE" ) },
N_( "sharpen with none|mild|MASKFILE" ),
N_( "none|mild|MASKFILE" ) },
{ "eprofile", 'e', 0,
G_OPTION_ARG_STRING, &export_profile,
N_( "export with PROFILE" ),
@ -149,7 +149,10 @@ sharpen_filter( void )
static INTMASK *mask = NULL;
if( !mask ) {
if( strcmp( convolution_mask, "mild" ) == 0 ) {
if( strcmp( convolution_mask, "none" ) == 0 ) {
mask = NULL;
}
else if( strcmp( convolution_mask, "mild" ) == 0 ) {
mask = im_create_imaskv( "sharpen.con", 3, 3,
-1, -1, -1,
-1, 32, -1,
@ -228,7 +231,7 @@ shrink_factor( IMAGE *in, IMAGE *out,
*/
if( shrink > 1 &&
residual <= 1.0 &&
convolution_mask ) {
sharpen_filter() ) {
if( verbose )
printf( "sharpening thumbnail\n" );