diff --git a/app/actions/filters-actions.c b/app/actions/filters-actions.c index ffc0e00040..f214003a29 100644 --- a/app/actions/filters-actions.c +++ b/app/actions/filters-actions.c @@ -152,10 +152,10 @@ static const GimpStringActionEntry filters_actions[] = "gegl:color-exchange", NULL /* FIXME GIMP_HELP_FILTER_COLOR_EXCHANGE */ }, - { "filters-color-reduction", GIMP_STOCK_GEGL, - NC_("filters-action", "Color _Reduction..."), NULL, NULL, - "gegl:color-reduction", - NULL /* FIXME GIMP_HELP_FILTER_COLOR_TEMPERATURE */ }, + { "filters-dither", GIMP_STOCK_GEGL, + NC_("filters-action", "Dithe_r..."), NULL, NULL, + "gegl:dither", + NULL /* FIXME GIMP_HELP_FILTER_DITHER */ }, { "filters-color-rotate", GIMP_STOCK_GEGL, NC_("filters-action", "_Rotate Colors..."), NULL, NULL, @@ -665,7 +665,7 @@ filters_actions_update (GimpActionGroup *group, SET_SENSITIVE ("filters-checkerboard", writable); SET_SENSITIVE ("filters-color-enhance", writable && !gray); SET_SENSITIVE ("filters-color-exchange", writable); - SET_SENSITIVE ("filters-color-reduction", writable); + SET_SENSITIVE ("filters-dither", writable); SET_SENSITIVE ("filters-color-rotate", writable); SET_SENSITIVE ("filters-color-temperature", writable && !gray); SET_SENSITIVE ("filters-color-to-alpha", writable && !gray && alpha); diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 68b79ff871..65c4c42540 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -975,9 +975,9 @@ gimp_channel_convert_type (GimpDrawable *drawable, bits = (babl_format_get_bytes_per_pixel (new_format) * 8 / babl_format_get_n_components (new_format)); - gimp_gegl_apply_color_reduction (gimp_drawable_get_buffer (drawable), - NULL, NULL, - dest_buffer, bits, mask_dither_type); + gimp_gegl_apply_dither (gimp_drawable_get_buffer (drawable), + NULL, NULL, + dest_buffer, 1 << bits, mask_dither_type); } gimp_drawable_set_buffer (drawable, push_undo, NULL, dest_buffer); diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 7783af1a05..13c8e4a206 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -1071,7 +1071,7 @@ gimp_drawable_convert_type (GimpDrawable *drawable, if (old_bits <= new_bits || new_bits > 16) { /* don't dither if we are converting to a higher bit depth, - * or to more than 16 bits (gegl:color-reduction only does + * or to more than 16 bits (gegl:dither only does * 16 bits). */ layer_dither_type = GEGL_DITHER_NONE; diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 3d9b4db053..d8284b815b 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -1100,9 +1100,9 @@ gimp_layer_convert_type (GimpDrawable *drawable, bits = (babl_format_get_bytes_per_pixel (new_format) * 8 / babl_format_get_n_components (new_format)); - gimp_gegl_apply_color_reduction (gimp_drawable_get_buffer (drawable), - NULL, NULL, - src_buffer, bits, layer_dither_type); + gimp_gegl_apply_dither (gimp_drawable_get_buffer (drawable), + NULL, NULL, + src_buffer, 1 << bits, layer_dither_type); } dest_buffer = diff --git a/app/dialogs/convert-precision-dialog.h b/app/dialogs/convert-precision-dialog.h index d34ba5944d..7659a5e85f 100644 --- a/app/dialogs/convert-precision-dialog.h +++ b/app/dialogs/convert-precision-dialog.h @@ -20,7 +20,7 @@ /* Don't offer dithering when converting down to more than this - * number of bits per component. Note that gegl:color-reduction would + * number of bits per component. Note that gegl:dither would * do 16 bit, so this is a limitation of the GUI to values that make * sense. See bug #735895. */ diff --git a/app/gegl/gimp-gegl-apply-operation.c b/app/gegl/gimp-gegl-apply-operation.c index 0688b9eb15..16ca76f1ce 100644 --- a/app/gegl/gimp-gegl-apply-operation.c +++ b/app/gegl/gimp-gegl-apply-operation.c @@ -271,12 +271,12 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer, } void -gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer, - GimpProgress *progress, - const gchar *undo_desc, - GeglBuffer *dest_buffer, - gint bits, - gint dither_type) +gimp_gegl_apply_dither (GeglBuffer *src_buffer, + GimpProgress *progress, + const gchar *undo_desc, + GeglBuffer *dest_buffer, + gint levels, + gint dither_type) { GeglNode *node; @@ -284,14 +284,14 @@ gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer, g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); g_return_if_fail (GEGL_IS_BUFFER (dest_buffer)); - bits = CLAMP (bits, 1, 16); + levels = CLAMP (levels, 2, 65536); node = gegl_node_new_child (NULL, - "operation", "gegl:color-reduction", - "red-bits", bits, - "green-bits", bits, - "blue-bits", bits, - "alpha-bits", bits, + "operation", "gegl:dither", + "red-levels", levels, + "green-levels", levels, + "blue-levels", levels, + "alpha-bits", levels, "dither-method", dither_type, NULL); diff --git a/app/gegl/gimp-gegl-apply-operation.h b/app/gegl/gimp-gegl-apply-operation.h index 9039b5b6e3..cbe0b7d7d2 100644 --- a/app/gegl/gimp-gegl-apply-operation.h +++ b/app/gegl/gimp-gegl-apply-operation.h @@ -47,11 +47,11 @@ gboolean gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer, /* apply specific operations */ -void gimp_gegl_apply_color_reduction (GeglBuffer *src_buffer, +void gimp_gegl_apply_dither (GeglBuffer *src_buffer, GimpProgress *progress, const gchar *undo_desc, GeglBuffer *dest_buffer, - gint bits, + gint levels, gint dither_type); void gimp_gegl_apply_flatten (GeglBuffer *src_buffer, diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in index 101b6a0dc6..64687fc79b 100644 --- a/menus/image-menu.xml.in +++ b/menus/image-menu.xml.in @@ -601,7 +601,7 @@ - +