mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Default AVIF encoding to 4:4:4 chroma subsampling #2562
This commit is contained in:
@@ -765,8 +765,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
->set("Q", baton->jpegQuality)
|
||||
->set("interlace", baton->jpegProgressive)
|
||||
->set("subsample_mode", baton->jpegChromaSubsampling == "4:4:4"
|
||||
? VIPS_FOREIGN_JPEG_SUBSAMPLE_OFF
|
||||
: VIPS_FOREIGN_JPEG_SUBSAMPLE_ON)
|
||||
? VIPS_FOREIGN_SUBSAMPLE_OFF
|
||||
: VIPS_FOREIGN_SUBSAMPLE_ON)
|
||||
->set("trellis_quant", baton->jpegTrellisQuantisation)
|
||||
->set("quant_table", baton->jpegQuantisationTable)
|
||||
->set("overshoot_deringing", baton->jpegOvershootDeringing)
|
||||
@@ -865,13 +865,11 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
// Write HEIF to buffer
|
||||
VipsArea *area = reinterpret_cast<VipsArea*>(image.heifsave_buffer(VImage::option()
|
||||
->set("strip", !baton->withMetadata)
|
||||
->set("compression", baton->heifCompression)
|
||||
->set("Q", baton->heifQuality)
|
||||
->set("compression", baton->heifCompression)
|
||||
->set("speed", baton->heifSpeed)
|
||||
#if defined(VIPS_TYPE_FOREIGN_SUBSAMPLE)
|
||||
->set("subsample_mode", baton->heifChromaSubsampling == "4:4:4"
|
||||
? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON)
|
||||
#endif
|
||||
->set("lossless", baton->heifLossless)));
|
||||
baton->bufferOut = static_cast<char*>(area->data);
|
||||
baton->bufferOutLength = area->length;
|
||||
@@ -931,8 +929,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
->set("Q", baton->jpegQuality)
|
||||
->set("interlace", baton->jpegProgressive)
|
||||
->set("subsample_mode", baton->jpegChromaSubsampling == "4:4:4"
|
||||
? VIPS_FOREIGN_JPEG_SUBSAMPLE_OFF
|
||||
: VIPS_FOREIGN_JPEG_SUBSAMPLE_ON)
|
||||
? VIPS_FOREIGN_SUBSAMPLE_OFF
|
||||
: VIPS_FOREIGN_SUBSAMPLE_ON)
|
||||
->set("trellis_quant", baton->jpegTrellisQuantisation)
|
||||
->set("quant_table", baton->jpegQuantisationTable)
|
||||
->set("overshoot_deringing", baton->jpegOvershootDeringing)
|
||||
@@ -1010,10 +1008,8 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
->set("Q", baton->heifQuality)
|
||||
->set("compression", baton->heifCompression)
|
||||
->set("speed", baton->heifSpeed)
|
||||
#if defined(VIPS_TYPE_FOREIGN_SUBSAMPLE)
|
||||
->set("subsample_mode", baton->heifChromaSubsampling == "4:4:4"
|
||||
? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON)
|
||||
#endif
|
||||
->set("lossless", baton->heifLossless));
|
||||
baton->formatOut = "heif";
|
||||
} else if (baton->formatOut == "dz" || isDz || isDzZip) {
|
||||
|
||||
@@ -293,7 +293,7 @@ struct PipelineBaton {
|
||||
heifQuality(50),
|
||||
heifCompression(VIPS_FOREIGN_HEIF_COMPRESSION_AV1),
|
||||
heifSpeed(5),
|
||||
heifChromaSubsampling("4:2:0"),
|
||||
heifChromaSubsampling("4:4:4"),
|
||||
heifLossless(false),
|
||||
withMetadata(false),
|
||||
withMetadataOrientation(-1),
|
||||
|
||||
Reference in New Issue
Block a user