Allow images with alpha channel to use LAB sharpen #490

This commit is contained in:
Lovell Fuller
2016-07-04 21:33:44 +01:00
parent b70a7d9a3b
commit 4c172d25f6
4 changed files with 29 additions and 1 deletions

View File

@@ -244,9 +244,13 @@ namespace sharp {
return image.conv(sharpen);
} else {
// Slow, accurate sharpen in LAB colour space, with control over flat vs jagged areas
VipsInterpretation colourspaceBeforeSharpen = image.interpretation();
if (colourspaceBeforeSharpen == VIPS_INTERPRETATION_RGB) {
colourspaceBeforeSharpen = VIPS_INTERPRETATION_sRGB;
}
return image.sharpen(
VImage::option()->set("sigma", sigma)->set("m1", flat)->set("m2", jagged)
);
).colourspace(colourspaceBeforeSharpen);
}
}