pngsave: Change default row filter from 'all' to 'none' (#2929)

as this is usually faster and produces a smaller file size
This commit is contained in:
Lovell Fuller 2022-07-15 19:20:42 +01:00 committed by GitHub
parent a69e61a6d0
commit 1bf1a32f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 14 deletions

View File

@ -30,6 +30,7 @@
- add support for ICC profiles and linear encoding to JXL load and save [f1ac]
- add "reoptimise" to gifsave [dloebl]
- add "bitdepth" to magicksave [dloebl]
- change default PNG filter to "none" [lovell]
26/11/21 started 8.12.3
- better arg checking for vips_hist_find_ndim() [travisbell]

View File

@ -8,6 +8,8 @@
* - support png8 palette write with palette, colours, Q, dither
* 24/6/20
* - add @bitdepth, deprecate @colours
* 15/7/22 [lovell]
* - default filter to none
*/
/*
@ -135,13 +137,6 @@ vips_foreign_save_png_build( VipsObject *object )
if( !vips_object_argument_isset( object, "bitdepth" ) )
png->bitdepth = in->BandFmt == VIPS_FORMAT_UCHAR ? 8 : 16;
/* Filtering usually reduces the compression ratio for palette images,
* so default off.
*/
if( !vips_object_argument_isset( object, "filter" ) &&
png->palette )
png->filter = VIPS_FOREIGN_PNG_FILTER_NONE;
/* If this is a RGB or RGBA image and a low bit depth has been
* requested, enable palettization.
*/
@ -234,7 +229,7 @@ vips_foreign_save_png_class_init( VipsForeignSavePngClass *class )
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSavePng, filter ),
VIPS_TYPE_FOREIGN_PNG_FILTER,
VIPS_FOREIGN_PNG_FILTER_ALL );
VIPS_FOREIGN_PNG_FILTER_NONE );
VIPS_ARG_BOOL( class, "palette", 13,
_( "Palette" ),
@ -284,7 +279,7 @@ static void
vips_foreign_save_png_init( VipsForeignSavePng *png )
{
png->compression = 6;
png->filter = VIPS_FOREIGN_PNG_FILTER_ALL;
png->filter = VIPS_FOREIGN_PNG_FILTER_NONE;
png->Q = 100;
png->dither = 1.0;
png->effort = 7;
@ -493,9 +488,8 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer )
* contains an ICC profile named VIPS_META_ICC_NAME ("icc-profile-data"), the
* profile from the VIPS header will be attached.
*
* Use @filter to specify one or more filters (instead of adaptive filtering),
* see #VipsForeignPngFilter. @filter defaults to NONE for palette images,
* since they generally have very low local correlation.
* Use @filter to specify one or more filters, defaults to none,
* see #VipsForeignPngFilter.
*
* The image is automatically converted to RGB, RGBA, Monochrome or Mono +
* alpha before saving. Images with more than one byte per band element are

View File

@ -10,6 +10,8 @@
* - add @bitdepth, deprecate @colours
* 11/11/21
* - use libspng for save
* 15/7/22 [lovell]
* - default filter to none
*/
/*
@ -681,7 +683,7 @@ vips_foreign_save_spng_class_init( VipsForeignSaveSpngClass *class )
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveSpng, filter ),
VIPS_TYPE_FOREIGN_PNG_FILTER,
VIPS_FOREIGN_PNG_FILTER_ALL );
VIPS_FOREIGN_PNG_FILTER_NONE );
VIPS_ARG_BOOL( class, "palette", 13,
_( "Palette" ),
@ -731,7 +733,7 @@ static void
vips_foreign_save_spng_init( VipsForeignSaveSpng *spng )
{
spng->compression = 6;
spng->filter = VIPS_FOREIGN_PNG_FILTER_ALL;
spng->filter = VIPS_FOREIGN_PNG_FILTER_NONE;
spng->Q = 100;
spng->dither = 1.0;
spng->effort = 7;