[gimp] Plug-ins: Add "Use Sharp YUV" for webp export
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Plug-ins: Add "Use Sharp YUV" for webp export
- Date: Tue, 26 Apr 2022 14:29:14 +0000 (UTC)
commit df402522ef28319e70440e68ee78c00b1f2d0387
Author: Nikc <nikcdc gmail com>
Date: Fri Apr 22 21:45:53 2022 +0000
Plug-ins: Add "Use Sharp YUV" for webp export
plug-ins/file-webp/file-webp-dialog.c | 18 ++++++++++++++++--
plug-ins/file-webp/file-webp-save.c | 12 +++++++++---
plug-ins/file-webp/file-webp.c | 6 ++++++
3 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/plug-ins/file-webp/file-webp-dialog.c b/plug-ins/file-webp/file-webp-dialog.c
index 867371185f..60a3154a8c 100644
--- a/plug-ins/file-webp/file-webp-dialog.c
+++ b/plug-ins/file-webp/file-webp-dialog.c
@@ -103,6 +103,19 @@ save_dialog (GimpImage *image,
"quality-frame", "lossless", TRUE,
"quality-options");
+ /* Create frame for additional features like Sharp YUV */
+ gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (dialog),
+ "advanced-title", _("Advanced Options"));
+
+ gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog),
+ "advanced-options",
+ "use-sharp-yuv",
+ NULL);
+
+ gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog),
+ "advanced-frame", "advanced-title", FALSE,
+ "advanced-options");
+
if (animation_supported)
{
GtkWidget *label_kf;
@@ -144,14 +157,15 @@ save_dialog (GimpImage *image,
/* Fill dialog with containers*/
gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog),
- "preset", "quality-frame", "animation-frame",
+ "preset", "quality-frame",
+ "advanced-frame", "animation-frame",
NULL);
}
else
{
/* Fill dialog with containers*/
gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog),
- "preset", "quality-frame",
+ "preset", "quality-frame", "advanced-frame",
NULL);
}
diff --git a/plug-ins/file-webp/file-webp-save.c b/plug-ins/file-webp/file-webp-save.c
index a307264ae9..be240a8fe4 100644
--- a/plug-ins/file-webp/file-webp-save.c
+++ b/plug-ins/file-webp/file-webp-save.c
@@ -156,12 +156,14 @@ save_layer (GFile *file,
gboolean lossless;
gdouble quality;
gdouble alpha_quality;
+ gboolean use_sharp_yuv;
g_object_get (config,
"preset", &preset,
"lossless", &lossless,
"quality", &quality,
"alpha-quality", &alpha_quality,
+ "use-sharp-yuv", &use_sharp_yuv,
NULL);
webp_decide_output (image, config, &profile, &out_linear);
@@ -238,9 +240,10 @@ save_layer (GFile *file,
* remaining values */
WebPConfigPreset (&webp_config, preset, quality);
- webp_config.lossless = lossless;
- webp_config.method = 6; /* better quality */
- webp_config.alpha_quality = alpha_quality;
+ webp_config.lossless = lossless;
+ webp_config.method = 6; /* better quality */
+ webp_config.alpha_quality = alpha_quality;
+ webp_config.use_sharp_yuv = use_sharp_yuv ? 1 : 0;
/* Prepare the WebP structure */
WebPPictureInit (&picture);
@@ -532,6 +535,7 @@ save_animation (GFile *file,
gdouble alpha_quality;
gint default_delay;
gboolean force_delay;
+ gboolean use_sharp_yuv;
g_return_val_if_fail (n_drawables > 0, FALSE);
@@ -546,6 +550,7 @@ save_animation (GFile *file,
"alpha-quality", &alpha_quality,
"default-delay", &default_delay,
"force-delay", &force_delay,
+ "use-sharp-yuv", &use_sharp_yuv,
NULL);
layers = gimp_image_list_layers (image);
@@ -704,6 +709,7 @@ save_animation (GFile *file,
webp_config.method = 6; /* better quality */
webp_config.alpha_quality = alpha_quality;
webp_config.exact = 1;
+ webp_config.use_sharp_yuv = use_sharp_yuv ? 1 : 0;
WebPMemoryWriterInit (&mw);
diff --git a/plug-ins/file-webp/file-webp.c b/plug-ins/file-webp/file-webp.c
index 8152f72468..678efecc94 100644
--- a/plug-ins/file-webp/file-webp.c
+++ b/plug-ins/file-webp/file-webp.c
@@ -187,6 +187,12 @@ webp_create_procedure (GimpPlugIn *plug_in,
0, 100, 100,
G_PARAM_READWRITE);
+ GIMP_PROC_ARG_BOOLEAN (procedure, "use-sharp-yuv",
+ "Use Sharp YU_V",
+ "Use sharper (but slower) RGB->YUV conversion",
+ FALSE,
+ G_PARAM_READWRITE);
+
GIMP_PROC_ARG_BOOLEAN (procedure, "animation-loop",
_("Loop _forever"),
"Loop animation infinitely",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]