From 287b7761d5effe5d20e6c0e575f57e6f658f795a Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 21 Oct 2022 13:46:20 +0900 Subject: [PATCH 01/23] Add link to wiki to README.md --- README | 1 - README.md | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 120000 README diff --git a/README b/README deleted file mode 120000 index 42061c0..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file diff --git a/README.md b/README.md index 8c35053..15c1222 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# GIMP Resynthesizer without Python +## about scm version +[see wiki/README](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/README) + # GIMP Resynthesizer Plugin Suite A set of plugins for the GIMP image editing app. From 52b0066a6cf289b1fd6772b1bb79121ff468e959 Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 21 Oct 2022 13:58:15 +0900 Subject: [PATCH 02/23] Rename scripts .py to .scm --- .../{plugin-heal-selection.py => plugin-heal-selection.scm} | 0 .../{plugin-heal-transparency.py => plugin-heal-transparency.scm} | 0 PluginScripts/{plugin-map-style.py => plugin-map-style.scm} | 0 .../{plugin-render-texture.py => plugin-render-texture.scm} | 0 .../{plugin-resynth-enlarge.py => plugin-resynth-enlarge.scm} | 0 ...in-resynth-fill-pattern.py => plugin-resynth-fill-pattern.scm} | 0 .../{plugin-resynth-sharpen.py => plugin-resynth-sharpen.scm} | 0 PluginScripts/{plugin-uncrop.py => plugin-uncrop.scm} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename PluginScripts/{plugin-heal-selection.py => plugin-heal-selection.scm} (100%) rename PluginScripts/{plugin-heal-transparency.py => plugin-heal-transparency.scm} (100%) rename PluginScripts/{plugin-map-style.py => plugin-map-style.scm} (100%) rename PluginScripts/{plugin-render-texture.py => plugin-render-texture.scm} (100%) rename PluginScripts/{plugin-resynth-enlarge.py => plugin-resynth-enlarge.scm} (100%) rename PluginScripts/{plugin-resynth-fill-pattern.py => plugin-resynth-fill-pattern.scm} (100%) rename PluginScripts/{plugin-resynth-sharpen.py => plugin-resynth-sharpen.scm} (100%) rename PluginScripts/{plugin-uncrop.py => plugin-uncrop.scm} (100%) diff --git a/PluginScripts/plugin-heal-selection.py b/PluginScripts/plugin-heal-selection.scm similarity index 100% rename from PluginScripts/plugin-heal-selection.py rename to PluginScripts/plugin-heal-selection.scm diff --git a/PluginScripts/plugin-heal-transparency.py b/PluginScripts/plugin-heal-transparency.scm similarity index 100% rename from PluginScripts/plugin-heal-transparency.py rename to PluginScripts/plugin-heal-transparency.scm diff --git a/PluginScripts/plugin-map-style.py b/PluginScripts/plugin-map-style.scm similarity index 100% rename from PluginScripts/plugin-map-style.py rename to PluginScripts/plugin-map-style.scm diff --git a/PluginScripts/plugin-render-texture.py b/PluginScripts/plugin-render-texture.scm similarity index 100% rename from PluginScripts/plugin-render-texture.py rename to PluginScripts/plugin-render-texture.scm diff --git a/PluginScripts/plugin-resynth-enlarge.py b/PluginScripts/plugin-resynth-enlarge.scm similarity index 100% rename from PluginScripts/plugin-resynth-enlarge.py rename to PluginScripts/plugin-resynth-enlarge.scm diff --git a/PluginScripts/plugin-resynth-fill-pattern.py b/PluginScripts/plugin-resynth-fill-pattern.scm similarity index 100% rename from PluginScripts/plugin-resynth-fill-pattern.py rename to PluginScripts/plugin-resynth-fill-pattern.scm diff --git a/PluginScripts/plugin-resynth-sharpen.py b/PluginScripts/plugin-resynth-sharpen.scm similarity index 100% rename from PluginScripts/plugin-resynth-sharpen.py rename to PluginScripts/plugin-resynth-sharpen.scm diff --git a/PluginScripts/plugin-uncrop.py b/PluginScripts/plugin-uncrop.scm similarity index 100% rename from PluginScripts/plugin-uncrop.py rename to PluginScripts/plugin-uncrop.scm From 854543c82391a58d3b7aa0adfdfba92c89d9dc8a Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 21 Oct 2022 13:59:07 +0900 Subject: [PATCH 03/23] Rewrite scripts from .py(python2) to .scm(tiny-scheme) plugin-unclop: Changed so that the synthesize result is opaque in layers with alpha. PluginScripts/Makefile.am: Change scripts installation folder from 'gimpdir/plug-ins' to 'gimpdir/scripts' --- PluginScripts/Makefile.am | 19 +- PluginScripts/plugin-heal-selection.scm | 445 ++++++---- PluginScripts/plugin-heal-transparency.scm | 203 +++-- PluginScripts/plugin-map-style.scm | 811 +++++++++--------- PluginScripts/plugin-render-texture.scm | 479 ++++++----- PluginScripts/plugin-resynth-enlarge.scm | 244 +++--- PluginScripts/plugin-resynth-fill-pattern.scm | 242 +++--- PluginScripts/plugin-resynth-sharpen.scm | 241 +++--- PluginScripts/plugin-uncrop.scm | 419 +++++---- 9 files changed, 1720 insertions(+), 1383 deletions(-) diff --git a/PluginScripts/Makefile.am b/PluginScripts/Makefile.am index c637a92..4af792f 100644 --- a/PluginScripts/Makefile.am +++ b/PluginScripts/Makefile.am @@ -4,18 +4,17 @@ ## pluginexecdir tells autotools where to install scripts ## scripts tells autotools the list of installable Python language scripts -pluginexecdir = $(gimpplugindir)/plug-ins +pluginexecdir = $(gimpplugindir)/scripts scripts = \ - plugin-heal-selection.py \ - plugin-resynth-sharpen.py \ - plugin-resynth-enlarge.py \ - plugin-uncrop.py \ - plugin-render-texture.py \ - plugin-map-style.py \ - plugin-heal-transparency.py \ - plugin-resynth-fill-pattern.py - + plugin-heal-selection.scm \ + plugin-resynth-sharpen.scm \ + plugin-resynth-enlarge.scm \ + plugin-uncrop.scm \ + plugin-render-texture.scm \ + plugin-map-style.scm \ + plugin-heal-transparency.scm \ + plugin-resynth-fill-pattern.scm pluginexec_SCRIPTS = $(scripts) diff --git a/PluginScripts/plugin-heal-selection.scm b/PluginScripts/plugin-heal-selection.scm index 8cd3a05..a47c19a 100644 --- a/PluginScripts/plugin-heal-selection.scm +++ b/PluginScripts/plugin-heal-selection.scm @@ -1,178 +1,267 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Heal selection" - -Copyright 2009 lloyd konneker (bootch at nc.rr.com) -Based on smart_remove.scm Copyright 2000 by Paul Harrison. - -Version: - 1.0 lloyd konneker lkk 9/21/2009 Initial version in python. - (See release notes for differences over P. Harrison's prior version in scheme language.) - -License: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - The GNU Public License is available at - http://www.gnu.org/copyleft/gpl.html - -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -debug = False - -def heal_selection(timg, tdrawable, samplingRadiusParam=50, directionParam=0, orderParam=0): - ''' - Create stencil selection in a temp image to pass as source (corpus) to plugin resynthesizer, - which does the substantive work. - ''' - if pdb.gimp_selection_is_empty(timg): - pdb.gimp_message(_("You must first select a region to heal.")) - return - - pdb.gimp_image_undo_group_start(timg) - - targetBounds = tdrawable.mask_bounds - - # In duplicate image, create the sample (corpus). - # (I tried to use a temporary layer but found it easier to use duplicate image.) - tempImage = pdb.gimp_image_duplicate(timg) - if not tempImage: - raise RuntimeError, "Failed duplicate image" - - # !!! The drawable can be a mask (grayscale channel), don't restrict to layer. - work_drawable = pdb.gimp_image_get_active_drawable(tempImage) - if not work_drawable: - raise RuntimeError, "Failed get active drawable" - - ''' - grow and punch hole, making a frisket iow stencil iow donut - - ''' - orgSelection = pdb.gimp_selection_save(tempImage) # save for later use - pdb.gimp_selection_grow(tempImage, samplingRadiusParam) - # ??? returns None , docs say it returns SUCCESS - - # !!! Note that if selection is a bordering ring already, growing expanded it inwards. - # Which is what we want, to make a corpus inwards. - - grownSelection = pdb.gimp_selection_save(tempImage) - - # Cut hole where the original selection was, so we don't sample from it. - # !!! Note that gimp enums/constants are not prefixed with GIMP_ - pdb.gimp_image_select_item(tempImage, CHANNEL_OP_SUBTRACT, orgSelection) - - ''' - Selection (to be the corpus) is donut or frisket around the original target T - xxx - xTx - xxx - ''' - - # crop the temp image to size of selection to save memory and for directional healing!! - frisketBounds = grownSelection.mask_bounds - frisketLowerLeftX = frisketBounds[0] - frisketLowerLeftY = frisketBounds[1] - frisketUpperRightX = frisketBounds[2] - frisketUpperRightY = frisketBounds[3] - targetLowerLeftX = targetBounds[0] - targetLowerLeftY = targetBounds[1] - targetUpperRightX = targetBounds[2] - targetUpperRightY = targetBounds[3] - - frisketWidth = frisketUpperRightX - frisketLowerLeftX - frisketHeight = frisketUpperRightY - frisketLowerLeftY - - # User's choice of direction affects the corpus shape, and is also passed to resynthesizer plugin - if directionParam == 0: # all around - # Crop to the entire frisket - newWidth, newHeight, newLLX, newLLY = ( frisketWidth, frisketHeight, - frisketLowerLeftX, frisketLowerLeftY ) - elif directionParam == 1: # sides - # Crop to target height and frisket width: XTX - newWidth, newHeight, newLLX, newLLY = ( frisketWidth, targetUpperRightY-targetLowerLeftY, - frisketLowerLeftX, targetLowerLeftY ) - elif directionParam == 2: # above and below - # X Crop to target width and frisket height - # T - # X - newWidth, newHeight, newLLX, newLLY = ( targetUpperRightX-targetLowerLeftX, frisketHeight, - targetLowerLeftX, frisketLowerLeftY ) - # Restrict crop to image size (condition of gimp_image_crop) eg when off edge of image - newWidth = min(pdb.gimp_image_width(tempImage) - newLLX, newWidth) - newHeight = min(pdb.gimp_image_height(tempImage) - newLLY, newHeight) - pdb.gimp_image_crop(tempImage, newWidth, newHeight, newLLX, newLLY) - - # Encode two script params into one resynthesizer param. - # use border 1 means fill target in random order - # use border 0 is for texture mapping operations, not used by this script - if not orderParam : - useBorder = 1 # User wants NO order, ie random filling - elif orderParam == 1 : # Inward to corpus. 2,3,4 - useBorder = directionParam+2 # !!! Offset by 2 to get past the original two boolean values - else: - # Outward from image center. - # 5+0=5 outward concentric - # 5+1=6 outward from sides - # 5+2=7 outward above and below - useBorder = directionParam+5 - - # Note that the old resynthesizer required an inverted selection !! - - if debug: - try: - gimp.Display(tempImage) - gimp.displays_flush() - except RuntimeError: # thrown if non-interactive - pass - from time import sleep - sleep(2) - - # Not necessary to restore image to initial condition of selection, activity, - # the original image should not have been changed, - # and the resynthesizer should only heal, not change selection. - - # Note that the API hasn't changed but use_border param now has more values. - pdb.plug_in_resynthesizer(timg, tdrawable, 0,0, useBorder, work_drawable.ID, -1, -1, 0.0, 0.117, 16, 500) - - # Clean up (comment out to debug) - gimp.delete(tempImage) - pdb.gimp_image_undo_group_end(timg) - - -register( - "python_fu_heal_selection", - N_("Heal the selection from surroundings as if using the heal tool."), - "Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "2009 Lloyd Konneker", # Copyright - "2009", - N_("_Heal selection..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_INT, "samplingRadiusParam", _("Context sampling width (pixels):"), 50), - (PF_OPTION,"directionParam", _("Sample from:"),0,[_("All around"),_("Sides"),_("Above and below")]), - (PF_OPTION, "orderParam", _("Filling order:"), 0, [_("Random"), - _("Inwards towards center"), _("Outwards from center") ]) - ], - [], - heal_selection, - menu="/Filters/Enhance", - domain=("resynthesizer", gimp.locale_directory) - ) - -main() +;; Gimp plugin "Heal selection" + +;; License: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; plugin-heal-selection.scm Copyright 2022 itr-tert +;; Based on plugin-heal-selection.py Copyright 2009 lloyd konneker (bootch at nc.rr.com) +;; Based on smart_remove.scm Copyright 2000 by Paul Harrison. + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define debug FALSE) + + +(define-with-return (script-fu-heal-selection-test) + (let* ((image 1) + (drawable (car (gimp-image-get-active-drawable image)))) + ;; (set! image (car (gimp-image-list))) + ;; (set! drawable (gimp-image-get-active-drawable image)) + ;; (gimp-image-delete (gimp-image-duplicate image)) + (script-fu-heal-selection + image + drawable + 50 + 0 + 0 + ))) + + +(define-with-return + (script-fu-heal-selection + timg tdrawable samplingRadiusParam directionParam orderParam) + "Create stencil selection in a temp image to pass as source (corpus) to plugin resynthesizer, + which does the substantive work." + + (let ((targetBounds nil) + (tempImage nil) + (work_drawable nil) + (orgSelection nil) + (grownSelection nil) + (frisketBounds nil) + (frisketLowerLeftX nil) + (frisketLowerLeftY nil) + (frisketUpperRightX nil) + (frisketUpperRightY nil) + (targetLowerLeftX nil) + (targetLowerLeftY nil) + (targetUpperRightX nil) + (targetUpperRightY nil) + (frisketWidth nil) + (frisketHeight nil) + (newWidth nil) + (newHeight nil) + (newLLX nil) + (newLLY nil) + (useBorder nil)) + + (set! samplingRadiusParam (floor samplingRadiusParam)) + + (when (= TRUE (car (gimp-selection-is-empty timg))) + (gimp-message (_ "You must first select a region to heal.")) + (return)) + + (gimp-image-undo-group-start timg) + + (set! targetBounds (gimp-drawable-mask-bounds tdrawable)) + + ;; In duplicate image, create the sample (corpus). + ;; (I tried to use a temporary layer but found it easier to use duplicate image.) + (set! tempImage (car (gimp-image-duplicate timg))) + (when (null? tempImage) + (throw "Failed duplicate image")) + + ;; !!! The drawable can be a mask (grayscale channel), don't restrict to layer. + (set! work_drawable (car (gimp-image-get-active-drawable tempImage))) + (when (null? work_drawable) + (throw "Failed get active drawable")) + + ;; + ;; grow and punch hole, making a frisket iow stencil iow donut + ;; + (set! orgSelection (car (gimp-selection-save tempImage))) ; save for later use + (gimp-selection-grow tempImage samplingRadiusParam) + + ;; ??? returns None , docs say it returns SUCCESS + + ;; !!! Note that if selection is a bordering ring already, growing expanded it inwards. + ;; Which is what we want, to make a corpus inwards. + (set! grownSelection (car (gimp-selection-save tempImage))) + + ;; Cut hole where the original selection was, so we don't sample from it. + ;; !!! Note that gimp enums/constants are not prefixed with GIMP_ + (gimp-image-select-item tempImage CHANNEL-OP-SUBTRACT orgSelection) + + ;; + ;; Selection (to be the corpus) is donut or frisket around the original target T + ;; xxx + ;; xTx + ;; xxx + ;; + + ;; crop the temp image to size of selection to save memory and for directional healing!! + (set! frisketBounds (gimp-drawable-mask-bounds grownSelection)) + (set! frisketLowerLeftX (nth 1 frisketBounds)) + (set! frisketLowerLeftY (nth 2 frisketBounds)) + (set! frisketUpperRightX (nth 3 frisketBounds)) + (set! frisketUpperRightY (nth 4 frisketBounds)) + (set! targetLowerLeftX (nth 1 targetBounds )) + (set! targetLowerLeftY (nth 2 targetBounds )) + (set! targetUpperRightX (nth 3 targetBounds )) + (set! targetUpperRightY (nth 4 targetBounds )) + + (set! frisketWidth (- frisketUpperRightX frisketLowerLeftX)) + (set! frisketHeight (- frisketUpperRightY frisketLowerLeftY)) + + ;; User's choice of direction affects the corpus shape, and is also passed to resynthesizer plugin + + (cond + ( (= directionParam 0) ; all around + ;; Crop to the entire frisket + (set! newWidth frisketWidth) + (set! newHeight frisketHeight) + (set! newLLX frisketLowerLeftX) + (set! newLLY frisketLowerLeftY) + ) + ( (= directionParam 1) ; sides + ;; Crop to target height and frisket width: XTX + (set! newWidth frisketWidth) + (set! newHeight (- targetUpperRightY targetLowerLeftY)) + (set! newLLX frisketLowerLeftX) + (set! newLLY targetLowerLeftY) + ) + ( (= directionParam 2) ; above and below + ;; X Crop to target width and frisket height + ;; T + ;; X + (set! newWidth (- targetUpperRightX targetLowerLeftX)) + (set! newHeight frisketHeight) + (set! newLLX targetLowerLeftX) + (set! newLLY frisketLowerLeftY) + )) + + ;; Restrict crop to image size (condition of gimp_image_crop) eg when off edge of image + (set! newWidth (min newWidth (- (car (gimp-image-width tempImage)) newLLX))) + (set! newHeight (min newHeight (- (car (gimp-image-height tempImage)) newLLY))) + (gimp-image-crop tempImage newWidth newHeight newLLX newLLY) + + ;; Encode two script params into one resynthesizer param. + ;; use border 1 means fill target in random order + ;; use border 0 is for texture mapping operations, not used by this script + (cond + ( (= orderParam 0) + (set! useBorder 1) ; User wants NO order, ie random filling + ) + ( (= orderParam 1) ; Inward to corpus. 2,3,4 + ;; !!! Offset by 2 to get past the original two boolean values + (set! useBorder (+ directionParam 2)) + ) + ( #t + ;; Outward from image center. + ;; 5+0=5 outward concentric + ;; 5+1=6 outward from sides + ;; 5+2=7 outward above and below + (set! useBorder (+ directionParam 5)))) + + ;; Note that the old resynthesizer required an inverted selection !! + + (when (= debug TRUE) + (catch "do nothing when error" + (gimp-display-new tempImage) + (gimp-displays-flush) + ;;; (sleep 2) ; tiny-scheme can't sleep + )) + + ;; Not necessary to restore image to initial condition of selection, activity, + ;; the original image should not have been changed, + ;; and the resynthesizer should only heal, not change selection. + + ;; Note that the API hasn't changed but use_border param now has more values. + (plug-in-resynthesizer + RUN-NONINTERACTIVE ; run-mode + timg ; image + tdrawable ; drawable + 0 0 ; vtile htile + useBorder ; use-context + work_drawable ; corpus + -1 ; inmask + -1 ; outmask + 0.0 ; map-weight + 0.117 ; autism + 16 ; neighbourhood + 500 ; trys + ) + + ;; Clean up + (when (= debug FALSE) + (gimp-image-delete tempImage)) + (gimp-image-undo-group-end timg) + )) + +(script-fu-register + ;; func name + "script-fu-heal-selection" + ;; menu label + "Heal selection(scm)..." + ;; description + (string-append + (N_ "Heal the selection from surroundings as if using the heal tool.") + "Requires separate resynthesizer plugin.") + ;; author + "Lloyd Konneker <>" + ;; copyright notice + "2009 Lloyd Konneker" + ;; date created + "2009" + ;; image type that the script works on + "RGB*, GRAY*" + + ;; parameters + SF-IMAGE "Image" 0 + + SF-DRAWABLE "Drawable" 0 + + SF-ADJUSTMENT (_ "Context sampling width (pixels):") + (list 50 ; value + 1 ; lower + 10000 ; upper + 1 ; step_inc + 10 ; page_inc + 0 ; digits + SF-SPINNER) ; type + + SF-OPTION (_ "Sample from:") (list + (_ "All around") + (_ "Sides") + (_ "Above and below")) + + SF-OPTION (_ "Filling order:") (list + (_ "Random") + (_ "Inwards towards center") + (_ "Outwards from center")) + ) + +(script-fu-menu-register "script-fu-heal-selection" + "/Filters/Enhance") + +(script-fu-menu-register "script-fu-heal-selection" + "/Filters/Resynthesizer(scm)/") + +;; (script-fu-heal-selection-test) diff --git a/PluginScripts/plugin-heal-transparency.scm b/PluginScripts/plugin-heal-transparency.scm index 31799fc..421cb1e 100644 --- a/PluginScripts/plugin-heal-transparency.scm +++ b/PluginScripts/plugin-heal-transparency.scm @@ -1,92 +1,111 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Heal transparency" - -Copyright 2010 lloyd konneker (bootch at nc.rr.com) - -Version: - 1.0 lloyd konneker lkk 2010 Initial version in python. - -License: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - The GNU Public License is available at - http://www.gnu.org/copyleft/gpl.html - -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -def heal_transparency(timg, tdrawable, samplingRadiusParam=50, orderParam=2): - - # precondition should be enforced by Gimp according to image modes allowed. - if not pdb.gimp_drawable_has_alpha(tdrawable): - pdb.gimp_message("The active layer has no alpha channel to heal.") - return - - pdb.gimp_image_undo_group_start(timg) - - # save selection for later restoration. - # Saving selection channel makes it active, so we must save and restore the active layer - org_selection = pdb.gimp_selection_save(timg) - pdb.gimp_image_set_active_layer(timg, tdrawable) - - # alpha to selection - pdb.gimp_image_select_item(timg, CHANNEL_OP_REPLACE, tdrawable) - # Want the transparent, not the opaque. - pdb.gimp_selection_invert(timg) - # Since transparency was probably anti-aliased (dithered with partial transpancy), - # grow the selection to get past the dithering. - pdb.gimp_selection_grow(timg, 1) - # Remove the alpha from this layer. IE compose with current background color (often white.) - # Resynthesizer won't heal transparent. - pdb.gimp_layer_flatten(tdrawable) - - # Call heal selection (not the resynthesizer), which will create a proper corpus. - # 0 = sample from all around - pdb.python_fu_heal_selection(timg, tdrawable, samplingRadiusParam, 0, orderParam, run_mode=RUN_NONINTERACTIVE) - - # Restore image to initial conditions of user, except for later cleanup. - - # restore selection - pdb.gimp_image_select_item(timg, CHANNEL_OP_REPLACE, org_selection) - - # Clean up (comment out to debug) - pdb.gimp_image_undo_group_end(timg) - - -register( - "python_fu_heal_transparency", - N_("Removes alpha channel by synthesis. Fill outward for edges, inward for holes."), - "Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "Copyright 2010 Lloyd Konneker", - "2010", - N_("Heal transparency..."), - "RGBA, GRAYA", # !!! Requires an alpha channel to heal - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_INT, "samplingRadiusParam", _("Context sampling width (pixels):"), 50), - (PF_OPTION, "orderParam", _("Filling order:"), 2, [_("Random"), - _("Inwards towards center"), _("Outwards from center") ]) - ], - [], - heal_transparency, - menu="/Filters/Enhance", - domain=("resynthesizer", gimp.locale_directory) - ) - -main() +;; Gimp plugin "Heal transparency" + +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; plugin-heal-transparency.scm Copyright 2022 itr-tert +;; Based on plugin-heal-transparency.py Copyright 2010 lloyd konneker (bootch at nc.rr.com) + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define-with-return + (script-fu-heal-transparency + timg tdrawable samplingRadiusParam orderParam) + (let ((org-selection nil)) + ;; precondition should be enforced by Gimp according to image modes allowed. + (when (= FALSE (car (gimp-drawable-has-alpha tdrawable))) + (gimp-message "The active layer has no alpha channel to heal.") + (return)) + + (gimp-image-undo-group-start timg) + + ;; save selection for later restoration. + ;; Saving selection channel makes it active, so we must save and restore the active layer + (set! org-selection (gimp-selection-save timg)) + (gimp-image-set-active-layer timg tdrawable) + + ;; alpha to selection + (gimp-image-select-item timg CHANNEL-OP-REPLACE tdrawable) + + ;; Want the transparent, not the opaque. + (gimp-selection-invert timg) + ;; Since transparency was probably anti-aliased (dithered with partial transpancy), + ;; grow the selection to get past the dithering. + (gimp-selection-grow timg 1) + ;; Remove the alpha from this layer. IE compose with current background color (often white.) + ;; Resynthesizer won't heal transparent. + (gimp-layer-flatten tdrawable) + + ;; Call heal selection (not the resynthesizer), which will create a proper corpus. + ;; 0 = sample from all around + (script-fu-heal-selection timg tdrawable samplingRadiusParam 0 orderParam) + + ;; Restore image to initial conditions of user, except for later cleanup. + + ;; restore selection + (gimp-image-select-item timg CHANNEL-OP-REPLACE org-selection) + + ;; Clean up (comment out to debug) + (gimp-image-undo-group-end timg) + )) + +(script-fu-register + ;; func name + "script-fu-heal-transparency" + ;; menu label + (N_ "Heal transparency(scm)...") + ;; description + (string-append + (N_ "Removes alpha channel by synthesis. Fill outward for edges, inward for holes.") + (N_ "Requires separate resynthesizer plugin.")) + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2010 Lloyd Konneker" + ;; date created + "2010" + ;; image type that the script works on + "RGBA, GRAYA" ; !!! Requires an alpha channel to heal + ;; parameters + SF-IMAGE "Image" 0 + + SF-DRAWABLE "Drawable" 0 + + SF-ADJUSTMENT (_ "Context sampling width (pixels):") + (list 50 ; value + 1 ; lower + 10000 ; upper + 1 ; step_inc + 10 ; page_inc + 0 ; digits + SF-SPINNER) ; type + + ;; 2 is the default in the original py. + SF-OPTION (_ "Filling order:") (list + (_ "Random") + (_ "Inwards towards center") + (_ "Outwards from center")) + ) + +(script-fu-menu-register "script-fu-heal-transparency" + "/Filters/Enhance") + +(script-fu-menu-register "script-fu-heal-transparency" + "/Filters/Resynthesizer(scm)/") diff --git a/PluginScripts/plugin-map-style.scm b/PluginScripts/plugin-map-style.scm index 86ce341..5328cab 100644 --- a/PluginScripts/plugin-map-style.scm +++ b/PluginScripts/plugin-map-style.scm @@ -1,397 +1,414 @@ -#!/usr/bin/env python - -''' -Gimp plugin. -Transfer style (color and surface texture) from a source image to the active, target image. - -Requires resynthesizer plug-in. - -Author: -lloyd konneker, lkk - -Version: -1.0 lkk 7/15/2010 Initial version. Released to Gimp Registry. -1.1 lkk 8/1/2010 Unreleased -1.2 lkk 8/10/2010 - -Change log: -_________________ -1.1 - Bug: Fixed test of mode variable, since it is a string, needs explicit test for == 1 - Bug: Added remove Selection Mask copy channel in make_grayscale_map -1.2 - Changes for new resynthesizer: no need to synchronize, remove alphas - Fixed improper adjustment of contrast of source: only adjust source map. - -TODO -a quality setting that changes the parameters to resynth - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html - - -Users Guide -___________ - -What this plugin does: - -Transfers artistic style from one image to another. Often the source is an artistic image and the target is a realistic, photo image. But you can also transfer between artistic images or between realistic images. - -An artist might say this plugin "renders in the media and style from another image." A computer user might say it "renders in the theme of another image." - -Transferring style means transferring small scale features (color and texture) to an image while retaining large scale features (objects.) - -Map can mean "transfer and transform". This plugin gives limited control of the transform. That is, colors are usually mapped to similar colors (hues.) This plugin is not intended to do "false color" (but it might have that effect.) - -Style can mean "color and surface." Texture mapping usually means just surface (pattern of brightness, e.g. a weave or grain.) This plugin can transfer both color and surface. - -This plugin has more effect than just an overlay or screen or a map. A screen usually applies a texture uniformly across an image. This plugin transfers style in patches. The style in a region can come from any patch of the source, or be synthesized (mixed) from many patches of the source. - -The transfer is not exactly a copy, again because of optional synthesis or mixing. - -About the selection: - -Usually you transfer between separate images, the target and source images. You can make a selection in either image, or both. If there is no selection, the plugin uses the entire layer. - -The target is the active LAYER and you can choose the source LAYER. Note that the plugin doesn't use everything visible in an image, just one layer. - -SPECIAL CASE: If the target and source layers are in the same image, the source style comes from the inverse of the selection in the source layer. Similarly, if the target and source layers are the same layer, the target is the selection and the style comes from the inverse of the selection, i.e. outside the selection. In this case, the effect is little if there is no difference in texture between the inside and outside of the selection, or a distort, if there is a difference. - -About the settings: - -"Percent transfer:" how much style to transfer. Less transfer means the effect retains the large scale objects of the original, but gives the image a grainy surface. More transfer means the effect leaves only a ghost of the large scale objects, and almost fully copies the style image (with less synthesis or mixing.) - -"Map by:" whether color affects the style transfer, when both target and source are in color. If you choose "color and brightness", style colors are more apt to be transferred to areas with same colors. However, it is still possible that colors are radically transformed, if the surface (brightness pattern) is a better match. If you choose "brightness only", style colors are more apt to be radically transformed. - -This setting has less effect if there are no color matches between source and target (e.g. one is all red and the other is all green) or if the target image is GRAY. This setting has NO effect if the source image or both images are GRAY. - -About image modes: - -You can transfer style between any combination of RGB and GRAY images. The plugin changes the mode of the target to the mode of the source as necessary. - -Why this plugin: - -This plugin is a front-end to the separate resynthesizer plugin. This plugin simplifies using the resynthesizer plugin. It automates many steps. It hides several complexities of the resynthesizer plugin: selection, modes, alpha channels, and settings. - - - -Programming notes: -_________________ - -IN: The active image and layer. - The selection in the active image. - The selection in any layers chosen for source. -OUT: The active image, altered. The source is unaltered. - Target mode can be altered, but with the implied consent of the user. - -The print stmts go to the console, info to advanced users and debuggers. - -This plugin is mostly about UI and simplifications for user (the engine does the image processing): -making maps automatically -synchronization of alphas (note the new resynthesizer ignores alphas.) -synchronization of modes -abstracting the settings -contrast adjustment - -''' - -from gimpfu import * -from math import acos - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -# True if you want to display and retain working, temporary images -debug = False - -def display_debug_image(image) : - if debug : - try: - pdb.gimp_display_new(image) - pdb.gimp_displays_flush() - except RuntimeError: - pass # if run-mode not interactive, Gimp throws - - -def make_grayscale_map(image, drawable): - ''' - Make a grayscale copy for a map. - - Maps must be same size as their parent image. - - If image is already grayscale, return it without copying. - - Maps don't need a selection, since the resynthesizer looks at parent drawables for the selection. - ''' - if pdb.gimp_image_base_type(image) == GRAY : - return image, drawable - - # Save selection, copy entire image, and restore - original_selection = pdb.gimp_selection_save(image) - pdb.gimp_selection_all(image) # copy requires selection - pdb.gimp_edit_copy(drawable) - if original_selection: - pdb.gimp_image_select_item(image, CHANNEL_OP_REPLACE, original_selection) # restore selection in image - pdb.gimp_image_remove_channel(image, original_selection) # cleanup the copied selection mask - # !!! Note remove_channel not drawable_delete - - # Make a copy, greyscale - temp_image = pdb.gimp_edit_paste_as_new() - pdb.gimp_image_convert_grayscale(temp_image) - display_debug_image(temp_image) - temp_drawable = pdb.gimp_image_get_active_drawable(temp_image) - return temp_image, temp_drawable - - -def synchronize_modes(target_image, source_image) : - ''' - User-friendliness: - If mode of target is not equal to mode of source source, change modes. - Resynthesizer requires target and source to be same mode. - Assert target is RGB or GRAY (since is precondition of plugin.) - UI decision: make this quiet, presume user intends mode change. - But don't permanently change mode of source. - Always upgrade GRAY to RGB, not downgrade RGB to GRAY. - ''' - target_mode = pdb.gimp_image_base_type(target_image) - source_mode = pdb.gimp_image_base_type(source_image) - if target_mode != source_mode : - # print("Map style: converted mode\n.") - if target_mode == GRAY: - pdb.gimp_image_convert_rgb(target_image) - else : # target is RGB and source is GRAY - # Assert only convert a copy of source, - # user NEVER intends original source be altered. - pdb.gimp_image_convert_rgb(source_image) - -''' -Not used -''' -""" -def synchronize_alphas(target_drawable, source_drawable) : - ''' - User-friendliness: - If source has alpha and target doesn't, remove or add alpha to source. - Do this without user dialog since it is done on copies, and really, the alpha doesn't matter. - ''' - if pdb.gimp_drawable_has_alpha(source_drawable) : - if not pdb.gimp_drawable_has_alpha(target_drawable) : - # Should never get here, since removed alpha from source_drawable copy earlier - print "Adding alpha channel to target image since style source image has alpha." - pdb.gimp_layer_add_alpha (target_drawable) - else: # source has no alpha - if pdb.gimp_drawable_has_alpha(target_drawable) : - print "Map style: Adding alpha channel to style source image copy since target image has alpha." - pdb.gimp_layer_add_alpha (source_drawable) -""" - - -def copy_selection_to_image(drawable) : - ''' - If image has a selection, copy selection to new image, and prepare it for resynthesizer, - else return a copy of the entire source image. - This is called for the source image, where it helps performance to reduce size and flatten. - ''' - image = pdb.gimp_drawable_get_image(drawable) - - # copy selection or whole image - pdb.gimp_edit_copy(drawable) - image_copy = pdb.gimp_edit_paste_as_new() - # Activate layer, and remove alpha channel - pdb.gimp_image_flatten(image_copy) - layer_copy = pdb.gimp_image_get_active_layer(image_copy) - # In earlier version, futzed with selection to deal with transparencey - display_debug_image(image_copy) - return image_copy, layer_copy - - -def synchronize_contrast( drawable, source_drawable, percent_transfer) : - ''' - Adjust contrast of source, to match target. - Adjustment depends inversely on percent_transfer. - Very crude histogram matching. - ''' - # histogram upper half: typical mean is 191 (3/4*255). Skew of mean towards 255 means high contrast. - mean, deviation, median, pixels, count, percentile = pdb.gimp_histogram(drawable, HISTOGRAM_VALUE, 128, 255) - source_mean, source_deviation, source_median, pixels, count, percentile = pdb.gimp_histogram( - source_drawable, HISTOGRAM_VALUE, 128, 255) - # if mean > source_mean: # target has more contrast than source - # Adjust contrast of source. - # Inversely proportional to percent transfer. - # 2.5 is from experimentation with gimp_brightness_contrast which seems linear in its effect. - contrast_control = (mean - source_mean) * 2.5 * (1 - (percent_transfer / 100)) - # clamp to valid range (above formula is lazy, ad hoc) - if contrast_control < -127: contrast_control = -127 - if contrast_control > 127: contrast_control = 127 - pdb.gimp_brightness_contrast(source_drawable, 0, contrast_control) - # For experimentation, print new values - source_mean, source_deviation, source_median, pixels, count, percentile = pdb.gimp_histogram( - source_drawable, HISTOGRAM_VALUE, 128, 255) - # print "Map style: Source contrast changed by ", contrast_control - # print "Map style: Target and source upper half histogram means", mean, source_mean - - -def calculate_map_weight(percent_transfer) : - ''' - This is a GUI design discussion. - Transform percent_transfer to map_weight parameter to resynthesizer. - For resynthesizer: - map weight 0 means copy source to target, meaning ALL style. - map weight 0.5 means just a grainy transfer of style (as little as is possible.) - Transform from a linear percent GUI, because user more comfortable than with a ratio [.5, 0] - which is backwards to the usual *less on the left*. - By experiment, a sinusoid gives good results for linearizing the non-linear map_weight control. - ''' - return acos((percent_transfer/100)*2 -1)/(2*3.14) - - -def transfer_style(image, drawable, source_drawable, percent_transfer, map_mode ): - ''' - Main body of plugin to transfer style from one image to another. - - !!! Note map_mode is type string, "if map_mode:" will not work. - ''' - - pdb.gimp_image_undo_group_start(image) - - # Get image of source drawable - source_image = pdb.gimp_drawable_get_image(source_drawable) - - ''' - User-friendliness. - Note the drawable chooser widget in Pygimp does not allow us to prefilter INDEXED mode. - So check here and give a warning. - ''' - # These are the originals base types, and this plugin might change the base types - original_source_base_type = pdb.gimp_image_base_type(source_image) - original_target_base_type = pdb.gimp_image_base_type(image) - - if original_source_base_type == INDEXED : - pdb.gimp_message(_("The style source cannot be of mode INDEXED")); - return - - if image == source_image and drawable == source_drawable: - is_source_copy = False - ''' - If source is same as target, - then the old resynthesizer required a selection (engine used inverse selection for corpus). - New resynthesizer doesn't need a selection. - If source same as target, effect is similar to a blur. - ''' - # assert modes and alphas are same (since they are same layer!) - else: # target layer is not the source layer (source could be a copy of target, but effect is none) - # Copy source always, for performance, and for possible mode change. - is_source_copy = True - source_image, source_drawable = copy_selection_to_image(source_drawable) - - # Futz with modes if necessary. - synchronize_modes(image, source_image) - - ''' - Old resythesizer required both images to have alpha, or neither. - synchronize_alphas( drawable, source_drawable) - ''' - - ''' - TODO For performance, if there is a selection in target, it would be better to copy - selection to a new layer, and later merge it back (since resynthesizer engine reads - entire target into memory. Low priority since rarely does user make a selection in target. - ''' - - ''' - !!! Note this plugin always sends maps to the resynthesizer, - and the "percent transfer" setting is always effective. - However, maps may not be separate,copied images unless converted to grayscale. - ''' - - # Copy and reduce maps to grayscale: at the option of the user - # !!! Or if the target was GRAY and source is RGB, in which case maps give a better result. - # Note that if the target was GRAY, we already upgraded it to RGB. - if map_mode == 1 or (original_source_base_type == RGB and original_target_base_type == GRAY) : - # print "Map style: source mode: ", original_source_base_type, " target mode: ", original_target_base_type - # print "Map style: Converting maps to grayscale" - # Convert mode, but in new temp image and drawable - target_map_image, target_map_drawable = make_grayscale_map(image, drawable) - source_map_image, source_map_drawable = make_grayscale_map(source_image, source_drawable) - - target_map = target_map_drawable - source_map = source_map_drawable - # later, delete temp images - - # User control: adjust contrast of source_map as a function of percent transfer - # Hard to explain why, but experimentation shows result more like user expectation. - # TODO This could be improved. - # !!! Don't change the original source, only a temporary map we created - synchronize_contrast( drawable, source_map, percent_transfer) - else : - # !!! Maps ARE the target and source, not copies - source_map = source_drawable - target_map = drawable - - - ''' - Parameters to resynthesizer: - - htile and vtile = 1 since it reduces artifacts around edge - - map_weight I linearize since easier on users than an exponential - - use_border = 1 since there might be a selection and context (outside target). - - 9 neighbors (a 3x3 patch) and 200 tries for speed - - ''' - - map_weight = calculate_map_weight(percent_transfer) - - # !!! This is for version of resynthesizer, with an uninverted selection - pdb.plug_in_resynthesizer(image, drawable, 1, 1, 1, source_drawable.ID, source_map.ID, target_map.ID, map_weight, 0.117, 9, 200) - - # Clean up. - # Delete working images: separate map images and copy of source image - if not debug: - if map_mode == 1: # if made working map images - pdb.gimp_image_delete(target_map_image) - pdb.gimp_image_delete(source_map_image) - if is_source_copy: # if created a copy earlier - pdb.gimp_image_delete(source_image) - - pdb.gimp_image_undo_group_end(image) - pdb.gimp_displays_flush() - - -register( - "python_fu_map_style", - N_("Transfer style (color and surface) from a chosen source to the active layer. "), - "Transforms image using art media and style from another image. Maps or synthesizes texture or theme from one image onto another. Requires separate resynthesizer plugin.", - "Lloyd Konneker (bootch nc.rr.com)", - "Copyright 2010 Lloyd Konneker", - "2010", - N_("Style..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_DRAWABLE, "source_drawable", _("Source of style:"), None), - (PF_SLIDER, "percent_transfer", _("Percent transfer:"), 0, (10, 90, 10.0)), - (PF_RADIO, "map_mode", _("Map by:"), 0, ((_("Color and brightness"), 0),(_("Brightness only"),1))) - ], - [], - transfer_style, - menu="/Filters/Map", - domain=("resynthesizer", gimp.locale_directory) - ) - -main() - +;; Gimp plugin. +;; Transfer style (color and surface texture) from a source image to the active, target image. +;; Requires resynthesizer plug-in. + +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + + +;; Author: +;; lloyd konneker, lkk, itr-tert +;; +;; Version: +;; 1.0 lkk 2010-07-15 Initial version. Released to Gimp Registry. +;; 1.1 lkk 2010-08-01 Unreleased +;; 1.2 lkk 2010-08-10 +;; later versions, see git log + +;; Change log: +;; _________________ +;; 1.1 +;; Bug: Fixed test of mode variable, since it is a string, needs explicit test for == 1 +;; Bug: Added remove Selection Mask copy channel in make_grayscale_map +;; 1.2 +;; Changes for new resynthesizer: no need to synchronize, remove alphas +;; Fixed improper adjustment of contrast of source: only adjust source map. +;; later versions, see git log + +;; TODO +;; a quality setting that changes the parameters to resynth + + +;; Users Guide +;; ___________ +;; +;; What this plugin does: +;; +;; Transfers artistic style from one image to another. Often the source is an artistic image and the target is a realistic, photo image. But you can also transfer between artistic images or between realistic images. +;; +;; An artist might say this plugin "renders in the media and style from another image." A computer user might say it "renders in the theme of another image." +;; +;; Transferring style means transferring small scale features (color and texture) to an image while retaining large scale features (objects.) +;; +;; Map can mean "transfer and transform". This plugin gives limited control of the transform. That is, colors are usually mapped to similar colors (hues.) This plugin is not intended to do "false color" (but it might have that effect.) +;; +;; Style can mean "color and surface." Texture mapping usually means just surface (pattern of brightness, e.g. a weave or grain.) This plugin can transfer both color and surface. +;; +;; This plugin has more effect than just an overlay or screen or a map. A screen usually applies a texture uniformly across an image. This plugin transfers style in patches. The style in a region can come from any patch of the source, or be synthesized (mixed) from many patches of the source. +;; +;; The transfer is not exactly a copy, again because of optional synthesis or mixing. +;; +;; About the selection: +;; +;; Usually you transfer between separate images, the target and source images. You can make a selection in either image, or both. If there is no selection, the plugin uses the entire layer. +;; +;; The target is the active LAYER and you can choose the source LAYER. Note that the plugin doesn't use everything visible in an image, just one layer. +;; +;; SPECIAL CASE: If the target and source layers are in the same image, the source style comes from the inverse of the selection in the source layer. Similarly, if the target and source layers are the same layer, the target is the selection and the style comes from the inverse of the selection, i.e. outside the selection. In this case, the effect is little if there is no difference in texture between the inside and outside of the selection, or a distort, if there is a difference. +;; +;; About the settings: +;; +;; "Percent transfer:" how much style to transfer. Less transfer means the effect retains the large scale objects of the original, but gives the image a grainy surface. More transfer means the effect leaves only a ghost of the large scale objects, and almost fully copies the style image (with less synthesis or mixing.) +;; +;; "Map by:" whether color affects the style transfer, when both target and source are in color. If you choose "color and brightness", style colors are more apt to be transferred to areas with same colors. However, it is still possible that colors are radically transformed, if the surface (brightness pattern) is a better match. If you choose "brightness only", style colors are more apt to be radically transformed. +;; +;; This setting has less effect if there are no color matches between source and target (e.g. one is all red and the other is all green) or if the target image is GRAY. This setting has NO effect if the source image or both images are GRAY. +;; +;; About image modes: +;; +;; You can transfer style between any combination of RGB and GRAY images. The plugin changes the mode of the target to the mode of the source as necessary. +;; +;; Why this plugin: +;; +;; This plugin is a front-end to the separate resynthesizer plugin. This plugin simplifies using the resynthesizer plugin. It automates many steps. It hides several complexities of the resynthesizer plugin: selection, modes, alpha channels, and settings. + + +;; Programming notes: +;; _________________ +;; +;; IN: The active image and layer. +;; The selection in the active image. +;; The selection in any layers chosen for source. +;; OUT: The active image, altered. The source is unaltered. +;; Target mode can be altered, but with the implied consent of the user. +;; +;; The print stmts go to the console, info to advanced users and debuggers. +;; +;; This plugin is mostly about UI and simplifications for user (the engine does the image processing): +;; making maps automatically +;; synchronization of alphas (note the new resynthesizer ignores alphas.) +;; synchronization of modes +;; abstracting the settings +;; contrast adjustment + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define debug #f) ; #t if you want to display and retain working, temporary images + + +(define (display-debug-image image) + (when debug + (catch "do nothing when error" + ;; if run-mode not interactive, Gimp throws + (gimp-display-new image) + (gimp-displays-flush)))) + + +(define-with-return (make-grayscale-map image drawable) + ;; Make a grayscale copy for a map. + ;; Maps must be same size as their parent image. + ;; If image is already grayscale, return it without copying. + ;; Maps don't need a selection, since the resynthesizer looks at parent drawables for the selection. + + (when (= GRAY (car (gimp-image-base-type image))) + (return (list image drawable))) + + ;; Save selection, copy entire image, and restore + (let ((original-selection (car (gimp-selection-save image))) + (temp-image nil) + (temp-drawable nil) + ) + (gimp-selection-all image) ; copy requires selection + (gimp-edit-copy drawable) + + ;; restore selection in image + (gimp-image-select-item image CHANNEL-OP-REPLACE original-selection) + ;; cleanup the copied selection mask + (gimp-image-remove-channel image original-selection) + ;; !!! Note remove-channel not drawable-delete + + ;; Make a copy, greyscale + (set! temp-image (car (gimp-edit-paste-as-new))) + (gimp-image-convert-grayscale temp-image) + (display-debug-image temp-image) + (set! temp-drawable (car (gimp-image-get-active-drawable temp-image))) + (return (list temp-image temp-drawable)))) + + +(define (synchronize-modes target-image source-image) + ;; User-friendliness: + ;; If mode of target is not equal to mode of source source, change modes. + ;; Resynthesizer requires target and source to be same mode. + ;; Assert target is RGB or GRAY (since is precondition of plugin.) + ;; UI decision: make this quiet, presume user intends mode change. + ;; But don't permanently change mode of source. + ;; Always upgrade GRAY to RGB, not downgrade RGB to GRAY. + (let ((target-mode (car (gimp-image-base-type target-image))) + (source-mode (car (gimp-image-base-type source-image)))) + (when (<> target-mode source-mode) + (when debug + (display "Map style: converted mode\n.")) + (if (= target-mode GRAY) + (begin (gimp-image-convert-rgb target-image)) + (begin + ;; target is RGB and source is GRAY + ;; Assert only convert a copy of source, + ;; user NEVER intends original source be altered. + (gimp-image-convert-rgb source-image)))))) + + +(define (copy-selection-to-image drawable) + ;; If image has a selection, copy selection to new image, and prepare it for resynthesizer, + ;; else return a copy of the entire source image. + ;; This is called for the source image, where it helps performance to reduce size and flatten. + (let ((image (car (gimp-drawable-get-image drawable))) + (image-copy nil) + (layer-copy nil)) + ;; copy selection or whole image + (gimp-edit-copy drawable) + (set! image-copy (car (gimp-edit-paste-as-new))) + ;; Activate layer, and remove alpha channel + (gimp-image-flatten image-copy) + (set! layer-copy (car (gimp-image-get-active-layer image-copy))) + ;; In earlier version, futzed with selection to deal with transparencey + (display-debug-image image-copy) + (list image-copy layer-copy))) + + +(define (synchronize-contrast ref-drawable source-drawable percent-transfer) + ;; Adjust contrast of source, to match target. + ;; Adjustment depends inversely on percent-transfer. + ;; Very crude histogram matching. + + ;; histogram upper half: typical mean is 191 (3/4*255). Skew of mean towards 255 means high contrast. + (let* ((ref-mean (car (gimp-histogram ref-drawable HISTOGRAM-VALUE 128 255))) + (source-mean (car (gimp-histogram source-drawable HISTOGRAM-VALUE 128 255))) + ;; Adjust contrast of source. + ;; Inversely proportional to percent transfer. + ;; 2.5 is from experimentation with gimp-brightness-contrast which seems linear in its effect. + (contrast-control (* (- ref-mean source-mean) 2.5 (- 1 (/ percent-transfer 100))))) + (when (and debug (> ref-mean source-mean)) + (display "synchronize-contrast: target has more contrast than source\n")) + ;; clamp to valid range (above formula is lazy, ad hoc) + (cond ((> -127 contrast-control) (set! contrast-control -127)) + ((< 127 contrast-control) (set! contrast-control 127))) + + (gimp-brightness-contrast source-drawable 0 contrast-control) + + (when debug + ;; For experimentation, print new values + (set! source-mean (car (gimp-histogram source-drawable HISTOGRAM-VALUE 128 255))) + (display (list "Map style: Source contrast changed by " contrast-control)) + (display (list "Map style: Target and source upper half histogram means" ref-mean source-mean)) + ))) + + +(define (calculate-map-weight percent-transfer) + ;; This is a GUI design discussion. + ;; Transform percent-transfer to map-weight parameter to resynthesizer. + ;; For resynthesizer: + ;; map weight 0 means copy source to target, meaning ALL style. + ;; map weight 0.5 means just a grainy transfer of style (as little as is possible.) + ;; Transform from a linear percent GUI, because user more comfortable than with a ratio [.5, 0] + ;; which is backwards to the usual *less on the left*. + ;; By experiment, a sinusoid gives good results for linearizing the non-linear map-weight control. + (/ (acos (+ -1 (* (/ percent-transfer 100) 2))) + (* 2 3.1415926535))) + + +(define-with-return (script-fu-map-style + image drawable source-drawable percent-transfer map-mode) + ;; Main body of plugin to transfer style from one image to another. + ;; + ;; !!! Note map-mode is type string, "if map-mode:" will not work. + + (gimp-image-undo-group-start image) + (gimp-message-set-handler MESSAGE-BOX) + + ;; Get image of source drawable + (let* ((source-image (car (gimp-drawable-get-image source-drawable))) + ;; + ;; User-friendliness. + ;; Note the drawable chooser widget in Pygimp does not allow us to prefilter INDEXED mode. + ;; So check here and give a warning. + ;; + ;; These are the originals base types, and this plugin might change the base types + (original-source-base-type (car (gimp-image-base-type source-image))) + (original-target-base-type (car (gimp-image-base-type image))) + (is-source-copy nil) + (temp-result nil) + (target-map nil) + (target-map-image nil) + (target-map-drawable nil) + (source-map nil) + (source-map-image nil) + (source-map-drawable nil) + (map-weight nil) + ) + (when (= INDEXED original-source-base-type) + (gimp-message (_ "The style source cannot be of mode INDEXED")) + (return)) + + (if (and (= image source-image) + (= drawable source-drawable)) + (set! is-source-copy #f) + ;; + ;; If source is same as target, + ;; then the old resynthesizer required a selection (engine used inverse selection for corpus). + ;; New resynthesizer doesn't need a selection. + ;; If source same as target, effect is similar to a blur. + ;; + ;; assert modes and alphas are same (since they are same layer!) + (begin ; target layer is not the source layer (source could be a copy of target, but effect is none) + ;; Copy source always, for performance, and for possible mode change. + (set! is-source-copy #t) + (set! temp-result (copy-selection-to-image source-drawable)) + (set! source-image (nth 0 temp-result)) + (set! source-drawable (nth 1 temp-result)) + ;; Futz with modes if necessary. + (synchronize-modes image source-image) + )) + + ;; + ;; TODO For performance, if there is a selection in target, it would be better to copy + ;; selection to a new layer, and later merge it back (since resynthesizer engine reads + ;; entire target into memory. Low priority since rarely does user make a selection in target. + ;; + + ;; + ;; !!! Note this plugin always sends maps to the resynthesizer, + ;; and the "percent transfer" setting is always effective. + ;; However, maps may not be separate,copied images unless converted to grayscale. + ;; + + ;; Copy and reduce maps to grayscale: at the option of the user + ;; !!! Or if the target was GRAY and source is RGB, in which case maps give a better result. + ;; Note that if the target was GRAY, we already upgraded it to RGB. + (if (or (= map-mode 1) + (and (= original-source-base-type RGB) + (= original-target-base-type GRAY))) + (begin + ;; print "Map style: source mode: ", original-source-base-type, " target mode: ", original-target-base-type + ;; print "Map style: Converting maps to grayscale" + ;; Convert mode, but in new temp image and drawable + (set! temp-result (make-grayscale-map image drawable)) + (set! target-map-image (nth 0 temp-result)) + (set! target-map-drawable (nth 1 temp-result)) + (set! temp-result (make-grayscale-map source-image source-drawable)) + (set! source-map-image (nth 0 temp-result)) + (set! source-map-drawable (nth 1 temp-result)) + + (set! target-map target-map-drawable) + (set! source-map source-map-drawable) + ;; later, delete temp images + + ;; User control: adjust contrast of source-map as a function of percent transfer + ;; Hard to explain why, but experimentation shows result more like user expectation. + ;; TODO This could be improved. + ;; !!! Don't change the original source, only a temporary map we created + (synchronize-contrast drawable source-map percent-transfer) + ) + (begin + ;; !!! Maps ARE the target and source, not copies + (set! source-map source-drawable) + (set! target-map drawable))) + + (set! map-weight (calculate-map-weight percent-transfer)) + + ;; !!! This is for version of resynthesizer, with an uninverted selection + (plug-in-resynthesizer + RUN-NONINTERACTIVE ; run-mode + image ; image + drawable ; drawable + 1 1 ; vtile htile 1 since it reduces artifacts around edge + ;; use-context ; 1 since there might be a selection and context (outside target). + 1 + source-drawable ; corpus + source-map ; inmask + target-map ; outmask + map-weight ; map-weight I linearize since easier on users than an exponential + 0.117 ; autism + 9 ; neighbourhood ; 9 (a 3x3 patch) and + 200) ; trys ; 200 for speed + + ;; Clean up. + ;; Delete working images: separate map images and copy of source image + (unless debug + (when (= map-mode 1) ; if made working map images + (gimp-image-delete target-map-image) + (gimp-image-delete source-map-image) + ) + (when is-source-copy ; if created a copy earlier + (gimp-image-delete source-image))) + (gimp-image-undo-group-end image) + (gimp-displays-flush))) + + +(define (test) + (define (get-image) + (vector-ref (car (cdr (gimp-image-list))) 0)) + (define (get-second-image) + (vector-ref (car (cdr (gimp-image-list))) 1)) + (define (get-drawable image) + (when (null? image) + (set! image (get-image))) + (car (gimp-image-get-active-drawable image))) + (script-fu-map-style (get-image) + (get-drawable nil) + (get-drawable (get-second-image)) + 10 + 1)) + +(script-fu-register + ;; func name + "script-fu-map-style" + ;; menu label + (N_ "Style(scm)...") + ;; description + (string-append + (N_ "Transfer style (color and surface) from a chosen source to the active layer. ") + (N_ "Transforms image using art media and style from another image. Maps or synthesizes texture or theme from one image onto another. Requires separate resynthesizer plugin.")) + ;; author + "Lloyd Konneker (bootch nc.rr.com)" + ;; copyright notice + "Copyright 2010 Lloyd Konneker" + ;; date created + "2010" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-DRAWABLE (_ "Source of style:") -1 + SF-ADJUSTMENT (_ "Percent transfer:") (list 0 ; value + 10 ; lower + 90 ; upper + 10 ; step_inc + 20 ; page_inc + 3 ; digits + SF-SLIDER) + SF-OPTION (_ "Map by:") (list (_ "Color and brightness") + (_ "Brightness only"))) + +(script-fu-menu-register "script-fu-map-style" + "/Filters/Map") + +(script-fu-menu-register "script-fu-map-style" + "/Filters/Resynthesizer(scm)/") diff --git a/PluginScripts/plugin-render-texture.scm b/PluginScripts/plugin-render-texture.scm index cd7ed08..d855b8c 100644 --- a/PluginScripts/plugin-render-texture.scm +++ b/PluginScripts/plugin-render-texture.scm @@ -1,209 +1,272 @@ -#!/usr/bin/env python - -''' -Gimp plugin. - -Create new image having texture synthesized from the selection. -Works best if selection is natural (fractal). -Can work with man-made regular texture. -Works worst with man-made, structured but not regular, symbols. -Sometimes called rendering a texture. - -Requires resynthesizer plug-in. - -Author: -lloyd konneker, lkk, bootch at nc.rr.com - -Version: -1.0 lkk 7/15/2010 Initial version -1.1 lkk 4/10/2011 Fixed a bug with layer types impacting greyscale images. - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html - - -The effect for users: -Similar to "Fill resynthesized pattern" except: - - here the arguments are reversed: you select a texture and create a new image - instead of selecting an area and choosing a pattern. - - here the result is less random (since Fill resynthesized adds noise.) -Different from tiling since: - - seamless and irregular pattern - -The continuum of randomness versus speed: - - Filters.Map.Tile is fast but has seams and regular pattern (even if you use "Make Seamless" first.) - - Filter.Render.Texture a tile followed by tiling is seamless but still has regularity. - - Filte.Render.Texture an entire image is slower but seamless and moderately irregular. - - Edit.Fill with resynthesized pattern is slowest but seamless and highly irregular, unpatterned. - -This filter is not tiling (instead resynthesizing) but makes -an image that you can then use to tile with especially if -you choose the option to make the edges suitable for tiling. - -IN: The selection (or the entire active drawable) is the source of texture and is not changed. -OUT New image, possibly resized canvas, same scale and resolution. - -TODO a quality setting -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -debug = False - - -def new_resized_image(image, resize_ratio): - # Create new image resized by a ratio from *selection* in the old image - - (is_selection, ulx, uly, lrx, lry) = pdb.gimp_selection_bounds(image) - if not is_selection : - # Resynthesizer will use the entire source image as corpus. - # Resize new image in proportion to entire source image. - new_width = int(pdb.gimp_image_width(image) * resize_ratio) - new_height = int(pdb.gimp_image_height(image) * resize_ratio) - new_type = pdb.gimp_image_base_type(image) # same as source - else : - # Resize new image in proportion to selection in source - new_width = int((lrx - ulx) * resize_ratio) - new_height = int((lry - uly) * resize_ratio) - - new_basetype = pdb.gimp_image_base_type(image) # same as source - new_layertype = pdb.gimp_drawable_type(pdb.gimp_image_get_active_layer(image)) - new_image = pdb.gimp_image_new(new_width, new_height, new_basetype) - # !!! Note that gimp_layer_new wants a layer type, not an image basetype - new_drawable = pdb.gimp_layer_new(new_image, new_width, new_height, - new_layertype, "Texture", 100, NORMAL_MODE) - # The new layer is opaque, but the new image has transparent pixels (for case RGBA) - # Resynthesizer will not change the transparency, so make pixels opaque. - # Fill with white will make them opaque. - new_drawable.fill(WHITE_FILL) - # A new layer must be added to the image. - pdb.gimp_image_add_layer(new_image, new_drawable, 0) - return new_image, new_drawable - - -def display_image(image): - try: - gimp.Display(image) - except gimp.error: - pass # If runmode is NONINTERACTIVE, expect gimp_display_new() to fail - gimp.displays_flush() - - -def render_texture(image, drawable, resize_ratio=2, make_tile=0): - ''' - Create a randomized texture image from the selection. - The image can be suited for further, seamless tiling. - The image is same scale and resolution but resized from the selection. - Not undoable, no changes to the source (you can just delete the new image.) - - A selection in the source image is optional. - If there is no selection, the resynthesizer will use the entire source image. - ''' - - # Its all or nothing, user must delete new image if not happy. - pdb.gimp_image_undo_disable(image) - - ''' - Create new image, optionally resized, and display for it. - ''' - new_image, new_drawable = new_resized_image(image, resize_ratio) - pdb.gimp_image_undo_disable(new_image) - if not new_drawable: - raise RuntimeError, "Failed create layer." - - # If using new resynthesizer with animation for debugging - if debug: - display_image(new_image) - - ''' - copy original into temp and crop it to the selection to save memory in resynthesizer - ''' - temp_image = pdb.gimp_image_duplicate(image) - if not temp_image: - raise RuntimeError, "Failed duplicate image" - - # Get bounds, offset of selection - (is_selection, ulx, uly, lrx, lry) = pdb.gimp_selection_bounds(image) - if not is_selection : - # No need to crop. Resynthesizer will use all if no selection. - pass - else : - pdb.gimp_image_crop(temp_image, lrx - ulx, lry - uly, ulx, uly) - - # Don't flatten because it turns transparency to background (white usually) - work_layer = pdb.gimp_image_get_active_layer(temp_image) - if not work_layer: - raise RuntimeError, "Failed get active layer" - - # Insure the selection is all (not necessary, resynthesizer will use all if no selection.) - pdb.gimp_selection_all(temp_image) - - # Settings for making edges suitable for seamless tiling afterwards. - # That is what these settings mean in the resynthesizer: - # wrap context probes in the target so that edges of target will be suitable for seamless tiling. - # I.E. treat the target as a sphere when matching. - if make_tile : - htile = 1 - vtile = 1 - else : - htile = 0 - vtile = 0 - - # Call resynthesizer - # use_border is moot since there is no context (outside the target) in the newImage. - # The target is the entire new image, the source is the cropped copy of the selection. - # - # 9 neighbors (a 3x3 patch) and 200 tries for speed, since new image is probably large - # and source is probably natural (fractal), where quality is not important. - - # For version of resynthesizer with uninverted selection - # !!! Pass -1 for ID of no layer, not None - pdb.plug_in_resynthesizer(new_image, new_drawable, htile, vtile, 0, work_layer.ID, -1, -1, 0.0, 0.117, 9, 200) - - display_image(new_image) - - # Clean up. - pdb.gimp_image_delete(temp_image) - pdb.gimp_image_undo_enable(image) - pdb.gimp_image_undo_enable(new_image) - - return new_image - -register( - "python_fu_render_texture", - N_("Create a new image with texture from the current image or selection. Optionally, create image edges suited for further, seamless tiling. "), - "New image is the same scale but seamless and irregular. Use 'Map>Tile' for less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "Copyright 2010 Lloyd Konneker", - "2010", - N_("_Texture..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - # Spinner is digital and linear, slider is analog but exponential - (PF_SPINNER, "resize_ratio", _("Ratio of size of new image to source selection"), 2, (0.5, 10, 0.5)), - (PF_TOGGLE, "make_tile", _("Make new image edges suitable for seamless tiling"), 0 ) - ], - [(PF_IMAGE, "new_image", "New, synthesized texture.")], - render_texture, - menu="/Filters/Render", - domain=("resynthesizer", gimp.locale_directory) - ) - -main() +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; Create new image having texture synthesized from the selection. +;; Works best if selection is natural (fractal). +;; Can work with man-made regular texture. +;; Works worst with man-made, structured but not regular, symbols. +;; Sometimes called rendering a texture. +;; +;; Requires resynthesizer plug-in. + +;; Author: +;; lloyd konneker, lkk, bootch at nc.rr.com, itr-tert + +;; Version: +;; 1.0 lkk 2010-07-15 Initial version +;; 1.1 lkk 2011-04-10 Fixed a bug with layer types impacting greyscale images. +;; later versions, see git log + +;; +;; The effect for users: +;; Similar to "Fill resynthesized pattern" except: +;; - here the arguments are reversed: you select a texture and create a new image +;; instead of selecting an area and choosing a pattern. +;; - here the result is less random (since Fill resynthesized adds noise.) +;; Different from tiling since: +;; - seamless and irregular pattern +;; +;; The continuum of randomness versus speed: +;; - Filters.Map.Tile is fast but has seams and regular pattern (even if you use "Make Seamless" first.) +;; - Filter.Render.Texture a tile followed by tiling is seamless but still has regularity. +;; - Filte.Render.Texture an entire image is slower but seamless and moderately irregular. +;; - Edit.Fill with resynthesized pattern is slowest but seamless and highly irregular, unpatterned. +;; +;; This filter is not tiling (instead resynthesizing) but makes +;; an image that you can then use to tile with especially if +;; you choose the option to make the edges suitable for tiling. +;; +;; IN: The selection (or the entire active drawable) is the source of texture and is not changed. +;; OUT New image, possibly resized canvas, same scale and resolution. +;; +;; TODO a quality setting +;; + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define debug FALSE) + + +(define (test) + (let* ((image (vector-ref (car (cdr (gimp-image-list))) 0)) + (drawable (car (gimp-image-get-active-drawable image)))) + (script-fu-render-texture image drawable 2 TRUE))) + + +(define (new-resized-image image resize-ratio) + ;; Create new image resized by a ratio from *selection* in the old image + (let* ((bounds (gimp-selection-bounds image)) + (is-selection (nth 0 bounds)) + (ulx (nth 1 bounds)) + (uly (nth 2 bounds)) + (lrx (nth 3 bounds)) + (lry (nth 4 bounds)) + (new-width nil) + (new-height nil) + (new-basetype nil) + (new-layertype nil) + (new-image nil) + (new-drawable nil)) + (if (<> TRUE is-selection) + (begin + ;; Resynthesizer will use the entire source image as corpus. + ;; Resize new image in proportion to entire source image. + (set! new-width (floor (* (car (gimp-image-width image)) resize-ratio))) + (set! new-height (floor (* (car (gimp-image-height image)) resize-ratio)))) + (begin + ;; Resize new image in proportion to selection in source + (set! new-width (floor (* (- lrx ulx) resize-ratio))) + (set! new-height (floor (* (- lry uly) resize-ratio))))) + + (set! new-basetype (car (gimp-image-base-type image))) ; same as source + (set! new-layertype (car (gimp-drawable-type (car (gimp-image-get-active-layer image))))) + (set! new-image (car (gimp-image-new new-width new-height new-basetype))) + ;; !!! Note that gimp-layer-new wants a layer type, not an image basetype + (set! new-drawable (car (gimp-layer-new new-image new-width new-height + new-layertype "Texture" 100 NORMAL-MODE))) + ;; The new layer is opaque, but the new image has transparent pixels (for case RGBA) + ;; Resynthesizer will not change the transparency, so make pixels opaque. + ;; Fill with white will make them opaque. + (gimp-drawable-fill new-drawable FILL-WHITE) + ;; A new layer must be added to the image. + (gimp-image-add-layer new-image new-drawable 0) + (list new-image new-drawable))) + + +(define (display-image image) + (catch "do nothing when error" + ;; If runmode is NONINTERACTIVE, expect gimp-display-new() to fail + (gimp-display-new image)) + (gimp-displays-flush)) + + +(define (script-fu-render-texture image drawable resize-ratio make-tile) + ;; + ;; Create a randomized texture image from the selection. + ;; The image can be suited for further, seamless tiling. + ;; The image is same scale and resolution but resized from the selection. + ;; Not undoable, no changes to the source (you can just delete the new image.) + ;; + ;; A selection in the source image is optional. + ;; If there is no selection, the resynthesizer will use the entire source image. + ;; + + ;; Its all or nothing, user must delete new image if not happy. + (gimp-image-undo-disable image) + + ;; + ;; Create new image, optionally resized, and display for it. + ;; + (let ((new-image-new-drawable nil) + (new-image nil) + (new-drawable nil) + (temp-image nil) + (bounds nil) + (is-selection nil) + (ulx nil) + (uly nil) + (lrx nil) + (lry nil) + (work-layer nil) + (htile nil) + (vtile nil)) + (set! new-image-new-drawable (new-resized-image image resize-ratio)) + (set! new-image (nth 0 new-image-new-drawable)) + (set! new-drawable (nth 1 new-image-new-drawable)) + + (gimp-image-undo-disable new-image) + (when (null? new-drawable) + (throw "Failed create layer.")) + + ;; If using new resynthesizer with animation for debugging + (when (= TRUE debug) + (display-image new-image)) + + ;; + ;; copy original into temp and crop it to the selection to save memory in resynthesizer + ;; + (set! temp-image (car (gimp-image-duplicate image))) + (when (null? temp-image) + (throw "Failed duplicate image")) + + ;; Get bounds, offset of selection + (set! bounds (gimp-selection-bounds image)) + (set! is-selection (nth 0 bounds)) + (set! ulx (nth 1 bounds)) + (set! uly (nth 2 bounds)) + (set! lrx (nth 3 bounds)) + (set! lry (nth 4 bounds)) + + + (when (= TRUE is-selection) + (gimp-image-crop temp-image (- lrx ulx) (- lry uly) ulx uly)) + ;; Resynthesizer will use all if no selection. + + ;; Don't flatten because it turns transparency to background (white usually) + (set! work-layer (car (gimp-image-get-active-layer temp-image))) + (when (null? work-layer) + (throw "Failed get active layer")) + + ;; Insure the selection is all (not necessary, resynthesizer will use all if no selection.) + (gimp-selection-all temp-image) + + ;; Settings for making edges suitable for seamless tiling afterwards. + ;; That is what these settings mean in the resynthesizer: + ;; wrap context probes in the target so that edges of target will be suitable for seamless tiling. + ;; I.E. treat the target as a sphere when matching. + (if (= TRUE make-tile) + (begin + (set! htile 1) + (set! vtile 1)) + (begin + (set! htile 0) + (set! vtile 0))) + + ;; Call resynthesizer + ;; use_border is moot since there is no context (outside the target) in the newImage. + ;; The target is the entire new image, the source is the cropped copy of the selection. + ;; + ;; 9 neighbors (a 3x3 patch) and 200 tries for speed, since new image is probably large + ;; and source is probably natural (fractal), where quality is not important. + + ;; For version of resynthesizer with uninverted selection + ;; !!! Pass -1 for ID of no layer, not None + (plug-in-resynthesizer + RUN-NONINTERACTIVE ; run-mode + new-image ; image + new-drawable ; drawable + vtile htile ; vtile htile + 0 ; use-context + work-layer ; corpus + -1 ; inmask + -1 ; outmask + 0.0 ; map-weight + 0.117 ; autism + 9 ; neighbourhood + 200) ; trys + + (display-image new-image) + + ;; Clean up. + (gimp-image-delete temp-image) + (gimp-image-undo-enable image) + (gimp-image-undo-enable new-image) + + new-image)) + + +(script-fu-register + ;; func name + "script-fu-render-texture" + ;; menu label + (N_ "_Texture(scm)...") + ;; description + (string-append + "Create a new image with texture from the current image or selection. Optionally, create image edges suited for further, seamless tiling. " + "New image is the same scale but seamless and irregular. Use 'Map>Tile' for less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. Requires separate resynthesizer plugin.") + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2010 Lloyd Konneker" + ;; date created + "2010" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + ;; Spinner is digital and linear, slider is analog but exponential + SF-ADJUSTMENT (_ "Ratio of size of new image to source selection") + (list 2 ; value + 0.5 ; lower + 10 ; upper + 0.5 ; step_inc + 1 ; page_inc + SF-SPINNER) + SF-TOGGLE (_ "Make new image edges suitable for seamless tiling") FALSE + ) +;; output: [(PF_IMAGE, "new_image", "New, synthesized texture.")] + +(script-fu-menu-register "script-fu-render-texture" + "/Filters/Render") + +(script-fu-menu-register "script-fu-render-texture" + "/Filters/Resynthesizer(scm)/") diff --git a/PluginScripts/plugin-resynth-enlarge.scm b/PluginScripts/plugin-resynth-enlarge.scm index 774fdb6..95578c7 100644 --- a/PluginScripts/plugin-resynth-enlarge.scm +++ b/PluginScripts/plugin-resynth-enlarge.scm @@ -1,112 +1,132 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Enlarge and resynthesize" - -Author: -lloyd konneker -Based on smart_enlarge.scm 2000 by Paul Harrison. - -Version: -1.0 lloyd konneker lkk 2010 Initial version in python. - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -def plugin_main(image, drawable, scale_factor): - ''' - Algorithm: - - Scale image up. - Resynthesize with: - corpus = original size image - in map = original size image but scaled up and down to blur - out map = scaled up image - - This restores the detail that scaling up looses. - It maintains the aspect ratio of all image features. - - Unlike the original smart-enlarge.scm, this alters the original image. - - original did not accept an alpha channel - ''' - - - temp_image1 = pdb.gimp_image_duplicate(image) # duplicate for in map - if not temp_image1: - raise RuntimeError, "Failed duplicate image" - temp_image2 = pdb.gimp_image_duplicate(image) # duplicate for corpus - if not temp_image2: - raise RuntimeError, "Failed duplicate image" - temp_layer1 = pdb.gimp_image_get_active_layer(temp_image1) - if not temp_layer1: - raise RuntimeError, "Failed get active layer" - temp_layer2 = pdb.gimp_image_get_active_layer(temp_image2) - if not temp_layer2: - raise RuntimeError, "Failed get active layer" - - # scale input map down and back, to blur - width = pdb.gimp_drawable_width(drawable) - height = pdb.gimp_drawable_height(drawable) - pdb.gimp_image_scale(temp_image1, width/scale_factor, height/scale_factor) - pdb.gimp_image_scale(temp_image1, width, height) - - # scale up the image - pdb.gimp_image_scale(image, width * scale_factor, height*scale_factor) - - # Resynthesize to restore details. - # Note there should not be a selection. TODO - pdb.plug_in_resynthesizer( - image, - drawable, - 0, 0, 0, - temp_layer2.ID, # corpus - temp_layer1.ID, # input map - drawable.ID, # output map is scaled up original itself - 1.0, 0.117, 8, 500) - - pdb.gimp_image_delete(temp_image1) - pdb.gimp_image_delete(temp_image2) - - -if __name__ == "__main__" : - register( - "python_fu_enlarge_resynthesized", - N_("Enlarge image and synthesize to sharpen."), - "Requires separate resynthesizer plugin", - "Lloyd Konneker", - "Copyright 2000 Paul Harrison, 2010 Lloyd Konneker", - "2010", - N_("Enlarge & sharpen..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_ADJUSTMENT, "scale_factor", _("Scale by:"), 2, (1, 32, 0.1)) - ], - [], - plugin_main, - menu="/Filters/Enhance", - domain=("resynthesizer", gimp.locale_directory) - ) - - main() - - +;; Gimp plugin "Enlarge and resynthesize" + +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; Author: +;; itr-tert +;; Based on plugin-resynth-enlarge.py 2010 lloyd konneker +;; Based on smart_enlarge.scm 2000 by Paul Harrison. + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define-with-return + (script-fu-enlarge-resynthesized image drawable scale-factor) + ;; Algorithm: + ;; + ;; Scale image up. + ;; Resynthesize with: + ;; corpus = original size image + ;; in map = original size image but scaled up and down to blur + ;; out map = scaled up image + ;; + ;; This restores the detail that scaling up looses. + ;; It maintains the aspect ratio of all image features. + ;; + ;; Unlike the original smart-enlarge.scm, this alters the original image. + ;; + ;; original did not accept an alpha channel + + (gimp-message-set-handler MESSAGE-BOX) + + (let ((temp-image1 nil) + (temp-image2 nil) + (temp-layer1 nil) + (temp-layer2 nil) + (width nil) + (height nil)) + (gimp-image-undo-group-start image) + + (set! temp-image1 (car (gimp-image-duplicate image))) ; duplicate for in map + (set! temp-image2 (car (gimp-image-duplicate image))) ; duplicate for corpus + (when (or (null? temp-image1) + (null? temp-image2)) + (gimp-message "Failed duplicate image") + (return)) + + (set! temp-layer1 (car (gimp-image-get-active-layer temp-image1))) + (set! temp-layer2 (car (gimp-image-get-active-layer temp-image2))) + (when (or (null? temp-layer1) + (null? temp-layer2)) + (gimp-message "Failed get active layer") + (return)) + + ;; scale input map down and back, to blur + (set! width (car (gimp-drawable-width drawable))) + (set! height (car (gimp-drawable-height drawable))) + + (gimp-image-scale temp-image1 (/ width scale-factor) (/ height scale-factor)) + (gimp-image-scale temp-image1 width height ) + + ;; scale up the image + (gimp-image-scale image (* width scale-factor) (* height scale-factor)) + + ;; Resynthesize to restore details. + ;; Note there should not be a selection. TODO + (plug-in-resynthesizer + RUN-NONINTERACTIVE + image + drawable + 0 0 0 + temp-layer2 ; corpus + temp-layer1 ; input map + drawable ; output map is original itself + 1.0 0.117 8 500) + + (gimp-image-delete temp-image1) + (gimp-image-delete temp-image2) + (gimp-image-undo-group-end image) + )) + +(script-fu-register + ;; func name + "script-fu-enlarge-resynthesized" + ;; menu label + (N_ "Enlarge & sharpen(scm)...") + ;; description + (string-append + (N_ "Enlarge image and synthesize to sharpen.") + (N_ "Requires separate resynthesizer plugin")) + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2000 Paul Harrison, 2010 Lloyd Konneker" + ;; date created + "2010" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT (_ "Scale by:") ; scale_factor + (list 2 ; value + 1 ; lower + 32 ; upper + 0.1 ; step_inc + 1 ; page_inc + 2 ; digits + SF-SPINNER) ; type + ) + +(script-fu-menu-register "script-fu-enlarge-resynthesized" + "/Filters/Enhance") + +(script-fu-menu-register "script-fu-enlarge-resynthesized" + "/Filters/Resynthesizer(scm)/") diff --git a/PluginScripts/plugin-resynth-fill-pattern.scm b/PluginScripts/plugin-resynth-fill-pattern.scm index dd89610..f2ff710 100644 --- a/PluginScripts/plugin-resynth-fill-pattern.scm +++ b/PluginScripts/plugin-resynth-fill-pattern.scm @@ -1,118 +1,124 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Fill with pattern seamless..." -Front end to the resynthesizer plugin to make a seamless fill. - -Copyright 2011 lloyd konneker -Idea by Rob Antonishen - -Version: -1.0 lloyd konneker - -During development, remember to make it executable!!! -And to remove older versions, both .scm and .py that might hide it. - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html - -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True); - -debug = False - -def layer_from_pattern(image, pattern): - ''' - Create a new image and layer having the same size as a pattern. - ''' - new_basetype = pdb.gimp_image_base_type(image) # same as source - new_layertype = pdb.gimp_drawable_type(pdb.gimp_image_get_active_layer(image)) - pattern_width, pattern_height, bpp = pdb.gimp_pattern_get_info(pattern) - new_image = pdb.gimp_image_new(pattern_width, pattern_height, new_basetype) - # !!! Note that gimp_layer_new wants a layer type, not an image basetype - new_drawable = pdb.gimp_layer_new(new_image, pattern_width, pattern_height, - new_layertype, "Texture", 100, NORMAL_MODE) - pdb.gimp_image_add_layer(new_image, new_drawable, 0) - return new_image, new_drawable - - -def guts(image, drawable, pattern): - ''' Crux of algorithm ''' - - # Make drawble from pattern - pattern_image, pattern_layer = layer_from_pattern(image, pattern) - - # Fill it with pattern - # NOT pass pattern_layer.ID !!! - pdb.gimp_drawable_fill(pattern_layer, PATTERN_FILL) - - if debug: - gimp.Display(pattern_image) - gimp.displays_flush() - - # Resynthesize the selection from the pattern without using context - # 0,0,0: Not use_border (context), not tile horiz, not tile vert - # -1, -1, 0: No maps and no map weight - # DO pass pattern_layer.ID !!! - # Resynthesizer is an engine, never interactive - pdb.plug_in_resynthesizer(image, drawable, 0, 0, 0, pattern_layer.ID, -1, -1, 0, 0.05, 8, 300) - - # Clean up - if not debug: - # Delete image that is displayed throws RuntimeError - pdb.gimp_image_delete(pattern_image) - - -def plugin_main(image, drawable, pattern): - ''' - Main: the usual user-friendly precondition checking, postcondition cleanup. - pattern is a string - ''' - # User_friendly: if no selection, use entire image. - # But the resynthesizer does that for us. - - # Save/restore the context since we change the pattern - pdb.gimp_context_push() - pdb.gimp_context_set_pattern(pattern) - guts(image, drawable, pattern) - pdb.gimp_context_pop() - - gimp.displays_flush() - - -register( - "python_fu_fill_pattern_resynth", - N_("Seamlessly fill with a pattern using synthesis."), - "Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "Copyright 2011 Lloyd Konneker", - "2011", - N_("_Fill with pattern seamless..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_PATTERN, "pattern", _("Pattern:"), 'Maple Leaves') - ], - [], - plugin_main, - menu="/Edit", - domain=("resynthesizer", gimp.locale_directory) - ) - -main() +;; Gimp plugin "Fill with pattern seamless..." + +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; Front end to the resynthesizer plugin to make a seamless fill. + +;; Author: +;; itr-tert +;; Based on plugin-resynth-fill-pattern.py Copyright 2011 lloyd konneker +;; Idea by Rob Antonishen + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True); + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define debug FALSE) + + +(define (layer-from-pattern image pattern) + ;; Create a new image and layer having the same size as a pattern. + (let* ((new-basetype (car (gimp-image-base-type image))) ; same as source + (new-layertype (car (gimp-drawable-type (car (gimp-image-get-active-layer image))))) + (pattern-info (gimp-pattern-get-info pattern)) + (pattern-width (nth 0 pattern-info)) + (pattern-height (nth 1 pattern-info)) + (bpp (nth 2 pattern-info)) + (new-image (car (gimp-image-new pattern-width pattern-height new-basetype))) + ;; !!! Note that gimp-layer-new wants a layer type, not an image basetype + (new-drawable (car (gimp-layer-new new-image pattern-width pattern-height + new-layertype "Texture" 100 NORMAL-MODE)))) + (gimp-image-add-layer new-image new-drawable 0) + (list new-image new-drawable))) + + +(define (guts image drawable pattern) + ;; Crux of algorithm + + ;; Make drawble from pattern + (let* ((image-layer (layer-from-pattern image pattern)) + (pattern-image (nth 0 image-layer)) + (pattern-layer (nth 1 image-layer)) + ) + + ;; Fill it with pattern + (gimp-drawable-fill pattern-layer PATTERN-FILL) + + (when (= debug TRUE) + (gimp-display-new pattern-image) + (gimp-displays-flush)) + + ;; Resynthesize the selection from the pattern without using context + ;; 0,0,0: Not use_border (context), not tile horiz, not tile vert + ;; -1, -1, 0: No maps and no map weight + ;; DO pass pattern_layer.ID !!! + ;; Resynthesizer is an engine, never interactive + (plug-in-resynthesizer RUN-NONINTERACTIVE image drawable + 0 0 0 pattern-layer + -1 -1 0 0.05 8 300) + ;; Clean up + (when (= debug FALSE) + ;; Delete image that is displayed throws RuntimeError + (gimp-image-delete pattern-image)))) + + +(define (script-fu-fill-pattern-resynth image drawable pattern) + ;; Main: the usual user-friendly precondition checking, postcondition cleanup. + ;; pattern is a string + + ;; User_friendly: if no selection, use entire image. + ;; But the resynthesizer does that for us. + + ;; Save/restore the context since we change the pattern + (gimp-message-set-handler MESSAGE-BOX) + (gimp-context-push) + (gimp-context-set-pattern pattern) + (guts image drawable pattern) + (gimp-context-pop) + (gimp-displays-flush)) + + +(script-fu-register + ;; func name + "script-fu-fill-pattern-resynth" + ;; menu label + (N_ "_Fill with pattern seamless(scm)...") + ;; description + (string-append + (N_ "Seamlessly fill with a pattern using synthesis.") + (N_ "Requires separate resynthesizer plugin.")) + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2011 Lloyd Konneker" + ;; date created + "2011" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-PATTERN (_ "Pattern:") "Maple Leaves" + ) + +(script-fu-menu-register "script-fu-fill-pattern-resynth" + "/Edit") + +(script-fu-menu-register "script-fu-fill-pattern-resynth" + "/Filters/Resynthesizer(scm)/") diff --git a/PluginScripts/plugin-resynth-sharpen.scm b/PluginScripts/plugin-resynth-sharpen.scm index bc2c42e..2193adf 100644 --- a/PluginScripts/plugin-resynth-sharpen.scm +++ b/PluginScripts/plugin-resynth-sharpen.scm @@ -1,113 +1,134 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Sharpen by resynthesis" -Requires resynthesizer plug_in (v2). - -Author: -lloyd konneker (bootch at nc.rr.com) -Based on smart_enlarge.scm 2000 by Paul Harrison. - -Version: -1.0 lloyd konneker lkk 2010 Initial version in python. - - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html - -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -def plugin_main(image, drawable, scale_factor): - ''' - Algorithm: - - Resynthesize with: - corpus = smaller image - in map = smaller image but scaled up and down to blur - out map = original image - - TODO undo - - original did not accept an alpha channel - ''' - - - temp_image1 = pdb.gimp_image_duplicate(image) # duplicate for in map - if not temp_image1: - raise RuntimeError, "Failed duplicate image" - temp_image2 = pdb.gimp_image_duplicate(image) # duplicate for corpus - if not temp_image2: - raise RuntimeError, "Failed duplicate image" - temp_layer1 = pdb.gimp_image_get_active_layer(temp_image1) - if not temp_layer1: - raise RuntimeError, "Failed get active layer" - temp_layer2 = pdb.gimp_image_get_active_layer(temp_image2) - if not temp_layer2: - raise RuntimeError, "Failed get active layer" - - - width = pdb.gimp_drawable_width(drawable) - height = pdb.gimp_drawable_height(drawable) - - - # scale input image down, for corpus map - pdb.gimp_image_scale(temp_image2, width/scale_factor, height/scale_factor) - - # scale input image way down, then back up to, to blur, for corpus - # Final size is same size as corpus map. - pdb.gimp_image_scale(temp_image1, width / (2 * scale_factor), height / (2 * scale_factor) ) - pdb.gimp_image_scale(temp_image1, width/scale_factor, height/scale_factor) - - # Resynthesize to restore details. - # Note there should not be a selection. TODO - pdb.plug_in_resynthesizer( - image, - drawable, - 0, 0, 0, - temp_layer2.ID, # corpus is smaller original - temp_layer1.ID, # input map is blurred smaller original - drawable.ID, # output map is original itself - 1.0, 0.117, 8, 500) - - pdb.gimp_image_delete(temp_image1) - pdb.gimp_image_delete(temp_image2) - - -register( - "python_fu_sharpen_resynthesized", - N_("Sharpen image by synthesis."), - "Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "Copyright 2000 Paul Harrison, 2010 Lloyd Konneker", - "2010", - N_("Sharpen by synthesis..."), - "RGB*, GRAY*", - [ (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_ADJUSTMENT, "sharpen_factor", _("Sharpening:"), 2, (1, 32, 0.1)), - ], - [], - plugin_main, - menu="/Filters/Enhance", - domain=("resynthesizer", gimp.locale_directory) +;; Gimp plugin "Sharpen by resynthesis" +;; Requires resynthesizer plug_in (v2). + +;; License: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; Author: itr-tert +;; Based on plugin-resynth-sharpen.py 2010 lloyd konneker (bootch at nc.rr.com) +;; Based on smart_enlarge.scm 2000 by Paul Harrison. + + +;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + +(define-with-return + (script-fu-sharpen-resynthesized image drawable scale-factor) + + ;; Algorithm: + ;; + ;; Resynthesize with: + ;; corpus = smaller image + ;; in map = smaller image but scaled up and down to blur + ;; out map = original image + ;; + ;; original did not accept an alpha channel + + (gimp-message-set-handler MESSAGE-BOX) + + (let ((temp-image1 nil) + (temp-image2 nil) + (temp-layer1 nil) + (temp-layer2 nil) + (width nil) + (height nil)) + (gimp-image-undo-group-start image) + + (set! temp-image1 (car (gimp-image-duplicate image))) ; duplicate for in map + (set! temp-image2 (car (gimp-image-duplicate image))) ; duplicate for corpus + (when (or (null? temp-image1) + (null? temp-image2)) + (gimp-message "Failed duplicate image") + (return)) + + (set! temp-layer1 (car (gimp-image-get-active-layer temp-image1))) + (set! temp-layer2 (car (gimp-image-get-active-layer temp-image2))) + (when (or (null? temp-layer1) + (null? temp-layer2)) + (gimp-message "Failed get active layer") + (return)) + + (set! width (car (gimp-drawable-width drawable))) + (set! height (car (gimp-drawable-height drawable))) + + ;; scale input image down, for corpus map + (gimp-image-scale temp-image2 + (/ width scale-factor) + (/ height scale-factor)) + ;; scale input image way down, then back up to, to blur, for corpus + ;; Final size is same size as corpus map. + (gimp-image-scale temp-image1 + (/ width (* 2 scale-factor)) + (/ height (* 2 scale-factor))) + (gimp-image-scale temp-image1 + (/ width scale-factor) + (/ height scale-factor)) + + ;; Resynthesize to restore details. + ;; Note there should not be a selection. TODO + (plug-in-resynthesizer + RUN-NONINTERACTIVE + image + drawable + 0 0 0 + temp-layer2 ; corpus is smaller original + temp-layer1 ; input map is blurred smaller original + drawable ; output map is original itself + 1.0 0.117 8 500) + + (gimp-image-delete temp-image1) + (gimp-image-delete temp-image2) + (gimp-image-undo-group-end image) + )) + + +(script-fu-register + ;; func name + "script-fu-sharpen-resynthesized" + ;; menu label + (N_ "Sharpen by synthesis(scm)...") + ;; description + (string-append + (N_ "Sharpen image by synthesis.") + (N_ "Requires separate resynthesizer plugin.")) + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2000 Paul Harrison, 2010 Lloyd Konneker" + ;; date created + "2010" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT (_ "Sharpening:") ; sharpen_factor + (list 2 ; value + 1 ; lower + 32 ; upper + 0.1 ; step_inc + 1 ; page_inc + 2 ; digits + SF-SPINNER) ; type ) -main() - +(script-fu-menu-register "script-fu-sharpen-resynthesized" + "/Filters/Enhance") +(script-fu-menu-register "script-fu-sharpen-resynthesized" + "/Filters/Resynthesizer(scm)/") \ No newline at end of file diff --git a/PluginScripts/plugin-uncrop.scm b/PluginScripts/plugin-uncrop.scm index e50f3f4..32a0727 100644 --- a/PluginScripts/plugin-uncrop.scm +++ b/PluginScripts/plugin-uncrop.scm @@ -1,161 +1,264 @@ -#!/usr/bin/env python - -''' -Gimp plugin "Uncrop" - -Increase image/canvas size and synthesize outer band from edge of original. - -Author: -lloyd konneker, lkk - -Version: -1.0 lkk 5/15/2009 Initial version in scheme, released to Gimp Registry. -1.1 lkk 9/21/2009 Translate to python. - -License: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -The GNU Public License is available at -http://www.gnu.org/copyleft/gpl.html - - -The effect for users: -widens the field of view, maintaining perspective of original -Should be undoable, except for loss of selection. -Should work on any image type, any count of layers and channels (although only active layer is affected.) - -Programming notes: -Scheme uses - in names, python uses _ -Programming devt. cycle: -Initial creation: cp foo.py ~/.gimp-2.6/scripts, chmod +x, start gimp -Refresh: just copy, no need to restart gimp if the pdb registration is unchanged - -IN: Nothing special. The selection is immaterial but is not preserved. -OUT larger layer and image. All other layers not enlarged. -''' - -from gimpfu import * - -gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - -def resizeImageCentered(image, percentEnlarge): - # resize and center image by percent (converted to pixel units) - deltaFraction = (percentEnlarge / 100) + 1.0 - priorWidth = pdb.gimp_image_width(image) - priorHeight = pdb.gimp_image_height(image) - deltaWidth = priorWidth * deltaFraction - deltaHeight = priorHeight * deltaFraction - centeredOffX = (deltaWidth - priorWidth)/ 2 - centeredOffY = (deltaHeight - priorHeight) / 2 - pdb.gimp_image_resize(image, deltaWidth, deltaHeight, centeredOffX, centeredOffY) - #if not pdb.gimp_image_resize(image, deltaWidth, deltaHeight, centeredOffX, centeredOffY): - # raise RuntimeError, "Failed resize" - -def shrinkSelectionByPercent(image, percent): - # shrink selection by percent (converted to pixel units) - deltaFraction = percent / 100 - # convert to pixel dimensions - priorWidth = pdb.gimp_image_width(image) - priorHeight = pdb.gimp_image_height(image) - deltaWidth = priorWidth * deltaFraction - deltaHeight = priorHeight * deltaFraction - # !!! Note total shrink percentage is halved (width of band is percentage/2) - maxDelta = max(deltaWidth, deltaHeight) / 2 - - pdb.gimp_selection_shrink(image, maxDelta) - #if not pdb.gimp_selection_shrink(image, maxDelta): - # raise RuntimeError, "Failed shrink selection" - - -def uncrop(orgImage, drawable, percentEnlargeParam=10): - ''' - Create frisket stencil selection in a temp image to pass as source (corpus) to plugin resynthesizer, - which does the substantive work. - ''' - - if not pdb.gimp_item_is_layer(drawable): - pdb.gimp_message(_("A layer must be active, not a channel.")) - return - - pdb.gimp_image_undo_group_start(orgImage) - - # copy original into temp for later use - tempImage = pdb.gimp_image_duplicate(orgImage) - if not tempImage: - raise RuntimeError, "Failed duplicate image" - - ''' - Prepare target: enlarge canvas and select the new, blank outer ring - ''' - - # Save original bounds to later select outer band - pdb.gimp_selection_all(orgImage) - selectAllPrior = pdb.gimp_selection_save(orgImage) - # Resize image alone doesn't resize layer, so resize layer also - resizeImageCentered(orgImage, percentEnlargeParam) - pdb.gimp_layer_resize_to_image_size(drawable) - pdb.gimp_image_select_item(orgImage, CHANNEL_OP_REPLACE, selectAllPrior) - # select outer band, the new blank canvas. - pdb.gimp_selection_invert(orgImage) - # Assert target image is ready. - - ''' - Prepare source (corpus) layer, a band at edge of original, in a dupe. - Note the width of corpus band is same as width of enlargement band. - ''' - # Working with the original size. - # Could be alpha channel transparency - workLayer = pdb.gimp_image_get_active_layer(tempImage) - if not workLayer: - raise RuntimeError, "Failed get active layer" - # Select outer band: select all, shrink - pdb.gimp_selection_all(tempImage) - shrinkSelectionByPercent(tempImage, percentEnlargeParam) - pdb.gimp_selection_invert(tempImage) # invert interior selection into a frisket - # Note that v1 resynthesizer required an inverted selection !! - # No need to crop corpus to save memory. - - # Note that the API hasn't changed but use_border param now has more values. - # !!! The crux: use_border param=5 means inside out direction - pdb.plug_in_resynthesizer(orgImage, drawable, 0,0,5, workLayer.ID, -1, -1, 0.0, 0.117, 16, 500) - - # Clean up. - # Any errors now are moot. - pdb.gimp_selection_none(orgImage) - pdb.gimp_image_remove_channel(orgImage, selectAllPrior) - pdb.gimp_image_undo_group_end(orgImage) - pdb.gimp_displays_flush() - gimp.delete(tempImage) # Comment out to debug corpus creation. - - -register( - "python_fu_uncrop", - N_("Enlarge image by synthesizing a border that matches the edge, maintaining perspective. Works best for small enlargement of natural edges. Undo a Crop instead, if possible! "), - "Requires separate resynthesizer plugin.", - "Lloyd Konneker", - "Copyright 2009 Lloyd Konneker", - "2009", - N_("Uncrop..."), - "RGB*, GRAY*", - [ - (PF_IMAGE, "image", "Input image", None), - (PF_DRAWABLE, "drawable", "Input drawable", None), - (PF_SLIDER, "percentEnlargeParam", _("Percent enlargement"), 10, (0, 100, 1)) - ], - [], - uncrop, - menu="/Filters/Enhance", - domain=("resynthesizer", gimp.locale_directory) +;; Gimp plugin "Uncrop" + +;; License: +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; The GNU Public License is available at +;; http://www.gnu.org/copyleft/gpl.html + +;; Increase image/canvas size and synthesize outer band from edge of original. + +;; Author: +;; lloyd konneker, lkk, itr-tert + +;; Version: +;; 1.0 lkk 2009-5-15 Initial version in scheme, released to Gimp Registry. +;; 1.1 lkk 2009-9-21 Translate to python. +;; later versions, see git log + +;; The effect for users: +;; widens the field of view, maintaining perspective of original +;; Should be undoable, except for loss of selection. +;; Should work on any image type, any count of layers and channels (although only active layer is affected.) +;; +;; IN: Nothing special. The selection is immaterial but is not preserved. +;; OUT larger layer and image. All other layers not enlarged. + + +;;gettext.install("resynthesizer", gimp.locale_directory, unicode=True) + + +(define (_ m) "stub" m) + +(define (N_ m) "stub" m) + + +(define-with-return (uncrop-test) + (tracing TRUE) + (let* ((image (vector-ref (car (cdr (gimp-image-list))) 0)) + (drawable (car (gimp-image-get-active-drawable image)))) + (script-fu-uncrop + image + drawable + 2 + ))) + + +(define (get-image) + (vector-ref (car (cdr (gimp-image-list))) 0)) + + +(define (get-drawable image) + (when (null? image) + (set! image (get-image))) + (car (gimp-image-get-active-drawable image))) + + +(define (get-component-list image) + (when (null? image) (set! image (get-image))) + (let ((type (car (gimp-image-base-type image)))) + (cond ((= type RGB) + (list RED-CHANNEL GREEN-CHANNEL BLUE-CHANNEL ALPHA-CHANNEL)) + ((= type GRAY) + (list GRAY-CHANNEL ALPHA-CHANNEL)) + ((= type INDEXED) + (list INDEXED-CHANNEL ALPHA-CHANNEL)) + (#t + (throw "unkwno image base type"))))) + + +(define (get-components-active image) + (when (null? image) (set! image (get-image))) + (map (lambda (channel) (car (gimp-image-get-component-active image channel))) + (get-component-list image))) + + +(define (set-components-active image active-list) + (when (null? image) (set! image (get-image))) + (let* ((components (get-component-list image)) + (components-length (length components)) + (active-list-length (length active-list))) + + (when (<> active-list-length components-length) + (throw "set-components-active: active_list.length != image.components.length")) + + (do ((i (- active-list-length 1) (- i 1))) + ((> 0 i)) + (gimp-image-set-component-active image + (nth i components) + (nth i active-list)))) ) -main() +(define (drawable-anti-erase-selection drawable) + (let* ((image nil) + (ch-active-list nil) + (components nil)) + (set! image (if (null? drawable) + (get-image) + (car (gimp-item-get-image drawable)))) + (set! drawable (if (null? drawable) + (get-drawable image) + drawable)) + (set! ch-active-list (get-components-active image)) + (set! components (get-component-list image)) + (for-each (lambda (ch) + (gimp-image-set-component-active image ch + (if (= ch ALPHA-CHANNEL) TRUE FALSE))) + components) + (gimp-image-set-component-active image ALPHA-CHANNEL TRUE) + (gimp-edit-bucket-fill drawable FILL-WHITE LAYER-MODE-NORMAL 100 255 FALSE 0 0) + (set-components-active image ch-active-list) + )) + + +(define (resizeImageCentered image percentEnlarge) + ;; resize and center image by percent (converted to pixel units) + (let* ((deltaFraction (+ (/ percentEnlarge 100) 1.0)) + (priorWidth (car (gimp-image-width image))) + (priorHeight (car (gimp-image-height image))) + (deltaWidth (* priorWidth deltaFraction)) + (deltaHeight (* priorHeight deltaFraction)) + (centeredOffX (/ (- deltaWidth priorWidth) 2)) + (centeredOffY (/ (- deltaHeight priorHeight) 2))) + (gimp-image-resize image deltaWidth deltaHeight centeredOffX centeredOffY) + ;; if not gimp-image-resize(image, deltaWidth, deltaHeight, centeredOffX, centeredOffY): + ;; raise RuntimeError, "Failed resize" + )) + + +(define (shrinkSelectionByPercent image percent) + ;; shrink selection by percent (converted to pixel units) + (let* ((deltaFraction (/ percent 100)) + ;; convert to pixel dimensions + (priorWidth (car (gimp-image-width image))) + (priorHeight (car (gimp-image-height image))) + (deltaWidth (* priorWidth deltaFraction)) + (deltaHeight (* priorHeight deltaFraction)) + ;; !!! Note total shrink percentage is halved (width of band is percentage/2) + (maxDelta (/ (max deltaWidth deltaHeight) 2))) + (gimp-selection-shrink image maxDelta) + ;; if not gimp-selection-shrink(image, maxDelta): + ;; raise RuntimeError, "Failed shrink selection" + )) + + +(define-with-return (script-fu-uncrop orgImage drawable percentEnlargeParam) + ;; Create frisket stencil selection in a temp image to pass as source (corpus) to plugin resynthesizer, + ;; which does the substantive work. + + (gimp-message-set-handler MESSAGE-BOX) + (when (<> TRUE (car (gimp-item-is-layer drawable))) + (gimp-message (_ "A layer must be active, not a channel.")) + (return)) + + (gimp-image-undo-group-start orgImage) + + (let ((tempImage nil) + (selectAllPrior nil) + (workLayer nil)) + ;; copy original into temp for later use + (set! tempImage (car (gimp-image-duplicate orgImage))) + (when (null? tempImage) + (throw "Failed duplicate image")) + + ;; + ;; Prepare target: enlarge canvas and select the new, blank outer ring + ;; + + ;; Save original bounds to later select outer band + (gimp-selection-all orgImage) + (set! selectAllPrior (car (gimp-selection-save orgImage))) + ;; Resize image alone doesn't resize layer, so resize layer also + (resizeImageCentered orgImage percentEnlargeParam) + (gimp-layer-resize-to-image-size drawable) + (gimp-image-select-item orgImage CHANNEL-OP-REPLACE selectAllPrior) + ;; select outer band, the new blank canvas. + (gimp-selection-invert orgImage) + ;; Assert target image is ready. + + ;; + ;; Prepare source (corpus) layer, a band at edge of original, in a dupe. + ;; Note the width of corpus band is same as width of enlargement band. + ;; + + ;; Working with the original size. + ;; Could be alpha channel transparency + (set! workLayer (car (gimp-image-get-active-layer tempImage))) + (when (null? workLayer) + (throw "Failed get active layer")) + ;; Select outer band: select all, shrink + (gimp-selection-all tempImage) + (shrinkSelectionByPercent tempImage percentEnlargeParam) + (gimp-selection-invert tempImage) ; invert interior selection into a frisket + + (plug-in-resynthesizer + RUN-NONINTERACTIVE ; run-mode + orgImage ; image + drawable ; drawable + 0 0 ; vtile htile + 5 ; use-context ; 5 means inside out direction + workLayer ; corpus + -1 ; inmask + -1 ; outmask + 0.0 ; map-weight + 0.117 ; autism + 16 ; neighbourhood + 500) ; trys + + (when (= TRUE (car (gimp-drawable-has-alpha drawable))) + (drawable-anti-erase-selection drawable)) + + ;; Clean up. + ;; Any errors now are moot. + (gimp-selection-none orgImage) + (gimp-image-remove-channel orgImage selectAllPrior) + (gimp-image-set-active-layer orgImage drawable) + (gimp-displays-flush) + (gimp-image-delete tempImage) + (gimp-image-undo-group-end orgImage) + )) + +(script-fu-register + ;; func name + "script-fu-uncrop" + ;; menu label + (N_ "Uncrop(scm)...") + ;; description + (string-append + (N_ "Enlarge image by synthesizing a border that matches the edge, maintaining perspective. Works best for small enlargement of natural edges. Undo a Crop instead, if possible! ") + (N_ "Requires separate resynthesizer plugin.")) + ;; author + "Lloyd Konneker" + ;; copyright notice + "Copyright 2009 Lloyd Konneker" + ;; date created + "2009" + ;; image type that the script works on + "RGB*, GRAY*" + ;; parameters + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT (_ "Percent enlargement") + (list 10 ; value + 0 ; lower + 100 ; upper + 1 ; step_inc + 10 ; page_inc + 6 ; digits + SF-SLIDER)) + +(script-fu-menu-register "script-fu-uncrop" + "/Filters/Enhance") + +(script-fu-menu-register "script-fu-uncrop" + "/Filters/Resynthesizer(scm)/") From aafd0c3474575b46488716d985a3e08692712525 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sat, 22 Oct 2022 19:04:02 +0900 Subject: [PATCH 04/23] Update .gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index cb586bd..436af2f 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,13 @@ Makefile.in Makefile +/src/resynthesizer/resynthesizer +/src/resynthesizer-gui/resynthesizer_gui +/src/resynthesizer-gettext/resynthesizer_gettext + +POTFILES +stamp-it +stamp-h1 + # ignore separate build directory /build From b9da2faa262ae3e23e805c4f76194dada3ab5f04 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sat, 22 Oct 2022 21:01:04 +0900 Subject: [PATCH 05/23] Add a plugin to handle gettext from script-fu --- autogen.sh | 3 + configure.ac | 1 + po/Makefile.in.in | 2 +- po/POTFILES.in | 17 ++-- src/Makefile.am | 2 +- src/resynthesizer-gettext/Makefile.am | 20 +++++ .../resynthesizer-gettext.c | 89 +++++++++++++++++++ 7 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 src/resynthesizer-gettext/Makefile.am create mode 100644 src/resynthesizer-gettext/resynthesizer-gettext.c diff --git a/autogen.sh b/autogen.sh index 90c36b4..6f94671 100755 --- a/autogen.sh +++ b/autogen.sh @@ -193,6 +193,9 @@ autoconf || exit 1 glib-gettextize --copy --force || exit 1 intltoolize --copy --force --automake || exit 1 +# Add arguments to xgettext (what is the correct way?) +sed --in-place po/Makefile.in.in -e 's/^\(GENPOT[\t ]*=\)\(.*\)$/\1 XGETTEXT_ARGS="--keyword=SG_ --keyword=G_" \2/' + cd $ORIGDIR $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" diff --git a/configure.ac b/configure.ac index b66c985..bfc8125 100644 --- a/configure.ac +++ b/configure.ac @@ -136,6 +136,7 @@ lib/Makefile src/Makefile src/resynthesizer/Makefile src/resynthesizer-gui/Makefile +src/resynthesizer-gettext/Makefile po/Makefile.in help/Makefile help/en/Makefile diff --git a/po/Makefile.in.in b/po/Makefile.in.in index fcd2c3b..bbe95e2 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -49,7 +49,7 @@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot +GENPOT = XGETTEXT_ARGS="--keyword=SG_ --keyword=G_" INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ diff --git a/po/POTFILES.in b/po/POTFILES.in index fc43d40..3a4928c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,14 +1,15 @@ # List of source files containing translatable strings. +src/resynthesizer-gettext/resynthesizer-gettext.c src/resynthesizer-gui/resynth-gui.c src/resynthesizer-gui/resynth-gui.h src/resynthesizer/resynthesizer.c -PluginScripts/plugin-heal-selection.py -PluginScripts/plugin-resynth-sharpen.py -PluginScripts/plugin-resynth-enlarge.py -PluginScripts/plugin-uncrop.py -PluginScripts/plugin-render-texture.py -PluginScripts/plugin-map-style.py -PluginScripts/plugin-heal-transparency.py -PluginScripts/plugin-resynth-fill-pattern.py +PluginScripts/plugin-heal-selection.scm +PluginScripts/plugin-resynth-sharpen.scm +PluginScripts/plugin-resynth-enlarge.scm +PluginScripts/plugin-uncrop.scm +PluginScripts/plugin-render-texture.scm +PluginScripts/plugin-map-style.scm +PluginScripts/plugin-heal-transparency.scm +PluginScripts/plugin-resynth-fill-pattern.scm diff --git a/src/Makefile.am b/src/Makefile.am index 1d33a56..efad2e8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = resynthesizer resynthesizer-gui +SUBDIRS = resynthesizer resynthesizer-gui resynthesizer-gettext diff --git a/src/resynthesizer-gettext/Makefile.am b/src/resynthesizer-gettext/Makefile.am new file mode 100644 index 0000000..459d196 --- /dev/null +++ b/src/resynthesizer-gettext/Makefile.am @@ -0,0 +1,20 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = resynthesizer_gettext + +bindir = $(GIMP_LIBDIR)/plug-ins + +resynthesizer_gettext_SOURCES = resynthesizer-gettext.c + +AM_CPPFLAGS = \ + -DLOCALEDIR=\""$(LOCALEDIR)"\" \ + -DDATADIR=\""$(DATADIR)"\" + +resynthesizer_gettext_CPPFLAGS =\ + -DLOCALEDIR=\""$(LOCALEDIR)"\" \ + -DDATADIR=\""$(DATADIR)"\" \ + -I$(top_srcdir) \ + @GIMP_CFLAGS@ \ + -I$(includedir) + +LDADD = $(GIMP_LIBS) diff --git a/src/resynthesizer-gettext/resynthesizer-gettext.c b/src/resynthesizer-gettext/resynthesizer-gettext.c new file mode 100644 index 0000000..6130c33 --- /dev/null +++ b/src/resynthesizer-gettext/resynthesizer-gettext.c @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2022 itr-tert + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include "config.h" // GNU buildtools local configuration +#include "../plugin-intl.h" // i18n macros + + +static void +query (void) +{ + static GimpParamDef args_def[] = { + {GIMP_PDB_STRING, "msgid", "message to translate"} + }; + + static GimpParamDef returns_def[] = { + // GIMP_PDB_STATUS is declared implicitly. + {GIMP_PDB_STRING, "msgstr", "translated message or untranslated msgid as is"} + }; + + gimp_install_procedure ( + "plug-in-resynthesizer-gettext", + "gettext for script-fu scripts of resynthersizer", + "", // long description + "itr-tert", + "copyright 2022 itr-tert", + "2022", + "menu label", + "*", + GIMP_PLUGIN, + G_N_ELEMENTS (args_def), G_N_ELEMENTS (returns_def), + args_def, returns_def); +} + + +static void +run (const gchar *name, + gint nparams, + const GimpParam *param, + gint *nreturn_vals, + GimpParam **return_vals) +{ + /* Initialize i18n support */ +#if defined(G_OS_WIN32) + bindtextdomain (GETTEXT_PACKAGE, gimp_locale_directory()); +#else + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); +#endif +#ifdef HAVE_BIND_TEXTDOMAIN_CODESET + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif + textdomain (GETTEXT_PACKAGE); + + static GimpParam values[2]; + *nreturn_vals = 2; + *return_vals = values; + + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = gettext(param[0].data.d_string); + + values[0].type = GIMP_PDB_STATUS; + values[0].data.d_status = GIMP_PDB_SUCCESS; +} + + +GimpPlugInInfo PLUG_IN_INFO = { + NULL, + NULL, + query, + run +}; + + +MAIN() From a76717b9fa5c7a95bf4db05d7ed5959551a12e4a Mon Sep 17 00:00:00 2001 From: itr tert Date: Sun, 23 Oct 2022 00:23:26 +0900 Subject: [PATCH 06/23] Update: Change scripts to use gettext. Update: Wrap each script in a closure. --- PluginScripts/plugin-heal-selection.scm | 63 ++++++++++--------- PluginScripts/plugin-heal-transparency.scm | 36 ++++++----- PluginScripts/plugin-map-style.scm | 48 ++++++++------ PluginScripts/plugin-render-texture.scm | 32 ++++++---- PluginScripts/plugin-resynth-enlarge.scm | 26 +++++--- PluginScripts/plugin-resynth-fill-pattern.scm | 31 +++++---- PluginScripts/plugin-resynth-sharpen.scm | 35 +++++++---- PluginScripts/plugin-uncrop.scm | 29 +++++---- 8 files changed, 182 insertions(+), 118 deletions(-) diff --git a/PluginScripts/plugin-heal-selection.scm b/PluginScripts/plugin-heal-selection.scm index a47c19a..eba5f7b 100644 --- a/PluginScripts/plugin-heal-selection.scm +++ b/PluginScripts/plugin-heal-selection.scm @@ -1,7 +1,7 @@ ;; Gimp plugin "Heal selection" ;; License: - +;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or @@ -15,18 +15,24 @@ ;; The GNU Public License is available at ;; http://www.gnu.org/copyleft/gpl.html -;; plugin-heal-selection.scm Copyright 2022 itr-tert +;; Copyright 2022 itr-tert ;; Based on plugin-heal-selection.py Copyright 2009 lloyd konneker (bootch at nc.rr.com) ;; Based on smart_remove.scm Copyright 2000 by Paul Harrison. -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-heal-selection (let +() ; indent keeper -(define (_ m) "stub" m) +(define debug #f) -(define (N_ m) "stub" m) -(define debug FALSE) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) (define-with-return (script-fu-heal-selection-test) @@ -48,7 +54,7 @@ (script-fu-heal-selection timg tdrawable samplingRadiusParam directionParam orderParam) "Create stencil selection in a temp image to pass as source (corpus) to plugin resynthesizer, - which does the substantive work." + which does the substantive work." (let ((targetBounds nil) (tempImage nil) @@ -75,7 +81,7 @@ (set! samplingRadiusParam (floor samplingRadiusParam)) (when (= TRUE (car (gimp-selection-is-empty timg))) - (gimp-message (_ "You must first select a region to heal.")) + (gimp-message (G_ "You must first select a region to heal.")) (return)) (gimp-image-undo-group-start timg) @@ -182,7 +188,7 @@ ;; Note that the old resynthesizer required an inverted selection !! - (when (= debug TRUE) + (when debug (catch "do nothing when error" (gimp-display-new tempImage) (gimp-displays-flush) @@ -210,7 +216,7 @@ ) ;; Clean up - (when (= debug FALSE) + (unless debug (gimp-image-delete tempImage)) (gimp-image-undo-group-end timg) )) @@ -219,26 +225,23 @@ ;; func name "script-fu-heal-selection" ;; menu label - "Heal selection(scm)..." + (SG_"_Heal selection(scm)...") ;; description (string-append - (N_ "Heal the selection from surroundings as if using the heal tool.") - "Requires separate resynthesizer plugin.") + (SG_"Heal the selection from surroundings as if using the heal tool.") + (SG_"Requires separate resynthesizer plugin.")) ;; author - "Lloyd Konneker <>" + "Lloyd KonnekerZ" ;; copyright notice "2009 Lloyd Konneker" ;; date created "2009" ;; image type that the script works on "RGB*, GRAY*" - ;; parameters SF-IMAGE "Image" 0 - SF-DRAWABLE "Drawable" 0 - - SF-ADJUSTMENT (_ "Context sampling width (pixels):") + SF-ADJUSTMENT (G_"Context sampling width (pixels)") (list 50 ; value 1 ; lower 10000 ; upper @@ -246,22 +249,20 @@ 10 ; page_inc 0 ; digits SF-SPINNER) ; type - - SF-OPTION (_ "Sample from:") (list - (_ "All around") - (_ "Sides") - (_ "Above and below")) - - SF-OPTION (_ "Filling order:") (list - (_ "Random") - (_ "Inwards towards center") - (_ "Outwards from center")) - ) + SF-OPTION (G_"Sample from") + (list (G_"All around") + (G_"Sides") + (G_"Above and below")) + SF-OPTION (G_"Filling order") + (list (G_"Random") + (G_"Inwards towards center") + (G_"Outwards from center"))) (script-fu-menu-register "script-fu-heal-selection" - "/Filters/Enhance") + "/Filters/Enhance") (script-fu-menu-register "script-fu-heal-selection" "/Filters/Resynthesizer(scm)/") -;; (script-fu-heal-selection-test) +script-fu-heal-selection +)) diff --git a/PluginScripts/plugin-heal-transparency.scm b/PluginScripts/plugin-heal-transparency.scm index 421cb1e..05d1dae 100644 --- a/PluginScripts/plugin-heal-transparency.scm +++ b/PluginScripts/plugin-heal-transparency.scm @@ -19,11 +19,17 @@ ;; Based on plugin-heal-transparency.py Copyright 2010 lloyd konneker (bootch at nc.rr.com) -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-heal-transparency (let +() ; indent keeper -(define (_ m) "stub" m) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) -(define (N_ m) "stub" m) (define-with-return (script-fu-heal-transparency @@ -31,7 +37,7 @@ (let ((org-selection nil)) ;; precondition should be enforced by Gimp according to image modes allowed. (when (= FALSE (car (gimp-drawable-has-alpha tdrawable))) - (gimp-message "The active layer has no alpha channel to heal.") + (gimp-message (G_"The active layer has no alpha channel to heal.")) (return)) (gimp-image-undo-group-start timg) @@ -70,11 +76,11 @@ ;; func name "script-fu-heal-transparency" ;; menu label - (N_ "Heal transparency(scm)...") + (SG_"_Heal transparency(scm)...") ;; description (string-append - (N_ "Removes alpha channel by synthesis. Fill outward for edges, inward for holes.") - (N_ "Requires separate resynthesizer plugin.")) + (SG_"Removes alpha channel by synthesis. Fill outward for edges, inward for holes.") + (SG_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -85,10 +91,8 @@ "RGBA, GRAYA" ; !!! Requires an alpha channel to heal ;; parameters SF-IMAGE "Image" 0 - SF-DRAWABLE "Drawable" 0 - - SF-ADJUSTMENT (_ "Context sampling width (pixels):") + SF-ADJUSTMENT (G_"Context sampling width (pixels)") (list 50 ; value 1 ; lower 10000 ; upper @@ -98,14 +102,16 @@ SF-SPINNER) ; type ;; 2 is the default in the original py. - SF-OPTION (_ "Filling order:") (list - (_ "Random") - (_ "Inwards towards center") - (_ "Outwards from center")) - ) + SF-OPTION (G_"Filling order") + (list (G_"Random") + (G_"Inwards towards center") + (G_"Outwards from center"))) (script-fu-menu-register "script-fu-heal-transparency" "/Filters/Enhance") (script-fu-menu-register "script-fu-heal-transparency" "/Filters/Resynthesizer(scm)/") + +script-fu-heal-transparency +)) diff --git a/PluginScripts/plugin-map-style.scm b/PluginScripts/plugin-map-style.scm index 5328cab..1fb2aa8 100644 --- a/PluginScripts/plugin-map-style.scm +++ b/PluginScripts/plugin-map-style.scm @@ -104,13 +104,19 @@ ;; contrast adjustment -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-map-style (let +() ; indent keeper -(define (_ m) "stub" m) +(define debug #f) ; #t if you want to display and retain working, temporary images -(define (N_ m) "stub" m) -(define debug #f) ; #t if you want to display and retain working, temporary images +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) (define (display-debug-image image) @@ -263,7 +269,7 @@ (map-weight nil) ) (when (= INDEXED original-source-base-type) - (gimp-message (_ "The style source cannot be of mode INDEXED")) + (gimp-message (G_"The style source cannot be of mode INDEXED")) (return)) (if (and (= image source-image) @@ -380,11 +386,12 @@ ;; func name "script-fu-map-style" ;; menu label - (N_ "Style(scm)...") + (SG_"_Style(scm)...") ;; description (string-append - (N_ "Transfer style (color and surface) from a chosen source to the active layer. ") - (N_ "Transforms image using art media and style from another image. Maps or synthesizes texture or theme from one image onto another. Requires separate resynthesizer plugin.")) + (SG_"Transfer style (color and surface) from a chosen source to the active layer. ") + (SG_"Transforms image using art media and style from another image. Maps or synthesizes texture or theme from one image onto another. ") + (SG_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker (bootch nc.rr.com)" ;; copyright notice @@ -396,19 +403,24 @@ ;; parameters SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 - SF-DRAWABLE (_ "Source of style:") -1 - SF-ADJUSTMENT (_ "Percent transfer:") (list 0 ; value - 10 ; lower - 90 ; upper - 10 ; step_inc - 20 ; page_inc - 3 ; digits - SF-SLIDER) - SF-OPTION (_ "Map by:") (list (_ "Color and brightness") - (_ "Brightness only"))) + SF-DRAWABLE (G_"Source of style") -1 + SF-ADJUSTMENT (G_"Percent transfer") + (list 0 ; value + 10 ; lower + 90 ; upper + 10 ; step_inc + 20 ; page_inc + 3 ; digits + SF-SLIDER) + SF-OPTION (G_"Map by") + (list (G_"Color and brightness") + (G_"Brightness only"))) (script-fu-menu-register "script-fu-map-style" "/Filters/Map") (script-fu-menu-register "script-fu-map-style" "/Filters/Resynthesizer(scm)/") + +script-fu-map-style +)) diff --git a/PluginScripts/plugin-render-texture.scm b/PluginScripts/plugin-render-texture.scm index d855b8c..6d86547 100644 --- a/PluginScripts/plugin-render-texture.scm +++ b/PluginScripts/plugin-render-texture.scm @@ -56,13 +56,19 @@ ;; -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-render-texture (let +() ; indent keeper -(define (_ m) "stub" m) +(define debug #f) -(define (N_ m) "stub" m) -(define debug FALSE) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) (define (test) @@ -157,7 +163,7 @@ (throw "Failed create layer.")) ;; If using new resynthesizer with animation for debugging - (when (= TRUE debug) + (when debug (display-image new-image)) ;; @@ -237,11 +243,12 @@ ;; func name "script-fu-render-texture" ;; menu label - (N_ "_Texture(scm)...") + (SG_"_Texture(scm)...") ;; description (string-append - "Create a new image with texture from the current image or selection. Optionally, create image edges suited for further, seamless tiling. " - "New image is the same scale but seamless and irregular. Use 'Map>Tile' for less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. Requires separate resynthesizer plugin.") + (SG_"Create a new image with texture from the current image or selection. Optionally, create image edges suited for further, seamless tiling. ") + (SG_"New image is the same scale but seamless and irregular. Use 'Map>Tile' for less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. ") + (SG_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -254,19 +261,22 @@ SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ;; Spinner is digital and linear, slider is analog but exponential - SF-ADJUSTMENT (_ "Ratio of size of new image to source selection") + SF-ADJUSTMENT (G_"Ratio of size of new image to source selection") (list 2 ; value 0.5 ; lower 10 ; upper 0.5 ; step_inc 1 ; page_inc SF-SPINNER) - SF-TOGGLE (_ "Make new image edges suitable for seamless tiling") FALSE + SF-TOGGLE (G_"Make new image edges suitable for seamless tiling") FALSE + ;; output: [(PF_IMAGE, "new_image", "New, synthesized texture.")] ) -;; output: [(PF_IMAGE, "new_image", "New, synthesized texture.")] (script-fu-menu-register "script-fu-render-texture" "/Filters/Render") (script-fu-menu-register "script-fu-render-texture" "/Filters/Resynthesizer(scm)/") + +script-fu-render-texture +)) \ No newline at end of file diff --git a/PluginScripts/plugin-resynth-enlarge.scm b/PluginScripts/plugin-resynth-enlarge.scm index 95578c7..85a2aec 100644 --- a/PluginScripts/plugin-resynth-enlarge.scm +++ b/PluginScripts/plugin-resynth-enlarge.scm @@ -16,16 +16,22 @@ ;; http://www.gnu.org/copyleft/gpl.html ;; Author: -;; itr-tert +;; 2022 itr-tert ;; Based on plugin-resynth-enlarge.py 2010 lloyd konneker ;; Based on smart_enlarge.scm 2000 by Paul Harrison. -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-enlarge-resynthesized (let +() ; indent keeper -(define (_ m) "stub" m) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) -(define (N_ m) "stub" m) (define-with-return (script-fu-enlarge-resynthesized image drawable scale-factor) @@ -95,15 +101,16 @@ (gimp-image-undo-group-end image) )) + (script-fu-register ;; func name "script-fu-enlarge-resynthesized" ;; menu label - (N_ "Enlarge & sharpen(scm)...") + (SG_"_Enlarge & sharpen(scm)...") ;; description (string-append - (N_ "Enlarge image and synthesize to sharpen.") - (N_ "Requires separate resynthesizer plugin")) + (SG_"Enlarge image and synthesize to sharpen.") + (SG_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -115,7 +122,7 @@ ;; parameters SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 - SF-ADJUSTMENT (_ "Scale by:") ; scale_factor + SF-ADJUSTMENT (G_"Scale by") ; scale_factor (list 2 ; value 1 ; lower 32 ; upper @@ -130,3 +137,6 @@ (script-fu-menu-register "script-fu-enlarge-resynthesized" "/Filters/Resynthesizer(scm)/") + +script-fu-enlarge-resynthesized +)) diff --git a/PluginScripts/plugin-resynth-fill-pattern.scm b/PluginScripts/plugin-resynth-fill-pattern.scm index f2ff710..5f6ab64 100644 --- a/PluginScripts/plugin-resynth-fill-pattern.scm +++ b/PluginScripts/plugin-resynth-fill-pattern.scm @@ -18,18 +18,24 @@ ;; Front end to the resynthesizer plugin to make a seamless fill. ;; Author: -;; itr-tert +;; 2022 itr-tert ;; Based on plugin-resynth-fill-pattern.py Copyright 2011 lloyd konneker ;; Idea by Rob Antonishen -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True); +(define script-fu-fill-pattern-resynth (let +() ; indent keeper -(define (_ m) "stub" m) +(define debug #f) -(define (N_ m) "stub" m) -(define debug FALSE) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) (define (layer-from-pattern image pattern) @@ -60,7 +66,7 @@ ;; Fill it with pattern (gimp-drawable-fill pattern-layer PATTERN-FILL) - (when (= debug TRUE) + (when debug (gimp-display-new pattern-image) (gimp-displays-flush)) @@ -73,7 +79,7 @@ 0 0 0 pattern-layer -1 -1 0 0.05 8 300) ;; Clean up - (when (= debug FALSE) + (unless debug ;; Delete image that is displayed throws RuntimeError (gimp-image-delete pattern-image)))) @@ -98,11 +104,11 @@ ;; func name "script-fu-fill-pattern-resynth" ;; menu label - (N_ "_Fill with pattern seamless(scm)...") + (SG_"_Fill with pattern seamless(scm)...") ;; description (string-append - (N_ "Seamlessly fill with a pattern using synthesis.") - (N_ "Requires separate resynthesizer plugin.")) + (G_"Seamlessly fill with a pattern using synthesis.") + (G_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -114,7 +120,7 @@ ;; parameters SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 - SF-PATTERN (_ "Pattern:") "Maple Leaves" + SF-PATTERN (G_"Pattern") "Maple Leaves" ) (script-fu-menu-register "script-fu-fill-pattern-resynth" @@ -122,3 +128,6 @@ (script-fu-menu-register "script-fu-fill-pattern-resynth" "/Filters/Resynthesizer(scm)/") + +script-fu-fill-pattern-resynth +)) diff --git a/PluginScripts/plugin-resynth-sharpen.scm b/PluginScripts/plugin-resynth-sharpen.scm index 2193adf..d8c2616 100644 --- a/PluginScripts/plugin-resynth-sharpen.scm +++ b/PluginScripts/plugin-resynth-sharpen.scm @@ -1,31 +1,37 @@ ;; Gimp plugin "Sharpen by resynthesis" -;; Requires resynthesizer plug_in (v2). ;; License: - +;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. - +;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. - +;; ;; The GNU Public License is available at ;; http://www.gnu.org/copyleft/gpl.html -;; Author: itr-tert +;; Author: +;; 2022 itr-tert ;; Based on plugin-resynth-sharpen.py 2010 lloyd konneker (bootch at nc.rr.com) ;; Based on smart_enlarge.scm 2000 by Paul Harrison. -;; gettext.install("resynthesizer", gimp.locale_directory, unicode=True) +(define script-fu-sharpen-resynthesized (let +() ; indent keeper -(define (_ m) "stub" m) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) -(define (N_ m) "stub" m) (define-with-return (script-fu-sharpen-resynthesized image drawable scale-factor) @@ -101,11 +107,11 @@ ;; func name "script-fu-sharpen-resynthesized" ;; menu label - (N_ "Sharpen by synthesis(scm)...") + (SG_"_Sharpen by synthesis(scm)...") ;; description (string-append - (N_ "Sharpen image by synthesis.") - (N_ "Requires separate resynthesizer plugin.")) + (SG_"Sharpen image by synthesis.") + (SG_"Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -117,7 +123,7 @@ ;; parameters SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 - SF-ADJUSTMENT (_ "Sharpening:") ; sharpen_factor + SF-ADJUSTMENT (G_"Sharpening") ; sharpen_factor (list 2 ; value 1 ; lower 32 ; upper @@ -131,4 +137,7 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-sharpen-resynthesized" - "/Filters/Resynthesizer(scm)/") \ No newline at end of file + "/Filters/Resynthesizer(scm)/") + +script-fu-sharpen-resynthesized +)) diff --git a/PluginScripts/plugin-uncrop.scm b/PluginScripts/plugin-uncrop.scm index 32a0727..02d1c4d 100644 --- a/PluginScripts/plugin-uncrop.scm +++ b/PluginScripts/plugin-uncrop.scm @@ -15,8 +15,6 @@ ;; The GNU Public License is available at ;; http://www.gnu.org/copyleft/gpl.html -;; Increase image/canvas size and synthesize outer band from edge of original. - ;; Author: ;; lloyd konneker, lkk, itr-tert @@ -25,6 +23,8 @@ ;; 1.1 lkk 2009-9-21 Translate to python. ;; later versions, see git log +;; Increase image/canvas size and synthesize outer band from edge of original. + ;; The effect for users: ;; widens the field of view, maintaining perspective of original ;; Should be undoable, except for loss of selection. @@ -34,12 +34,17 @@ ;; OUT larger layer and image. All other layers not enlarged. -;;gettext.install("resynthesizer", gimp.locale_directory, unicode=True) - +(define script-fu-uncrop (let +() ; indent keeper -(define (_ m) "stub" m) -(define (N_ m) "stub" m) +(define (gettext msgid) + (catch msgid + (car (plug-in-resynthesizer-gettext msgid)))) +(define (N_ m) m) ; like gettext-noop +(define (G_ m) (gettext m)) +(define (S_ m) (string-append m "​")) ; Add zero-width spaces to suppress translation. +(define (SG_ m) (S_ (G_ m))) (define-with-return (uncrop-test) @@ -158,7 +163,7 @@ (gimp-message-set-handler MESSAGE-BOX) (when (<> TRUE (car (gimp-item-is-layer drawable))) - (gimp-message (_ "A layer must be active, not a channel.")) + (gimp-message (G_"A layer must be active, not a channel.")) (return)) (gimp-image-undo-group-start orgImage) @@ -232,11 +237,11 @@ ;; func name "script-fu-uncrop" ;; menu label - (N_ "Uncrop(scm)...") + (SG_"_Uncrop(scm)...") ;; description (string-append - (N_ "Enlarge image by synthesizing a border that matches the edge, maintaining perspective. Works best for small enlargement of natural edges. Undo a Crop instead, if possible! ") - (N_ "Requires separate resynthesizer plugin.")) + (SG_ "Enlarge image by synthesizing a border that matches the edge, maintaining perspective. Works best for small enlargement of natural edges. Undo a Crop instead, if possible!") + (SG_ "Requires separate resynthesizer plugin.")) ;; author "Lloyd Konneker" ;; copyright notice @@ -248,7 +253,7 @@ ;; parameters SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 - SF-ADJUSTMENT (_ "Percent enlargement") + SF-ADJUSTMENT (G_"Percent enlargement") (list 10 ; value 0 ; lower 100 ; upper @@ -262,3 +267,5 @@ (script-fu-menu-register "script-fu-uncrop" "/Filters/Resynthesizer(scm)/") +script-fu-uncrop +)) \ No newline at end of file From f5f635d63f4a44b12470a72381cd0be311a3ae54 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sun, 23 Oct 2022 02:59:19 +0900 Subject: [PATCH 07/23] Minor Fix to translation format. --- po/es.po | 56 +++++++++++++++++++++------------ po/fr.po | 90 +++++++++++++++++++++++++++++++---------------------- po/pt_BR.po | 84 +++++++++++++++++++++++++++++-------------------- po/ru.po | 84 +++++++++++++++++++++++++++++-------------------- 4 files changed, 189 insertions(+), 125 deletions(-) diff --git a/po/es.po b/po/es.po index 1707e9f..4aac3fc 100644 --- a/po/es.po +++ b/po/es.po @@ -24,20 +24,24 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:157 msgid "Heal the selection from surroundings as if using the heal tool." -msgstr "Inventar seleccion como el tool" +msgstr "Inventar seleccion como el tool." + +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" #: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection..." -msgstr "Sintetiza seleccion..." +msgid "_Heal selection(scm)..." +msgstr "Sintetiza seleccion(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 -msgid "Context sampling width (pixels):" +msgid "Context sampling width (pixels)" msgstr "" #: PluginScripts/plugin-heal-selection.py:168 -msgid "Sample from:" -msgstr "Invento de:" +msgid "Sample from" +msgstr "Invento de" #: PluginScripts/plugin-heal-selection.py:168 msgid "All around" @@ -53,7 +57,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 -msgid "Filling order:" +msgid "Filling order" msgstr "" #: PluginScripts/plugin-heal-selection.py:169 @@ -78,7 +82,7 @@ msgid "" msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 -msgid "Heal transparency..." +msgid "_Heal transparency(scm)..." msgstr "" #: PluginScripts/plugin-map-style.py:281 @@ -90,20 +94,26 @@ msgid "" "Transfer style (color and surface) from a chosen source to the active layer. " msgstr "" +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + #: PluginScripts/plugin-map-style.py:381 -msgid "Style..." +msgid "_Style(scm)..." msgstr "" #: PluginScripts/plugin-map-style.py:386 -msgid "Source of style:" +msgid "Source of style" msgstr "" #: PluginScripts/plugin-map-style.py:387 -msgid "Percent transfer:" +msgid "Percent transfer" msgstr "" #: PluginScripts/plugin-map-style.py:388 -msgid "Map by:" +msgid "Map by" msgstr "" #: PluginScripts/plugin-map-style.py:388 @@ -120,8 +130,14 @@ msgid "" "Optionally, create image edges suited for further, seamless tiling. " msgstr "" +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + #: PluginScripts/plugin-render-texture.py:188 -msgid "_Texture..." +msgid "_Texture(scm)..." msgstr "" #: PluginScripts/plugin-render-texture.py:194 @@ -137,11 +153,11 @@ msgid "Enlarge image and synthesize to sharpen." msgstr "" #: PluginScripts/plugin-resynth-enlarge.py:97 -msgid "Enlarge & sharpen..." +msgid "_Enlarge & sharpen(scm)..." msgstr "" #: PluginScripts/plugin-resynth-enlarge.py:102 -msgid "Scale by:" +msgid "Scale by" msgstr "" #: PluginScripts/plugin-resynth-fill-pattern.py:100 @@ -149,11 +165,11 @@ msgid "Seamlessly fill with a pattern using synthesis." msgstr "" #: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless..." +msgid "_Fill with pattern seamless(scm)..." msgstr "" #: PluginScripts/plugin-resynth-fill-pattern.py:110 -msgid "Pattern:" +msgid "Pattern" msgstr "" #: PluginScripts/plugin-resynth-sharpen.py:94 @@ -162,11 +178,11 @@ msgstr "" #: PluginScripts/plugin-resynth-sharpen.py:99 #, fuzzy -msgid "Sharpen by synthesis..." +msgid "_Sharpen by synthesis(scm)..." msgstr "_Resintetiza..." #: PluginScripts/plugin-resynth-sharpen.py:103 -msgid "Sharpening:" +msgid "Sharpening" msgstr "" #: PluginScripts/plugin-uncrop.py:86 @@ -181,7 +197,7 @@ msgid "" msgstr "" #: PluginScripts/plugin-uncrop.py:147 -msgid "Uncrop..." +msgid "_Uncrop(scm)..." msgstr "" #: PluginScripts/plugin-uncrop.py:152 diff --git a/po/fr.po b/po/fr.po index 8393122..1f50d62 100644 --- a/po/fr.po +++ b/po/fr.po @@ -26,18 +26,22 @@ msgstr "" "Corriger la sélection à partir des environs comme si vous utilisiez l'outil " "Correcteur." +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" + #: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection..." -msgstr "_Corriger la sélection..." +msgid "_Heal selection(scm)..." +msgstr "Corriger la sélection(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 -msgid "Context sampling width (pixels):" -msgstr "Largeur d'échantillonnage du contexte (pixels) :" +msgid "Context sampling width (pixels)" +msgstr "Largeur d'échantillonnage du contexte (pixels)" #: PluginScripts/plugin-heal-selection.py:168 -msgid "Sample from:" -msgstr "Échantillon :" +msgid "Sample from" +msgstr "Échantillon" #: PluginScripts/plugin-heal-selection.py:168 msgid "All around" @@ -53,8 +57,8 @@ msgstr "Au-dessus et au-dessous" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 -msgid "Filling order:" -msgstr "Ordre de remplissage :" +msgid "Filling order" +msgstr "Ordre de remplissage" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 @@ -80,8 +84,8 @@ msgstr "" "bords, vers l'intérieur pour les trous." #: PluginScripts/plugin-heal-transparency.py:77 -msgid "Heal transparency..." -msgstr "Corriger la transparence..." +msgid "_Heal transparency(scm)..." +msgstr "Corriger la transparence(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -94,21 +98,27 @@ msgstr "" "Transférer le style (couleur et surface) d'une source choisie vers le calque " "actif." +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + #: PluginScripts/plugin-map-style.py:381 -msgid "Style..." -msgstr "Style..." +msgid "_Style(scm)..." +msgstr "Style(scm)..." #: PluginScripts/plugin-map-style.py:386 -msgid "Source of style:" -msgstr "Source de style :" +msgid "Source of style" +msgstr "Source de style" #: PluginScripts/plugin-map-style.py:387 -msgid "Percent transfer:" -msgstr "Pourcentage de transfert :" +msgid "Percent transfer" +msgstr "Pourcentage de transfert" #: PluginScripts/plugin-map-style.py:388 -msgid "Map by:" -msgstr "Correspondance :" +msgid "Map by" +msgstr "Correspondance" #: PluginScripts/plugin-map-style.py:388 msgid "Color and brightness" @@ -126,53 +136,59 @@ msgstr "" "Créer une nouvelle image avec une texture à partir de l'image ou de la " "sélection actuelle. Vous pouvez aussi créer des bords d’image raccordables." +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + #: PluginScripts/plugin-render-texture.py:188 -msgid "_Texture..." -msgstr "_Texture..." +msgid "_Texture(scm)..." +msgstr "Texture(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" -msgstr "Rapport de taille de la nouvelle image à la sélection source :" +msgstr "Rapport de taille de la nouvelle image à la sélection source" #: PluginScripts/plugin-render-texture.py:195 msgid "Make new image edges suitable for seamless tiling" -msgstr "Faire de nouvelles bordures d'image raccordables :" +msgstr "Faire de nouvelles bordures d'image raccordables" #: PluginScripts/plugin-resynth-enlarge.py:92 msgid "Enlarge image and synthesize to sharpen." msgstr "Agrandir l'image et synthétiser pour augmenter la netteté." #: PluginScripts/plugin-resynth-enlarge.py:97 -msgid "Enlarge & sharpen..." -msgstr "Agrandir et augmenter la netteté..." +msgid "_Enlarge & sharpen(scm)..." +msgstr "Agrandir et augmenter la netteté(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 -msgid "Scale by:" -msgstr "Mise à l'échelle :" +msgid "Scale by" +msgstr "Mise à l'échelle" #: PluginScripts/plugin-resynth-fill-pattern.py:100 msgid "Seamlessly fill with a pattern using synthesis." msgstr "Remplir avec un motif raccordable en utilisant la synthèse." #: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless..." -msgstr "_Remplir avec un motif raccordable..." +msgid "_Fill with pattern seamless(scm)..." +msgstr "Remplir avec un motif raccordable(scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 -msgid "Pattern:" -msgstr "Motif :" +msgid "Pattern" +msgstr "Motif" #: PluginScripts/plugin-resynth-sharpen.py:94 msgid "Sharpen image by synthesis." msgstr "Augmenter la netteté de l'image par synthèse." #: PluginScripts/plugin-resynth-sharpen.py:99 -msgid "Sharpen by synthesis..." -msgstr "Augmenter la netteté par synthèse..." +msgid "_Sharpen by synthesis(scm)..." +msgstr "Augmenter la netteté par synthèse(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 -msgid "Sharpening:" -msgstr "Augmentation de la netteté :" +msgid "Sharpening" +msgstr "Augmentation de la netteté" #: PluginScripts/plugin-uncrop.py:86 msgid "A layer must be active, not a channel." @@ -189,12 +205,12 @@ msgstr "" "bords naturels. Annuler le rognage à la place, si possible!" #: PluginScripts/plugin-uncrop.py:147 -msgid "Uncrop..." -msgstr "Dérogner..." +msgid "_Uncrop(scm)..." +msgstr "Dérogner(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" -msgstr "Pourcentage d'agrandissement : " +msgstr "Pourcentage d'agrandissement" #: src/resynthesizer-gui/resynth-gui.c:156 msgid "Make tiles, apply themes, render texture, remove features, etc." diff --git a/po/pt_BR.po b/po/pt_BR.po index ced7d71..7a9b46c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -27,17 +27,21 @@ msgid "Heal the selection from surroundings as if using the heal tool." msgstr "" "Restaurar a seleção dos arredores como se estivesse usando a ferramenta de restauração." +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" + #: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection..." -msgstr "_Restaurar seleção..." +msgid "_Heal selection(scm)..." +msgstr "Restaurar seleção(scm)..." #: PluginScripts/plugin-heal-selection.py:167 PluginScripts/plugin-heal-transparency.py:82 -msgid "Context sampling width (pixels):" -msgstr "Largura de amostragem do contexto (pixels):" +msgid "Context sampling width (pixels)" +msgstr "Largura de amostragem do contexto (pixels)" #: PluginScripts/plugin-heal-selection.py:168 -msgid "Sample from:" -msgstr "Amostra de:" +msgid "Sample from" +msgstr "Amostra de" #: PluginScripts/plugin-heal-selection.py:168 msgid "All around" @@ -52,8 +56,8 @@ msgid "Above and below" msgstr "Acima e abaixo" #: PluginScripts/plugin-heal-selection.py:169 PluginScripts/plugin-heal-transparency.py:83 -msgid "Filling order:" -msgstr "Pedido de preenchimento:" +msgid "Filling order" +msgstr "Pedido de preenchimento" #: PluginScripts/plugin-heal-selection.py:169 PluginScripts/plugin-heal-transparency.py:83 msgid "Random" @@ -74,8 +78,8 @@ msgstr "" "furos." #: PluginScripts/plugin-heal-transparency.py:77 -msgid "Heal transparency..." -msgstr "Restaurar transparência..." +msgid "_Heal transparency(scm)..." +msgstr "Restaurar transparência(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -85,21 +89,27 @@ msgstr "A fonte do estilo não pode ser do modo INDEXED" msgid "Transfer style (color and surface) from a chosen source to the active layer. " msgstr "Transfira o estilo (cor e superfície) de uma fonte escolhida para a camada ativa. " +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + #: PluginScripts/plugin-map-style.py:381 -msgid "Style..." -msgstr "Estilo..." +msgid "_Style(scm)..." +msgstr "Estilo(scm)..." #: PluginScripts/plugin-map-style.py:386 -msgid "Source of style:" -msgstr "Fonte do estilo:" +msgid "Source of style" +msgstr "Fonte do estilo" #: PluginScripts/plugin-map-style.py:387 -msgid "Percent transfer:" -msgstr "Transferência percentual:" +msgid "Percent transfer" +msgstr "Transferência percentual" #: PluginScripts/plugin-map-style.py:388 -msgid "Map by:" -msgstr "Mapear por:" +msgid "Map by" +msgstr "Mapear por" #: PluginScripts/plugin-map-style.py:388 msgid "Color and brightness" @@ -117,9 +127,15 @@ msgstr "" "Crie uma nova imagem com textura da imagem ou seleção atual.Opcionalmente, crie bordas de " "imagem adequadas para ladrilhos contínuos. " +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + #: PluginScripts/plugin-render-texture.py:188 -msgid "_Texture..." -msgstr "_Textura..." +msgid "_Texture(scm)..." +msgstr "Textura(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -134,36 +150,36 @@ msgid "Enlarge image and synthesize to sharpen." msgstr "Amplie a imagem e sintetize para torná-la mais nítida." #: PluginScripts/plugin-resynth-enlarge.py:97 -msgid "Enlarge & sharpen..." -msgstr "Ampliação & nitidez..." +msgid "_Enlarge & sharpen(scm)..." +msgstr "Ampliação & nitidez(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 -msgid "Scale by:" -msgstr "Escalar por:" +msgid "Scale by" +msgstr "Escalar por" #: PluginScripts/plugin-resynth-fill-pattern.py:100 msgid "Seamlessly fill with a pattern using synthesis." msgstr "Preencha perfeitamente com um padrão usando síntese." #: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless..." -msgstr "_Preencher com padrão sem emenda..." +msgid "_Fill with pattern seamless(scm)..." +msgstr "_Preencher com padrão sem emenda(scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 -msgid "Pattern:" -msgstr "Padrão:" +msgid "Pattern" +msgstr "Padrão" #: PluginScripts/plugin-resynth-sharpen.py:94 msgid "Sharpen image by synthesis." msgstr "Aumentar a nitidez da imagem por síntese." #: PluginScripts/plugin-resynth-sharpen.py:99 -msgid "Sharpen by synthesis..." -msgstr "Nitidez por síntese..." +msgid "_Sharpen by synthesis(scm)..." +msgstr "Nitidez por síntese(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 -msgid "Sharpening:" -msgstr "Nitidez:" +msgid "Sharpening" +msgstr "Nitidez" #: PluginScripts/plugin-uncrop.py:86 msgid "A layer must be active, not a channel." @@ -179,8 +195,8 @@ msgstr "" "disso, se possível! " #: PluginScripts/plugin-uncrop.py:147 -msgid "Uncrop..." -msgstr "Retirar do corte..." +msgid "_Uncrop(scm)..." +msgstr "Retirar do corte(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/ru.po b/po/ru.po index 0cb4872..6ea28ea 100644 --- a/po/ru.po +++ b/po/ru.po @@ -29,18 +29,22 @@ msgstr "Необходимо предварительно выбрать вос msgid "Heal the selection from surroundings as if using the heal tool." msgstr "Восстановление области замещением пикселами из окружения" +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" + #: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection..." -msgstr "_Восстановить выделение…" +msgid "_Heal selection(scm)..." +msgstr "Восстановить выделение(scm)…" #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 -msgid "Context sampling width (pixels):" -msgstr "Ширина области заимствования (px):" +msgid "Context sampling width (pixels)" +msgstr "Ширина области заимствования (px)" #: PluginScripts/plugin-heal-selection.py:168 -msgid "Sample from:" -msgstr "Источник данных:" +msgid "Sample from" +msgstr "Источник данных" #: PluginScripts/plugin-heal-selection.py:168 msgid "All around" @@ -56,8 +60,8 @@ msgstr "Верх и низ" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 -msgid "Filling order:" -msgstr "Порядок заполнения:" +msgid "Filling order" +msgstr "Порядок заполнения" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 @@ -83,8 +87,8 @@ msgstr "" "предназначено для краёв, вовнутрь — для дыр." #: PluginScripts/plugin-heal-transparency.py:77 -msgid "Heal transparency..." -msgstr "Восстановить прозрачную область…" +msgid "_Heal transparency(scm)..." +msgstr "Восстановить прозрачную область(scm)…" #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -97,21 +101,27 @@ msgstr "" "Перенести стиль (цвет и поверхность) из выбранного источника на активный " "слой." +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + #: PluginScripts/plugin-map-style.py:381 -msgid "Style..." -msgstr "Стиль…" +msgid "_Style(scm)..." +msgstr "Стиль(scm)…" #: PluginScripts/plugin-map-style.py:386 -msgid "Source of style:" -msgstr "Источник стиля:" +msgid "Source of style" +msgstr "Источник стиля" #: PluginScripts/plugin-map-style.py:387 -msgid "Percent transfer:" -msgstr "Процент переноса:" +msgid "Percent transfer" +msgstr "Процент переноса" #: PluginScripts/plugin-map-style.py:388 -msgid "Map by:" -msgstr "Компоненты переноса:" +msgid "Map by" +msgstr "Компоненты переноса" #: PluginScripts/plugin-map-style.py:388 msgid "Color and brightness" @@ -130,9 +140,15 @@ msgstr "" "По выбору пользователя содержимое может быть сделано пригодным для создания " "бесшовной мозаики." +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + #: PluginScripts/plugin-render-texture.py:188 -msgid "_Texture..." -msgstr "_Текстура…" +msgid "_Texture(scm)..." +msgstr "Текстура(scm)…" #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -147,36 +163,36 @@ msgid "Enlarge image and synthesize to sharpen." msgstr "Увеличить изображения и повысить резкость синтезом." #: PluginScripts/plugin-resynth-enlarge.py:97 -msgid "Enlarge & sharpen..." -msgstr "Увеличить размер и резкость…" +msgid "_Enlarge & sharpen(scm)..." +msgstr "Увеличить размер и резкость(scm)…" #: PluginScripts/plugin-resynth-enlarge.py:102 -msgid "Scale by:" -msgstr "Множитель:" +msgid "Scale by" +msgstr "Множитель" #: PluginScripts/plugin-resynth-fill-pattern.py:100 msgid "Seamlessly fill with a pattern using synthesis." msgstr "Залить текстурой без видимых швов с помощью синтеза." #: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless..." -msgstr "Залить _бесшовной текстурой…" +msgid "_Fill with pattern seamless(scm)..." +msgstr "Залить _бесшовной текстурой(scm)…" #: PluginScripts/plugin-resynth-fill-pattern.py:110 -msgid "Pattern:" -msgstr "Текстура:" +msgid "Pattern" +msgstr "Текстура" #: PluginScripts/plugin-resynth-sharpen.py:94 msgid "Sharpen image by synthesis." msgstr "Увеличить резкость изображения." #: PluginScripts/plugin-resynth-sharpen.py:99 -msgid "Sharpen by synthesis..." -msgstr "Увеличить резкость синтезом…" +msgid "_Sharpen by synthesis(scm)..." +msgstr "Увеличить резкость синтезом(scm)…" #: PluginScripts/plugin-resynth-sharpen.py:103 -msgid "Sharpening:" -msgstr "Увеличение резкости:" +msgid "Sharpening" +msgstr "Увеличение резкости" #: PluginScripts/plugin-uncrop.py:86 msgid "A layer must be active, not a channel." @@ -193,8 +209,8 @@ msgstr "" "краёв." #: PluginScripts/plugin-uncrop.py:147 -msgid "Uncrop..." -msgstr "Обратное кадрирование…" +msgid "_Uncrop(scm)..." +msgstr "Обратное кадрирование(scm)…" #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" From c2fedafde4b030d2e9a0fc45a74e526aea8f5fe5 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sun, 23 Oct 2022 03:03:47 +0900 Subject: [PATCH 08/23] Add Japanese translation file(template as is) --- configure.ac | 2 +- po/POTFILES.in | 19 ++- po/ja.po | 404 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 414 insertions(+), 11 deletions(-) create mode 100644 po/ja.po diff --git a/configure.ac b/configure.ac index bfc8125..6006817 100644 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain.]) dnl Add the languages which your application supports here. -ALL_LINGUAS="es fr ru" +ALL_LINGUAS="es fr ru pt_BR ja" AC_PROG_INTLTOOL AM_GLIB_GNU_GETTEXT diff --git a/po/POTFILES.in b/po/POTFILES.in index 3a4928c..09dc1e0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,15 +1,14 @@ # List of source files containing translatable strings. -src/resynthesizer-gettext/resynthesizer-gettext.c -src/resynthesizer-gui/resynth-gui.c -src/resynthesizer-gui/resynth-gui.h -src/resynthesizer/resynthesizer.c PluginScripts/plugin-heal-selection.scm -PluginScripts/plugin-resynth-sharpen.scm -PluginScripts/plugin-resynth-enlarge.scm -PluginScripts/plugin-uncrop.scm -PluginScripts/plugin-render-texture.scm -PluginScripts/plugin-map-style.scm PluginScripts/plugin-heal-transparency.scm +PluginScripts/plugin-map-style.scm +PluginScripts/plugin-render-texture.scm +PluginScripts/plugin-resynth-enlarge.scm PluginScripts/plugin-resynth-fill-pattern.scm - +PluginScripts/plugin-resynth-sharpen.scm +PluginScripts/plugin-uncrop.scm +src/resynthesizer-gui/resynth-gui.c +src/resynthesizer-gui/resynth-gui.h +src/resynthesizer/resynthesizer.c +src/resynthesizer-gettext/resynthesizer-gettext.c diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..768308d --- /dev/null +++ b/po/ja.po @@ -0,0 +1,404 @@ +# Japanese translation of Resynthesizer plug-in for GIMP +# Copyright (C) 2022 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# itr-tert , 2022. +# +msgid "" +msgstr "" +"POT-Creation-Date: 2022-10-23 02:00+0900\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: PluginScripts/plugin-heal-selection.scm:84 +msgid "You must first select a region to heal." +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:228 +msgid "_Heal selection(scm)..." +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:231 +msgid "Heal the selection from surroundings as if using the heal tool." +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:232 +#: PluginScripts/plugin-heal-transparency.scm:83 +#: PluginScripts/plugin-map-style.scm:394 +#: PluginScripts/plugin-render-texture.scm:251 +#: PluginScripts/plugin-resynth-enlarge.scm:113 +#: PluginScripts/plugin-resynth-fill-pattern.scm:111 +#: PluginScripts/plugin-resynth-sharpen.scm:114 +#: PluginScripts/plugin-uncrop.scm:244 +msgid "Requires separate resynthesizer plugin." +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:244 +#: PluginScripts/plugin-heal-transparency.scm:95 +msgid "Context sampling width (pixels)" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:252 +msgid "Sample from" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:253 +msgid "All around" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:254 +msgid "Sides" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:255 +msgid "Above and below" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:256 +#: PluginScripts/plugin-heal-transparency.scm:105 +msgid "Filling order" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:257 +#: PluginScripts/plugin-heal-transparency.scm:106 +msgid "Random" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:258 +#: PluginScripts/plugin-heal-transparency.scm:107 +msgid "Inwards towards center" +msgstr "" + +#: PluginScripts/plugin-heal-selection.scm:259 +#: PluginScripts/plugin-heal-transparency.scm:108 +msgid "Outwards from center" +msgstr "" + +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" + +#: PluginScripts/plugin-heal-transparency.scm:79 +msgid "_Heal transparency(scm)..." +msgstr "" + +#: PluginScripts/plugin-heal-transparency.scm:82 +msgid "" +"Removes alpha channel by synthesis. Fill outward for edges, inward for " +"holes." +msgstr "" + +#: PluginScripts/plugin-map-style.scm:272 +msgid "The style source cannot be of mode INDEXED" +msgstr "" + +#: PluginScripts/plugin-map-style.scm:389 +msgid "_Style(scm)..." +msgstr "" + +#: PluginScripts/plugin-map-style.scm:392 +msgid "" +"Transfer style (color and surface) from a chosen source to the active layer. " +msgstr "" + +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + +#: PluginScripts/plugin-map-style.scm:406 +msgid "Source of style" +msgstr "" + +#: PluginScripts/plugin-map-style.scm:407 +msgid "Percent transfer" +msgstr "" + +#: PluginScripts/plugin-map-style.scm:415 +msgid "Map by" +msgstr "" + +#: PluginScripts/plugin-map-style.scm:416 +msgid "Color and brightness" +msgstr "" + +#: PluginScripts/plugin-map-style.scm:417 +msgid "Brightness only" +msgstr "" + +#: PluginScripts/plugin-render-texture.scm:246 +msgid "_Texture(scm)..." +msgstr "" + +#: PluginScripts/plugin-render-texture.scm:249 +msgid "" +"Create a new image with texture from the current image or selection. " +"Optionally, create image edges suited for further, seamless tiling. " +msgstr "" + +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + +#: PluginScripts/plugin-render-texture.scm:264 +msgid "Ratio of size of new image to source selection" +msgstr "" + +#: PluginScripts/plugin-render-texture.scm:271 +msgid "Make new image edges suitable for seamless tiling" +msgstr "" + +#: PluginScripts/plugin-resynth-enlarge.scm:109 +msgid "_Enlarge & sharpen(scm)..." +msgstr "" + +#: PluginScripts/plugin-resynth-enlarge.scm:112 +msgid "Enlarge image and synthesize to sharpen." +msgstr "" + +#: PluginScripts/plugin-resynth-enlarge.scm:125 +msgid "Scale by" +msgstr "" + +#: PluginScripts/plugin-resynth-fill-pattern.scm:107 +msgid "_Fill with pattern seamless(scm)..." +msgstr "" + +#: PluginScripts/plugin-resynth-fill-pattern.scm:110 +msgid "Seamlessly fill with a pattern using synthesis." +msgstr "" + +#: PluginScripts/plugin-resynth-fill-pattern.scm:123 +msgid "Pattern" +msgstr "" + +#: PluginScripts/plugin-resynth-sharpen.scm:110 +msgid "_Sharpen by synthesis(scm)..." +msgstr "" + +#: PluginScripts/plugin-resynth-sharpen.scm:113 +msgid "Sharpen image by synthesis." +msgstr "" + +#: PluginScripts/plugin-resynth-sharpen.scm:126 +msgid "Sharpening" +msgstr "" + +#: PluginScripts/plugin-uncrop.scm:166 +msgid "A layer must be active, not a channel." +msgstr "" + +#: PluginScripts/plugin-uncrop.scm:240 +msgid "_Uncrop(scm)..." +msgstr "" + +#: PluginScripts/plugin-uncrop.scm:243 +msgid "" +"Enlarge image by synthesizing a border that matches the edge, maintaining " +"perspective. Works best for small enlargement of natural edges. Undo a Crop " +"instead, if possible!" +msgstr "" + +#: PluginScripts/plugin-uncrop.scm:256 +msgid "Percent enlargement" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.c:156 +msgid "Make tiles, apply themes, render texture, remove features, etc." +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.c:161 +msgid "_Resynthesize..." +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:115 +msgid "Context: " +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:123 +msgid "Random order, without context" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:124 +msgid "Random order, with context" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:125 +msgid "Randomized bands, concentric, inwards" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:126 +msgid "" +"Randomized bands, horizontally, inwards (i.e. squeezing from top and bottom)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:127 +msgid "" +"Randomized bands, vertically, inwards (i.e. squeezing from left and right)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:128 +msgid "Randomized bands, concentric, outwards (e.g. for uncrop)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:129 +msgid "" +"Randomized bands, horizontally, outwards, (i.e. expanding to top and bottom)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:130 +msgid "" +"Randomized bands, vertically, outwards (i.e. expanding to left and right)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:131 +msgid "" +"Randomized bands, concentric, inwards and outwards (i.e. squeezing in and " +"out a donut)" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:228 +msgid "Resynthesize" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:240 +msgid "_OK" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:247 +msgid "_Cancel" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:260 +msgid "Options" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:264 +msgid "Tweaks" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:268 +msgid "Input" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:274 +msgid "Texture source: " +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:278 +msgid "Output" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:286 +msgid "Make horizontally tileable" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:290 +msgid "Make vertically tileable" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:297 +msgid "Texture transfer" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:306 +msgid "Use texture transfer" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:312 +msgid "Input map: " +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:317 +msgid "Output map: " +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:322 +msgid "Map importance:" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:329 +msgid "" +"Resynthesizer operates by copying pixels, one at a time, from the input to " +"the output. A neighbourhood of nearby pixels in the output are compared with " +"neighbourhoods of pixels in the input. The pixel at the center of the best " +"matching neighbourhood is copied to the output.\n" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:331 +msgid "Neighbourhood size:" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:334 +msgid "- How many nearby pixels in the output are to be used?\n" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:336 +msgid "Search thoroughness:" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:339 +msgid "- How many locations in the input are examined?\n" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:341 +msgid "Sensitivity to outliers:" +msgstr "" + +#: src/resynthesizer-gui/resynth-gui.h:344 +msgid "" +"- To what extent does a very bad match on a single pixel disqualify a " +"location?\n" +msgstr "" + +#: src/resynthesizer/resynthesizer.c:350 +msgid "Incompatible image mode." +msgstr "" + +#: src/resynthesizer/resynthesizer.c:373 +msgid "Resynthesizer failed to get parameters." +msgstr "" + +#: src/resynthesizer/resynthesizer.c:388 +msgid "" +"The input texture and output image must have the same number of color " +"channels." +msgstr "" + +#: src/resynthesizer/resynthesizer.c:407 +msgid "The input and output maps must have the same mode" +msgstr "" + +#: src/resynthesizer/resynthesizer.c:412 +msgid "The input map should be the same size as the input texture image" +msgstr "" + +#: src/resynthesizer/resynthesizer.c:417 +msgid "The output map should be the same size as the output image" +msgstr "" + +#: src/resynthesizer/resynthesizer.c:503 +msgid "synthesizing..." +msgstr "" + +#: src/resynthesizer/resynthesizer.c:517 +msgid "" +"The texture source is empty. Does any selection include non-transparent " +"pixels?" +msgstr "" + +#: src/resynthesizer/resynthesizer.c:521 +msgid "" +"The output layer is empty. Does any selection have visible pixels in the " +"active layer?" +msgstr "" From 4cc199251399a0f8a3787e9f9c390a1f587c7186 Mon Sep 17 00:00:00 2001 From: itr tert Date: Mon, 24 Oct 2022 00:52:02 +0900 Subject: [PATCH 09/23] Add a linker option for WindowsOS. Change scripts and plugins install directory. Change linker parameter order. Update .gitignore. --- .gitignore | 4 ++++ PluginScripts/Makefile.am | 2 +- configure.ac | 14 +++++++++++--- src/resynthesizer-gettext/Makefile.am | 2 +- src/resynthesizer-gui/Makefile.am | 2 +- src/resynthesizer/Makefile.am | 6 +++--- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 436af2f..c6c0e31 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ # Ignore object files *.o +*.a +*.exe # Ignore *.Po @@ -39,6 +41,8 @@ /compile /config.h /config.h.in +/config.guess +/config.sub /config.status /configure /depcomp diff --git a/PluginScripts/Makefile.am b/PluginScripts/Makefile.am index 4af792f..f10dac9 100644 --- a/PluginScripts/Makefile.am +++ b/PluginScripts/Makefile.am @@ -4,7 +4,7 @@ ## pluginexecdir tells autotools where to install scripts ## scripts tells autotools the list of installable Python language scripts -pluginexecdir = $(gimpplugindir)/scripts +pluginexecdir = $(gimpplugindir)/scripts/resynthesizer/ scripts = \ plugin-heal-selection.scm \ diff --git a/configure.ac b/configure.ac index 6006817..c51a10d 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,8 @@ dnl lkk This macro only confirms that the given file is in configure's notion of AC_CONFIG_SRCDIR([src/resynthesizer/resynthesizer.c]) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(no-define) +dnl AM_INIT_AUTOMAKE(no-define) +AM_INIT_AUTOMAKE([foreign]) AC_ISC_POSIX AC_PROG_CC @@ -63,8 +64,8 @@ PKG_CHECK_MODULES(GIMP, AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) -GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0` -AC_SUBST(GIMP_LIBDIR) +dnl GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0` +dnl AC_SUBST(GIMP_LIBDIR) dnl i18n stuff @@ -144,4 +145,11 @@ help/images/Makefile PluginScripts/Makefile ]) +AC_CANONICAL_HOST +case $host_os in + dnl WindowsOS + *cygwin* | *mingw* ) + LDFLAGS="$LDFLAGS -mwindows" +esac + AC_OUTPUT diff --git a/src/resynthesizer-gettext/Makefile.am b/src/resynthesizer-gettext/Makefile.am index 459d196..0ca4bd6 100644 --- a/src/resynthesizer-gettext/Makefile.am +++ b/src/resynthesizer-gettext/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer_gettext -bindir = $(GIMP_LIBDIR)/plug-ins +bindir = $(gimpplugindir)/plug-ins resynthesizer_gettext_SOURCES = resynthesizer-gettext.c diff --git a/src/resynthesizer-gui/Makefile.am b/src/resynthesizer-gui/Makefile.am index 98811e0..9b2c981 100644 --- a/src/resynthesizer-gui/Makefile.am +++ b/src/resynthesizer-gui/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer_gui -bindir = $(GIMP_LIBDIR)/plug-ins +bindir = $(gimpplugindir)/plug-ins # resynthesizer_gui is plugin that calls resynthesizer plugin resynthesizer_gui_SOURCES = resynth-gui.c diff --git a/src/resynthesizer/Makefile.am b/src/resynthesizer/Makefile.am index 0a90311..46aa96e 100644 --- a/src/resynthesizer/Makefile.am +++ b/src/resynthesizer/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer -bindir = $(GIMP_LIBDIR)/plug-ins +bindir = $(gimpplugindir)/plug-ins # resynthesizer is a GIMP plugin calling libresynthesizer resynthesizer_SOURCES = resynthesizer.c @@ -10,7 +10,7 @@ resynthesizer_SOURCES = resynthesizer.c # lkk Note glibProxy.c not needed for resynthesizer for GIMP # but IS needed when using GIMP as a test harness to the standalone engine - + # These are for the resynthesizer plugin adaption to engine # resynth-pdb.h @@ -29,7 +29,7 @@ resynthesizer_CPPFLAGS =\ # resynthesizer GIMP plugin calls GIMP lib and convenience library (i.e. local) libresynthesizer # libresynthesizer in turn depends on math and gthread-2.0 -LDADD = $(GIMP_LIBS) ../../lib/libresynthesizer.a -lm -lgthread-2.0 +LDADD = ../../lib/libresynthesizer.a $(GIMP_LIBS) -lm -lgthread-2.0 From 85fecd8a0e44af01092d9a70ec835feb9420ee7a Mon Sep 17 00:00:00 2001 From: itr tert Date: Mon, 24 Oct 2022 00:58:36 +0900 Subject: [PATCH 10/23] Add Japanese translation. --- po/ja.po | 180 +++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/po/ja.po b/po/ja.po index 768308d..dd4249e 100644 --- a/po/ja.po +++ b/po/ja.po @@ -13,15 +13,15 @@ msgstr "" #: PluginScripts/plugin-heal-selection.scm:84 msgid "You must first select a region to heal." -msgstr "" +msgstr "修復する範囲を選択してください。" #: PluginScripts/plugin-heal-selection.scm:228 msgid "_Heal selection(scm)..." -msgstr "" +msgstr "選択範囲を修復(scm)..." #: PluginScripts/plugin-heal-selection.scm:231 msgid "Heal the selection from surroundings as if using the heal tool." -msgstr "" +msgstr "修復ブラシのように周囲の特徴で選択範囲を修復します。" #: PluginScripts/plugin-heal-selection.scm:232 #: PluginScripts/plugin-heal-transparency.scm:83 @@ -32,240 +32,238 @@ msgstr "" #: PluginScripts/plugin-resynth-sharpen.scm:114 #: PluginScripts/plugin-uncrop.scm:244 msgid "Requires separate resynthesizer plugin." -msgstr "" +msgstr "resynthesizer plugin 本体が必要です。" #: PluginScripts/plugin-heal-selection.scm:244 #: PluginScripts/plugin-heal-transparency.scm:95 msgid "Context sampling width (pixels)" -msgstr "" +msgstr "特徴抽出範囲(px)" #: PluginScripts/plugin-heal-selection.scm:252 msgid "Sample from" -msgstr "" +msgstr "特徴抽出を" #: PluginScripts/plugin-heal-selection.scm:253 msgid "All around" -msgstr "" +msgstr "上下左右から" #: PluginScripts/plugin-heal-selection.scm:254 msgid "Sides" -msgstr "" +msgstr "左右から" #: PluginScripts/plugin-heal-selection.scm:255 msgid "Above and below" -msgstr "" +msgstr "上下から" #: PluginScripts/plugin-heal-selection.scm:256 #: PluginScripts/plugin-heal-transparency.scm:105 msgid "Filling order" -msgstr "" +msgstr "塗り潰し方向" #: PluginScripts/plugin-heal-selection.scm:257 #: PluginScripts/plugin-heal-transparency.scm:106 msgid "Random" -msgstr "" +msgstr "ランダム" #: PluginScripts/plugin-heal-selection.scm:258 #: PluginScripts/plugin-heal-transparency.scm:107 msgid "Inwards towards center" -msgstr "" +msgstr "外側から内側へ" #: PluginScripts/plugin-heal-selection.scm:259 #: PluginScripts/plugin-heal-transparency.scm:108 msgid "Outwards from center" -msgstr "" +msgstr "内側から外側へ" #: PluginScripts/plugin-heal-transparency.scm:40 msgid "The active layer has no alpha channel to heal." -msgstr "" +msgstr "アクティブレイヤーには修復するためのアルファチャンネルがありません。" #: PluginScripts/plugin-heal-transparency.scm:79 msgid "_Heal transparency(scm)..." -msgstr "" +msgstr "透過部分を修復(scm)..." #: PluginScripts/plugin-heal-transparency.scm:82 msgid "" "Removes alpha channel by synthesis. Fill outward for edges, inward for " "holes." -msgstr "" +msgstr "アルファチャンネルを合成で消す。端の場合は内側から外側へ、穴の場合は外側から内側へ。" #: PluginScripts/plugin-map-style.scm:272 msgid "The style source cannot be of mode INDEXED" -msgstr "" +msgstr "スタイル(特徴)ソースの画像モードをINDEXEDには出来ません。" #: PluginScripts/plugin-map-style.scm:389 msgid "_Style(scm)..." -msgstr "" +msgstr "スタイル(scm)..." #: PluginScripts/plugin-map-style.scm:392 msgid "" "Transfer style (color and surface) from a chosen source to the active layer. " -msgstr "" +msgstr "選択したソースからアクティブレイヤーへスタイル(色と表面パターン)を転写します。" #: PluginScripts/plugin-map-style.scm:393 msgid "" "Transforms image using art media and style from another image. Maps or " "synthesizes texture or theme from one image onto another. " -msgstr "" - -#: PluginScripts/plugin-map-style.scm:393 -msgid "" -"Transforms image using art media and style from another image. Maps or " -"synthesizes texture or theme from one image onto another. " -msgstr "" +msgstr "別の画像のアートメディアとスタイルで画像の性質を変えます。" +"ある画像から別の画像へテクスチャやテーマをマップあるいは合成します。" #: PluginScripts/plugin-map-style.scm:406 msgid "Source of style" -msgstr "" +msgstr "スタイル(特徴)ソース" #: PluginScripts/plugin-map-style.scm:407 msgid "Percent transfer" -msgstr "" +msgstr "転写率" #: PluginScripts/plugin-map-style.scm:415 msgid "Map by" -msgstr "" +msgstr "マッピングモード" #: PluginScripts/plugin-map-style.scm:416 msgid "Color and brightness" -msgstr "" +msgstr "色と輝度" #: PluginScripts/plugin-map-style.scm:417 msgid "Brightness only" -msgstr "" +msgstr "輝度のみ" #: PluginScripts/plugin-render-texture.scm:246 msgid "_Texture(scm)..." -msgstr "" +msgstr "テクスチャー(scm)..." #: PluginScripts/plugin-render-texture.scm:249 msgid "" "Create a new image with texture from the current image or selection. " "Optionally, create image edges suited for further, seamless tiling. " -msgstr "" +msgstr "現在の画像または選択範囲をテクスチャ化した画像を生成します。" +"オプションで、画像端をシームレスに並べられるように--タイリング出来るようにします。" #: PluginScripts/plugin-render-texture.scm:250 msgid "" "New image is the same scale but seamless and irregular. Use 'Map>Tile' for " "less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " -msgstr "" +msgstr "新しい画像は縮尺は同じですがシームレスで、また内容は不規則になります。" +"[カラーマッピング / シームレスタイル]を利用すれば不規則性の少ない結果が得られます。" +"[編集 / 再合成パターンで塗り潰す]を利用すればでは不規則性の多い結果が得られます。" #: PluginScripts/plugin-render-texture.scm:264 msgid "Ratio of size of new image to source selection" -msgstr "" +msgstr "生成画像と選択範囲のサイズ比" #: PluginScripts/plugin-render-texture.scm:271 msgid "Make new image edges suitable for seamless tiling" -msgstr "" +msgstr "生成画像の端をシームレスに並べられるようにする" #: PluginScripts/plugin-resynth-enlarge.scm:109 msgid "_Enlarge & sharpen(scm)..." -msgstr "" +msgstr "拡大して鮮明化(scm)..." #: PluginScripts/plugin-resynth-enlarge.scm:112 msgid "Enlarge image and synthesize to sharpen." -msgstr "" +msgstr "画像を拡大して鮮明化のために合成します。" #: PluginScripts/plugin-resynth-enlarge.scm:125 msgid "Scale by" -msgstr "" +msgstr "拡大係数" #: PluginScripts/plugin-resynth-fill-pattern.scm:107 msgid "_Fill with pattern seamless(scm)..." -msgstr "" +msgstr "シームレスにパターンで塗り潰す(scm)... " #: PluginScripts/plugin-resynth-fill-pattern.scm:110 msgid "Seamlessly fill with a pattern using synthesis." -msgstr "" +msgstr "合成を使ってシームレスにパターンで塗り潰す。" #: PluginScripts/plugin-resynth-fill-pattern.scm:123 msgid "Pattern" -msgstr "" +msgstr "パターン" #: PluginScripts/plugin-resynth-sharpen.scm:110 msgid "_Sharpen by synthesis(scm)..." -msgstr "" +msgstr "合成して鮮明化(scm)..." #: PluginScripts/plugin-resynth-sharpen.scm:113 msgid "Sharpen image by synthesis." -msgstr "" +msgstr "合成により画像を鮮明化します。" #: PluginScripts/plugin-resynth-sharpen.scm:126 msgid "Sharpening" -msgstr "" +msgstr "鮮明化係数" #: PluginScripts/plugin-uncrop.scm:166 msgid "A layer must be active, not a channel." -msgstr "" +msgstr "画像レイヤーがアクティブである必要があります、またチャンネルを選択しないでください。" #: PluginScripts/plugin-uncrop.scm:240 msgid "_Uncrop(scm)..." -msgstr "" +msgstr "逆切り抜き(scm)..." #: PluginScripts/plugin-uncrop.scm:243 msgid "" "Enlarge image by synthesizing a border that matches the edge, maintaining " "perspective. Works best for small enlargement of natural edges. Undo a Crop " "instead, if possible!" -msgstr "" +msgstr "現画像の端と一致する周囲を合成することで" #: PluginScripts/plugin-uncrop.scm:256 msgid "Percent enlargement" -msgstr "" +msgstr "拡大率 100% +" #: src/resynthesizer-gui/resynth-gui.c:156 msgid "Make tiles, apply themes, render texture, remove features, etc." -msgstr "" +msgstr "タイル化、テーマ適用、テクスチャ下塗り、特徴削除など。" #: src/resynthesizer-gui/resynth-gui.c:161 msgid "_Resynthesize..." -msgstr "" +msgstr "Resynthesize..." #: src/resynthesizer-gui/resynth-gui.h:115 msgid "Context: " -msgstr "" +msgstr "コンテキスト: " #: src/resynthesizer-gui/resynth-gui.h:123 msgid "Random order, without context" -msgstr "" +msgstr "ランダム順, コンテキストなし" #: src/resynthesizer-gui/resynth-gui.h:124 msgid "Random order, with context" -msgstr "" +msgstr "ランダム順, コンテキストあり" #: src/resynthesizer-gui/resynth-gui.h:125 msgid "Randomized bands, concentric, inwards" -msgstr "" +msgstr "帯域ランダム化、同心に、内向きに" #: src/resynthesizer-gui/resynth-gui.h:126 msgid "" "Randomized bands, horizontally, inwards (i.e. squeezing from top and bottom)" -msgstr "" +msgstr "帯域ランダム化、水平に、内向きに(例: 上と下から押し込む)" #: src/resynthesizer-gui/resynth-gui.h:127 msgid "" "Randomized bands, vertically, inwards (i.e. squeezing from left and right)" -msgstr "" +msgstr "帯域ランダム化、垂直に、内向きに(例: 左と右から押し込む)" #: src/resynthesizer-gui/resynth-gui.h:128 msgid "Randomized bands, concentric, outwards (e.g. for uncrop)" -msgstr "" +msgstr "帯域ランダム化、同心に、外向きに(例: 逆切り抜き)" #: src/resynthesizer-gui/resynth-gui.h:129 msgid "" "Randomized bands, horizontally, outwards, (i.e. expanding to top and bottom)" -msgstr "" +msgstr "帯域ランダム化、水平に、外向きに(例: 上と下へ拡張)" #: src/resynthesizer-gui/resynth-gui.h:130 msgid "" "Randomized bands, vertically, outwards (i.e. expanding to left and right)" -msgstr "" +msgstr "帯域ランダム化、垂直に、外向きに(例: 左と右へ拡張)" #: src/resynthesizer-gui/resynth-gui.h:131 msgid "" "Randomized bands, concentric, inwards and outwards (i.e. squeezing in and " "out a donut)" -msgstr "" +msgstr "帯域ランダム化、同心に、内向きと外向きに(例: ドーナツを押し込む、押し出す)" #: src/resynthesizer-gui/resynth-gui.h:228 msgid "Resynthesize" @@ -277,55 +275,55 @@ msgstr "" #: src/resynthesizer-gui/resynth-gui.h:247 msgid "_Cancel" -msgstr "" +msgstr "キャンセル" #: src/resynthesizer-gui/resynth-gui.h:260 msgid "Options" -msgstr "" +msgstr "オプション" #: src/resynthesizer-gui/resynth-gui.h:264 msgid "Tweaks" -msgstr "" +msgstr "微調整" #: src/resynthesizer-gui/resynth-gui.h:268 msgid "Input" -msgstr "" +msgstr "入力" #: src/resynthesizer-gui/resynth-gui.h:274 msgid "Texture source: " -msgstr "" +msgstr "テクスチャソース" #: src/resynthesizer-gui/resynth-gui.h:278 msgid "Output" -msgstr "" +msgstr "出力" #: src/resynthesizer-gui/resynth-gui.h:286 msgid "Make horizontally tileable" -msgstr "" +msgstr "水平にタイル化可能に" #: src/resynthesizer-gui/resynth-gui.h:290 msgid "Make vertically tileable" -msgstr "" +msgstr "垂直にタイル化可能に" #: src/resynthesizer-gui/resynth-gui.h:297 msgid "Texture transfer" -msgstr "" +msgstr "テクスチャ転送" #: src/resynthesizer-gui/resynth-gui.h:306 msgid "Use texture transfer" -msgstr "" +msgstr "テクスチャ転送する" #: src/resynthesizer-gui/resynth-gui.h:312 msgid "Input map: " -msgstr "" +msgstr "入力マップ" #: src/resynthesizer-gui/resynth-gui.h:317 msgid "Output map: " -msgstr "" +msgstr "出力マップ" #: src/resynthesizer-gui/resynth-gui.h:322 msgid "Map importance:" -msgstr "" +msgstr "マップ重視度" #: src/resynthesizer-gui/resynth-gui.h:329 msgid "" @@ -333,72 +331,74 @@ msgid "" "the output. A neighbourhood of nearby pixels in the output are compared with " "neighbourhoods of pixels in the input. The pixel at the center of the best " "matching neighbourhood is copied to the output.\n" -msgstr "" +msgstr "Resynthesizer は 1 pixel ずつ入力から出力へコピーすることで動作します。" +"出力内の近傍ピクセルと入力内の近傍ピクセルが比較されます。" +"最も一致している近傍の中心ピクセルが出力にコピーされます。\n" #: src/resynthesizer-gui/resynth-gui.h:331 msgid "Neighbourhood size:" -msgstr "" +msgstr "近傍サイズ" #: src/resynthesizer-gui/resynth-gui.h:334 msgid "- How many nearby pixels in the output are to be used?\n" -msgstr "" +msgstr "- 出力側の近傍ピクセルをいくつにするか\n" #: src/resynthesizer-gui/resynth-gui.h:336 msgid "Search thoroughness:" -msgstr "" +msgstr "探索徹底度" #: src/resynthesizer-gui/resynth-gui.h:339 msgid "- How many locations in the input are examined?\n" -msgstr "" +msgstr "- どれぐらい入力側を調べるか?\n" #: src/resynthesizer-gui/resynth-gui.h:341 msgid "Sensitivity to outliers:" -msgstr "" +msgstr "外れ値感度" #: src/resynthesizer-gui/resynth-gui.h:344 msgid "" "- To what extent does a very bad match on a single pixel disqualify a " "location?\n" -msgstr "" +msgstr "- ある単一ピクセルの一致度が非常に悪い場合、どれぐらいで不適とするか?\n" #: src/resynthesizer/resynthesizer.c:350 msgid "Incompatible image mode." -msgstr "" +msgstr "非互換の画像モードです。" #: src/resynthesizer/resynthesizer.c:373 msgid "Resynthesizer failed to get parameters." -msgstr "" +msgstr "Resynthesizer はパラメーターを取得できませんでした。" #: src/resynthesizer/resynthesizer.c:388 msgid "" "The input texture and output image must have the same number of color " "channels." -msgstr "" +msgstr "入力テクスチャと出力側画像は同じ数のカラーチャンネルが必要です。" #: src/resynthesizer/resynthesizer.c:407 msgid "The input and output maps must have the same mode" -msgstr "" +msgstr "入力と出力マップは同じ画像モードである必要があります。" #: src/resynthesizer/resynthesizer.c:412 msgid "The input map should be the same size as the input texture image" -msgstr "" +msgstr "入力マップは入力テクスチャ画像と同じサイズである必要があります。" #: src/resynthesizer/resynthesizer.c:417 msgid "The output map should be the same size as the output image" -msgstr "" +msgstr "出力マップは出力画像と同じサイズである必要があります。" #: src/resynthesizer/resynthesizer.c:503 msgid "synthesizing..." -msgstr "" +msgstr "合成中..." #: src/resynthesizer/resynthesizer.c:517 msgid "" "The texture source is empty. Does any selection include non-transparent " "pixels?" -msgstr "" +msgstr "テクスチャソースが空です。不透明な部分を選択範囲に含めていますか?" #: src/resynthesizer/resynthesizer.c:521 msgid "" "The output layer is empty. Does any selection have visible pixels in the " "active layer?" -msgstr "" +msgstr "出力レイヤーが空です。アクティブレイヤーの選択範囲に可視ピクセルは含まれていますか?" From 9b3894f08e92b1a1e234c248777e491295fbd492 Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 28 Oct 2022 00:55:51 +0900 Subject: [PATCH 11/23] Change installing path of locales folder Change installing path of the locales folder to relative to the plugin files. This makes it possible to internationalize even if you install with general user privileges.(On both GNU/Linux and Windows.) --- .gitignore | 1 + autogen.sh | 3 +- configure.ac | 26 ++++------ po/Makefile.in.in | 2 +- src/resynth-path.h | 51 +++++++++++++++++++ src/resynthesizer-gettext/Makefile.am | 6 --- .../resynthesizer-gettext.c | 9 ++-- src/resynthesizer-gui/Makefile.am | 8 ++- src/resynthesizer-gui/resynth-gui.c | 11 ++-- src/resynthesizer/Makefile.am | 7 --- src/resynthesizer/resynthesizer.c | 9 +--- 11 files changed, 77 insertions(+), 56 deletions(-) create mode 100644 src/resynth-path.h diff --git a/.gitignore b/.gitignore index c6c0e31..5137d97 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ # Ignore editor backup files *~ +.\#* # Ignore Python byte compiled files *.pyc diff --git a/autogen.sh b/autogen.sh index 6f94671..ec2cc89 100755 --- a/autogen.sh +++ b/autogen.sh @@ -190,11 +190,10 @@ fi $AUTOMAKE --add-missing || exit 1 autoconf || exit 1 -glib-gettextize --copy --force || exit 1 intltoolize --copy --force --automake || exit 1 # Add arguments to xgettext (what is the correct way?) -sed --in-place po/Makefile.in.in -e 's/^\(GENPOT[\t ]*=\)\(.*\)$/\1 XGETTEXT_ARGS="--keyword=SG_ --keyword=G_" \2/' +sed --in-place po/Makefile.in.in -e 's/^\(GENPOT[\t ]*=\)\(.*\)$/\1 XGETTEXT_ARGS="@xgettext_args@" \2/' cd $ORIGDIR diff --git a/configure.ac b/configure.ac index c51a10d..2e384c3 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script. dnl lkk 2011 Hacked from gimp-plugin-template configure.in dnl changed name and added PluginScript/Makefile -AC_PREREQ(2.54) +AC_PREREQ([2.71]) dnl Name your plug-in here dnl lkk 2011 Changed name and version digits @@ -17,7 +17,7 @@ m4_define([plugin_micro_version], [0]) m4_define([plugin_version], [plugin_major_version.plugin_minor_version.plugin_micro_version]) -AC_INIT([plugin_name], [plugin_version]) +AC_INIT([plugin_name],[plugin_version]) AC_DEFINE(PLUGIN_NAME, PACKAGE_NAME, [Plug-In name]) AC_DEFINE(PLUGIN_VERSION, PACKAGE_VERSION, [Plug-In version]) @@ -30,13 +30,11 @@ dnl lkk This macro only confirms that the given file is in configure's notion of AC_CONFIG_SRCDIR([src/resynthesizer/resynthesizer.c]) AM_CONFIG_HEADER(config.h) -dnl AM_INIT_AUTOMAKE(no-define) AM_INIT_AUTOMAKE([foreign]) -AC_ISC_POSIX +AC_SEARCH_LIBS([strerror],[cposix]) AC_PROG_CC AM_PROG_CC_STDC -AC_HEADER_STDC ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" @@ -45,14 +43,14 @@ AM_MAINTAINER_MODE dnl Use -Wall if we have gcc. -changequote(,)dnl +changequote(,) if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi -changequote([,])dnl +changequote([,]) GIMP_REQUIRED_VERSION=2.2.0 @@ -64,9 +62,6 @@ PKG_CHECK_MODULES(GIMP, AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) -dnl GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0` -dnl AC_SUBST(GIMP_LIBDIR) - dnl i18n stuff @@ -75,11 +70,13 @@ GETTEXT_PACKAGE=resynthesizer AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain.]) +xgettext_args="--keyword=SG_ --keyword=G_" +AC_SUBST(xgettext_args) dnl Add the languages which your application supports here. ALL_LINGUAS="es fr ru pt_BR ja" -AC_PROG_INTLTOOL +IT_PROG_INTLTOOL AM_GLIB_GNU_GETTEXT AC_CHECK_FUNCS(bind_textdomain_codeset) @@ -93,10 +90,8 @@ dnl gimpplugindir="$libdir/$PACKAGE/gimp_plugin_version" gimpplugindir="$libdir/gimp/2.0" AC_SUBST(gimpplugindir) -LOCALEDIR='${datadir}/locale' +localedir="$gimpplugindir/plug-ins/resynthesizer-locale" DATADIR='${datadir}/plugin_name' - -AC_SUBST(LOCALEDIR) AC_SUBST(DATADIR) @@ -127,7 +122,6 @@ fi dnl lkk July 2011 AC_PROG_RANLIB -dnl AC_PROG_LIBTOOL dnl lkk 2011 Added PluginScripts/Makefile dnl lkk 2015 Break src into lib, src/resynthesizer, src/resynthesizer-gui @@ -145,6 +139,7 @@ help/images/Makefile PluginScripts/Makefile ]) + AC_CANONICAL_HOST case $host_os in dnl WindowsOS @@ -152,4 +147,5 @@ case $host_os in LDFLAGS="$LDFLAGS -mwindows" esac + AC_OUTPUT diff --git a/po/Makefile.in.in b/po/Makefile.in.in index bbe95e2..380080f 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -49,7 +49,7 @@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -GENPOT = XGETTEXT_ARGS="--keyword=SG_ --keyword=G_" INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot +GENPOT = XGETTEXT_ARGS="@xgettext_args@" INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ diff --git a/src/resynth-path.h b/src/resynth-path.h new file mode 100644 index 0000000..2b85b4d --- /dev/null +++ b/src/resynth-path.h @@ -0,0 +1,51 @@ + +#include + +#define locale_rel_path "/resynthesizer-locale" +// There is no basis for this size. +#define path_max_size 260*4 + +#if defined(G_OS_WIN32) +# include + +char * get_excutable_path () { + + static char path[path_max_size] = {0}; + int path_bytes = sizeof (path); + + // `MAX_PATH` is traditionally 260. + // `exteneded length path` length is 32767. too long. + + if (0 == GetModuleFileName (NULL, path, path_bytes)) { + return ""; + }; + return path; +} + +#else + +# include + +char * get_excutable_path () { + static char path[path_max_size] = {0}; + int path_bytes = sizeof(path); + + if (-1 == readlink ("/proc/self/exe", path, path_bytes - 1)) { + return ""; + }; + return path; +} + +#endif + +char * get_resynthesizer_locale_dir () { + static char path[path_max_size] = {0}; + char *exe_path = get_excutable_path (); + gchar *heap1 = g_path_get_dirname (exe_path); + gchar *heap2 = g_strconcat (heap1, locale_rel_path, NULL); + g_free (heap1); + g_strlcpy (path, heap2, path_max_size); + g_free (heap2); + + return path; +} diff --git a/src/resynthesizer-gettext/Makefile.am b/src/resynthesizer-gettext/Makefile.am index 0ca4bd6..012fc67 100644 --- a/src/resynthesizer-gettext/Makefile.am +++ b/src/resynthesizer-gettext/Makefile.am @@ -6,13 +6,7 @@ bindir = $(gimpplugindir)/plug-ins resynthesizer_gettext_SOURCES = resynthesizer-gettext.c -AM_CPPFLAGS = \ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DDATADIR=\""$(DATADIR)"\" - resynthesizer_gettext_CPPFLAGS =\ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DDATADIR=\""$(DATADIR)"\" \ -I$(top_srcdir) \ @GIMP_CFLAGS@ \ -I$(includedir) diff --git a/src/resynthesizer-gettext/resynthesizer-gettext.c b/src/resynthesizer-gettext/resynthesizer-gettext.c index 6130c33..d99462a 100644 --- a/src/resynthesizer-gettext/resynthesizer-gettext.c +++ b/src/resynthesizer-gettext/resynthesizer-gettext.c @@ -16,10 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "config.h" // GNU buildtools local configuration #include "../plugin-intl.h" // i18n macros - +#include "../resynth-path.h" static void query (void) @@ -56,11 +57,7 @@ run (const gchar *name, GimpParam **return_vals) { /* Initialize i18n support */ -#if defined(G_OS_WIN32) - bindtextdomain (GETTEXT_PACKAGE, gimp_locale_directory()); -#else - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); -#endif + bindtextdomain (GETTEXT_PACKAGE, get_resynthesizer_locale_dir()); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif diff --git a/src/resynthesizer-gui/Makefile.am b/src/resynthesizer-gui/Makefile.am index 9b2c981..beb70a4 100644 --- a/src/resynthesizer-gui/Makefile.am +++ b/src/resynthesizer-gui/Makefile.am @@ -12,13 +12,11 @@ resynthesizer_gui_SOURCES = resynth-gui.c # resynth-parameters.c # resynth-constants.h -AM_CPPFLAGS = \ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DDATADIR=\""$(DATADIR)"\" +# AM_CPPFLAGS = \ +# -DLOCALEDIR=\""$(LOCALEDIR)"\" \ +# -DDATADIR=\""$(DATADIR)"\" resynthesizer_gui_CPPFLAGS =\ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DDATADIR=\""$(DATADIR)"\" \ -I$(top_srcdir) \ @GIMP_CFLAGS@ \ -I$(includedir) diff --git a/src/resynthesizer-gui/resynth-gui.c b/src/resynthesizer-gui/resynth-gui.c index c795c2c..2130177 100644 --- a/src/resynthesizer-gui/resynth-gui.c +++ b/src/resynthesizer-gui/resynth-gui.c @@ -36,6 +36,7 @@ #include "config.h" // GNU buildtools local configuration #include "../plugin-intl.h" // i18n macros +#include "../resynth-path.h" #include #include @@ -65,12 +66,8 @@ static void run( values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_SUCCESS; - /* Initialize i18n support */ -#if defined(G_OS_WIN32) - bindtextdomain (GETTEXT_PACKAGE, gimp_locale_directory()); -#else - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); -#endif + /* Initialize i18n support */ + bindtextdomain (GETTEXT_PACKAGE, get_resynthesizer_locale_dir()); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif @@ -149,7 +146,7 @@ query() gint nargs = sizeof(resynth_paramdefs)/sizeof(resynth_paramdefs[0]); gint nreturn_vals = 0; - gimp_plugin_domain_register (RESYNTH_DOMAIN_NAME, LOCALEDIR); + gimp_plugin_domain_register (RESYNTH_DOMAIN_NAME, get_resynthesizer_locale_dir()); gimp_install_procedure( RESYNTH_CONTROLS_PDB_NAME, diff --git a/src/resynthesizer/Makefile.am b/src/resynthesizer/Makefile.am index 46aa96e..2ab1d7a 100644 --- a/src/resynthesizer/Makefile.am +++ b/src/resynthesizer/Makefile.am @@ -19,8 +19,6 @@ resynthesizer_SOURCES = resynthesizer.c # resynthesizer plugin uses libresynthesizer resynthesizer_CPPFLAGS =\ - -DLOCALEDIR=\""$(LOCALEDIR)"\" \ - -DDATADIR=\""$(DATADIR)"\" \ -I$(top_srcdir) \ @GIMP_CFLAGS@ \ -I$(includedir) \ @@ -30,8 +28,3 @@ resynthesizer_CPPFLAGS =\ # resynthesizer GIMP plugin calls GIMP lib and convenience library (i.e. local) libresynthesizer # libresynthesizer in turn depends on math and gthread-2.0 LDADD = ../../lib/libresynthesizer.a $(GIMP_LIBS) -lm -lgthread-2.0 - - - - - diff --git a/src/resynthesizer/resynthesizer.c b/src/resynthesizer/resynthesizer.c index f47b916..643e6ae 100644 --- a/src/resynthesizer/resynthesizer.c +++ b/src/resynthesizer/resynthesizer.c @@ -73,6 +73,7 @@ It doesn't make tiles in the target, it makes a target that is suitable as a til #include "../../config.h" // GNU buildtools local configuration #include "../plugin-intl.h" // i18n macros +#include "../resynth-path.h" #include #include @@ -323,14 +324,8 @@ static void run( start_time = clock(); #endif - // internationalization i18n - // Note these constants are defined in the build environment. /* Initialize i18n support */ -#if defined(G_OS_WIN32) - bindtextdomain (GETTEXT_PACKAGE, gimp_locale_directory()); -#else - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); -#endif + bindtextdomain (GETTEXT_PACKAGE, get_resynthesizer_locale_dir()); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif From c152ddb3722a4caff91840dfad5c1bbc870d6514 Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 28 Oct 2022 21:17:04 +0900 Subject: [PATCH 12/23] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 15c1222..25c9ccc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ ## about scm version [see wiki/README](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/README) +## Installation +[Wiki:Download and Install: GIMP resynthesizer scm](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/Download-and-Install:-GIMP-resynthesizer-scm) + +[Download: .zip file for Windows](https://github.com/itr-tert/gimp-resynthesizer-scm-download/raw/main/gimp-resynthesizer-scm-win.zip) + +[Download: .deb for amd64 Debian/Ubuntu, GNU/Linux](https://github.com/itr-tert/gimp-resynthesizer-scm-download/raw/main/gimp-resynthesizer-scm.deb) + +---- + # GIMP Resynthesizer Plugin Suite A set of plugins for the GIMP image editing app. From c6a8657d0532ed010c0d9b57452db6b828368470 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sat, 29 Oct 2022 23:03:43 +0900 Subject: [PATCH 13/23] Import @libreajans 's Turkish translation file. https://github.com/libreajans/resynthesizer/blob/add-turkish/po/tr.po --- po/tr.po | 419 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 419 insertions(+) create mode 100644 po/tr.po diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..a6f3e4f --- /dev/null +++ b/po/tr.po @@ -0,0 +1,419 @@ +# Turkish translation for GIMP resynthesizer plug-in. +# +# Copyright (C) 2022 GIMP resynthesizer plug-in's COPYRIGHT HOLDER +# This file is distributed under the same license as the GIMP resynthesizer plug-in package. +# +# Sabri Ünal , 2022. +# +# Not: Çevirilerin GIMP çevirileri ile uyumlu olmasına özen gösterilmiştir. +# Çeviriye katkı vermeden önce en son çevirmen ile lütfen iletişime geçmeye çalışın. +# İletişim kuramazsanız çevirileri devam ettirmekten veya iyileştirmekten çekinmeyin. +# +msgid "" +msgstr "" +"Project-Id-Version: GIMP resynthesizer plugin master\n" +"Report-Msgid-Bugs-To: https://github.com/bootchk/resynthesizer\n" +"POT-Creation-Date: 2022-08-29 12:22+0300\n" +"PO-Revision-Date: 2022-08-29 23:22+0300\n" +"Last-Translator: Sabri Ünal \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: _;NC_;G_;N_\n" +"X-Poedit-SearchPath-0: PluginScripts\n" +"X-Poedit-SearchPath-1: src/resynthesizer-gui/resynth-gui.c\n" +"X-Poedit-SearchPath-2: src/resynthesizer-gui/resynth-gui.h\n" +"X-Poedit-SearchPath-3: src/resynthesizer/resynthesizer.c\n" + +#: PluginScripts/plugin-heal-selection.py:42 +msgid "You must first select a region to heal." +msgstr "İyileşmek için önce bir bölge seçmelisiniz." + +#: PluginScripts/plugin-heal-selection.py:157 +msgid "Heal the selection from surroundings as if using the heal tool." +msgstr "" +"İyileştirme aracını kullanıyormuş gibi seçimi çervesindekilerle iyileştir." + +# Menü Öğesi olduğu için başlık düzeni +#: PluginScripts/plugin-heal-selection.py:162 +msgid "_Heal selection..." +msgstr "_Seçimi İyileştir..." + +#: PluginScripts/plugin-heal-selection.py:167 +#: PluginScripts/plugin-heal-transparency.py:82 +msgid "Context sampling width (pixels):" +msgstr "Bağlam örnekleme genişliği (piksel):" + +#: PluginScripts/plugin-heal-selection.py:168 +msgid "Sample from:" +msgstr "Örnek kaynağı:" + +#: PluginScripts/plugin-heal-selection.py:168 +msgid "All around" +msgstr "Her yönden" + +#: PluginScripts/plugin-heal-selection.py:168 +msgid "Sides" +msgstr "Yanlar" + +#: PluginScripts/plugin-heal-selection.py:168 +msgid "Above and below" +msgstr "Üst ve alt" + +#: PluginScripts/plugin-heal-selection.py:169 +#: PluginScripts/plugin-heal-transparency.py:83 +msgid "Filling order:" +msgstr "Doldurma sırası:" + +#: PluginScripts/plugin-heal-selection.py:169 +#: PluginScripts/plugin-heal-transparency.py:83 +msgid "Random" +msgstr "Rastgele" + +#: PluginScripts/plugin-heal-selection.py:170 +#: PluginScripts/plugin-heal-transparency.py:84 +msgid "Inwards towards center" +msgstr "Merkeze doğru" + +#: PluginScripts/plugin-heal-selection.py:170 +#: PluginScripts/plugin-heal-transparency.py:84 +msgid "Outwards from center" +msgstr "Merkezden dışa doğru" + +#: PluginScripts/plugin-heal-transparency.py:72 +msgid "" +"Removes alpha channel by synthesis. Fill outward for edges, inward for " +"holes." +msgstr "" +"Sentezleme yoluyla alfa kanalını kaldır. Kenarlar için dışa, delikler için " +"içe doğru doldur." + +# Menü Öğesi olduğu için başlık düzeni +#: PluginScripts/plugin-heal-transparency.py:77 +msgid "Heal transparency..." +msgstr "Saydamlık İyileştir..." + +#: PluginScripts/plugin-map-style.py:281 +msgid "The style source cannot be of mode INDEXED" +msgstr "Biçem kaynağı İNDEKLİ kipte olamaz" + +#: PluginScripts/plugin-map-style.py:376 +msgid "" +"Transfer style (color and surface) from a chosen source to the active layer. " +msgstr "Seçilen kaynaktan aktif katmana biçem (renk ve yüzey) aktar." + +# Menü öğesi +#: PluginScripts/plugin-map-style.py:381 +msgid "Style..." +msgstr "Biçem..." + +#: PluginScripts/plugin-map-style.py:386 +msgid "Source of style:" +msgstr "Biçem kaynağı:" + +#: PluginScripts/plugin-map-style.py:387 +msgid "Percent transfer:" +msgstr "Aktarım yüzdesi:" + +#: PluginScripts/plugin-map-style.py:388 +msgid "Map by:" +msgstr "Eşlem ölçütü:" + +#: PluginScripts/plugin-map-style.py:388 +msgid "Color and brightness" +msgstr "Renk ve parlaklık" + +#: PluginScripts/plugin-map-style.py:388 +msgid "Brightness only" +msgstr "Sadece parlaklık" + +#: PluginScripts/plugin-render-texture.py:188 +msgid "" +"Create a new image with texture from the current image or selection. " +"Optionally, create image edges suited for further, seamless tiling. " +msgstr "" +"Geçerli görüntü veya seçimden dokulu yeni görüntü oluştur. İsteğe bağlı " +"olarak, daha fazla dikişsiz döşeme için uygun görüntü kenarları oluştur. " + +#: PluginScripts/plugin-render-texture.py:193 +msgid "_Texture..." +msgstr "_Doku..." + +#: PluginScripts/plugin-render-texture.py:199 +msgid "Ratio of size of new image to source selection" +msgstr "Yeni görüntünün boyutunun kaynak seçimine oranı" + +#: PluginScripts/plugin-render-texture.py:200 +msgid "Make new image edges suitable for seamless tiling" +msgstr "Dikişsiz döşeme için yeni görüntü kenarlarını uygun hale getir" + +#: PluginScripts/plugin-resynth-enlarge.py:92 +msgid "Enlarge image and synthesize to sharpen." +msgstr "Görüntüyü genişlet ve keskinleştirmek için sentezle." + +# Menü öğesi olduğu için başlık düzeni tercih edildi. +#: PluginScripts/plugin-resynth-enlarge.py:97 +msgid "Enlarge & sharpen..." +msgstr "Genişlet ve Keskinleştir..." + +#: PluginScripts/plugin-resynth-enlarge.py:102 +msgid "Scale by:" +msgstr "Ölçek boyut:" + +#: PluginScripts/plugin-resynth-fill-pattern.py:100 +msgid "Seamlessly fill with a pattern using synthesis." +msgstr "Sentezleme kullanarak desenle dikişsiz doldur." + +#: PluginScripts/plugin-resynth-fill-pattern.py:105 +msgid "_Fill with pattern seamless..." +msgstr "_Desenle Dikişsiz Doldur..." + +#: PluginScripts/plugin-resynth-fill-pattern.py:110 +msgid "Pattern:" +msgstr "Desen:" + +#: PluginScripts/plugin-resynth-sharpen.py:94 +msgid "Sharpen image by synthesis." +msgstr "Sentezleyerek resmi keskinleştir." + +# Menü öğesi olduğu için başlık düzeni tercih edildi. +#: PluginScripts/plugin-resynth-sharpen.py:99 +msgid "Sharpen by synthesis..." +msgstr "Sentezleyerek Keskinleştir..." + +#: PluginScripts/plugin-resynth-sharpen.py:103 +msgid "Sharpening:" +msgstr "Keskinleştirme:" + +#: PluginScripts/plugin-uncrop.py:86 +msgid "A layer must be active, not a channel." +msgstr "Bir kanal değil, bir katman etkin olmalıdır." + +#: PluginScripts/plugin-uncrop.py:142 +msgid "" +"Enlarge image by synthesizing a border that matches the edge, maintaining " +"perspective. Works best for small enlargement of natural edges. Undo a Crop " +"instead, if possible! " +msgstr "" +"Perspektifi koruyarak kenarla eşleşen kenarlık sentezleyerek görüntüyü " +"büyüt. Doğal kenarların küçük genişletmelerinde en iyi sonucu verir. " +"Mümkünse bunun yerine bir Kırpmayı geri alın! " + +#: PluginScripts/plugin-uncrop.py:147 +msgid "Uncrop..." +msgstr "Kırpmayı Kaldır..." + +# Yerine uygun çeviri yapıldı. +#: PluginScripts/plugin-uncrop.py:152 +msgid "Percent enlargement" +msgstr "Genişletme yüzdesi" + +#: src/resynthesizer-gui/resynth-gui.c:156 +msgid "Make tiles, apply themes, render texture, remove features, etc." +msgstr "" +"Döşeme yapın, temalar uygulayın, doku işleyin, özellikleri kaldırın, vb." + +#: src/resynthesizer-gui/resynth-gui.c:161 +msgid "_Resynthesize..." +msgstr "_Yeniden Sentezle..." + +#: src/resynthesizer-gui/resynth-gui.h:115 +msgid "Context: " +msgstr "İçerik: " + +#: src/resynthesizer-gui/resynth-gui.h:123 +msgid "Random order, without context" +msgstr "Rastgele sıra, bağlamsız" + +#: src/resynthesizer-gui/resynth-gui.h:124 +msgid "Random order, with context" +msgstr "Rastgele sıra, bağlamla birlikte" + +#: src/resynthesizer-gui/resynth-gui.h:125 +msgid "Randomized bands, concentric, inwards" +msgstr "Rastgele şeritler, eşmerkezli, içe doğru" + +#: src/resynthesizer-gui/resynth-gui.h:126 +msgid "" +"Randomized bands, horizontally, inwards (i.e. squeezing from top and bottom)" +msgstr "Rastgele şeritler, yatay, içe doğru (yani yukarıdan ve aşağıdan sıkma)" + +#: src/resynthesizer-gui/resynth-gui.h:127 +msgid "" +"Randomized bands, vertically, inwards (i.e. squeezing from left and right)" +msgstr "Rastgele şeritler, dikey, içe doğru (yani soldan ve sağdan sıkma)" + +#: src/resynthesizer-gui/resynth-gui.h:128 +msgid "Randomized bands, concentric, outwards (e.g. for uncrop)" +msgstr "" +"Rastgele şeritler, eşmerkezli, dışa doğru (örneğin, kırpma kaldırma için)" + +#: src/resynthesizer-gui/resynth-gui.h:129 +msgid "" +"Randomized bands, horizontally, outwards, (i.e. expanding to top and bottom)" +msgstr "" +"Rastgele şeritler, yatay, dışa doğru, (yani yukarı ve aşağı doğru genişler)" + +#: src/resynthesizer-gui/resynth-gui.h:130 +msgid "" +"Randomized bands, vertically, outwards (i.e. expanding to left and right)" +msgstr "" +"Rastgele şeritler, dikey, dışa doğru (yani sola ve sağa doğru genişler)" + +#: src/resynthesizer-gui/resynth-gui.h:131 +msgid "" +"Randomized bands, concentric, inwards and outwards (i.e. squeezing in and " +"out a donut)" +msgstr "" +"Rastgele şeritler, eşmerkezli, içe ve dışa doğru (yani çöreği içeri ve " +"dışarı sıkma)" + +#: src/resynthesizer-gui/resynth-gui.h:228 +msgid "Resynthesize" +msgstr "Yeniden Sentezle" + +#: src/resynthesizer-gui/resynth-gui.h:240 +msgid "_OK" +msgstr "_Tamam" + +#: src/resynthesizer-gui/resynth-gui.h:247 +msgid "_Cancel" +msgstr "_İptal Et" + +#: src/resynthesizer-gui/resynth-gui.h:260 +msgid "Options" +msgstr "Seçenekler" + +#: src/resynthesizer-gui/resynth-gui.h:264 +msgid "Tweaks" +msgstr "İnce Ayarlar" + +#: src/resynthesizer-gui/resynth-gui.h:268 +msgid "Input" +msgstr "Girdi" + +#: src/resynthesizer-gui/resynth-gui.h:274 +msgid "Texture source: " +msgstr "Doku kaynağı: " + +#: src/resynthesizer-gui/resynth-gui.h:278 +msgid "Output" +msgstr "Çıktı" + +#: src/resynthesizer-gui/resynth-gui.h:286 +msgid "Make horizontally tileable" +msgstr "Yatay döşenebilir yap" + +#: src/resynthesizer-gui/resynth-gui.h:290 +msgid "Make vertically tileable" +msgstr "Dikey döşenebilir yap" + +#: src/resynthesizer-gui/resynth-gui.h:297 +msgid "Texture transfer" +msgstr "Doku aktarımı" + +#: src/resynthesizer-gui/resynth-gui.h:306 +msgid "Use texture transfer" +msgstr "Doku aktarımı kullan" + +#: src/resynthesizer-gui/resynth-gui.h:312 +msgid "Input map: " +msgstr "Girdi eşlemi: " + +#: src/resynthesizer-gui/resynth-gui.h:317 +msgid "Output map: " +msgstr "Çıktı eşlemi: " + +#: src/resynthesizer-gui/resynth-gui.h:322 +msgid "Map importance:" +msgstr "Eşlem önemi:" + +#: src/resynthesizer-gui/resynth-gui.h:329 +msgid "" +"Resynthesizer operates by copying pixels, one at a time, from the input to " +"the output. A neighbourhood of nearby pixels in the output are compared with " +"neighbourhoods of pixels in the input. The pixel at the center of the best " +"matching neighbourhood is copied to the output.\n" +msgstr "" +"Yeniden sentezleyici, girdiden çıktıya pikselleri birer birer kopyalayarak " +"çalışır. Çıktıdaki yakın piksellerin komşuları, girdideki piksellerin " +"komşularıyla karşılaştırılır. En iyi eşleşen komşunun merkezindeki piksel " +"çıktıya kopyalanır.\n" + +#: src/resynthesizer-gui/resynth-gui.h:331 +msgid "Neighbourhood size:" +msgstr "Komşuluk boyutu:" + +#: src/resynthesizer-gui/resynth-gui.h:334 +msgid "- How many nearby pixels in the output are to be used?\n" +msgstr "- Çıktıda kaç tane yakın piksel kullanılacak?\n" + +#: src/resynthesizer-gui/resynth-gui.h:336 +msgid "Search thoroughness:" +msgstr "Arama titizliği:" + +#: src/resynthesizer-gui/resynth-gui.h:339 +msgid "- How many locations in the input are examined?\n" +msgstr "- Girdide kaç konum incelenecek?\n" + +#: src/resynthesizer-gui/resynth-gui.h:341 +msgid "Sensitivity to outliers:" +msgstr "Aykırı değerlere duyarlılık:" + +#: src/resynthesizer-gui/resynth-gui.h:344 +msgid "" +"- To what extent does a very bad match on a single pixel disqualify a " +"location?\n" +msgstr "" +"- Tek pikseldeki kaç kötü eşleşme, bir konumu ne ölçüde gözden düşürür?\n" + +#: src/resynthesizer/resynthesizer.c:350 +msgid "Incompatible image mode." +msgstr "Uyumsuz görüntü kipi." + +#: src/resynthesizer/resynthesizer.c:373 +msgid "Resynthesizer failed to get parameters." +msgstr "Yeniden sentezleyici parametreleri alamadı." + +#: src/resynthesizer/resynthesizer.c:388 +msgid "" +"The input texture and output image must have the same number of color " +"channels." +msgstr "" +"Girdi dokusu ve çıktı görüntüsü aynı sayıda renk kanalına sahip olmalıdır." + +#: src/resynthesizer/resynthesizer.c:407 +msgid "The input and output maps must have the same mode" +msgstr "Girdi ve çıktı eşlemleri aynı kipte olmalıdır" + +#: src/resynthesizer/resynthesizer.c:412 +msgid "The input map should be the same size as the input texture image" +msgstr "Girdi eşlemi, girdi dokusu görüntüsüyle aynı boyutta olmalıdır" + +#: src/resynthesizer/resynthesizer.c:417 +msgid "The output map should be the same size as the output image" +msgstr "Çıktı eşlemi çıktı görüntüsüyle aynı boyutta olmalıdır" + +#: src/resynthesizer/resynthesizer.c:503 +msgid "synthesizing..." +msgstr "sentezleniyor..." + +#: src/resynthesizer/resynthesizer.c:517 +msgid "" +"The texture source is empty. Does any selection include non-transparent " +"pixels?" +msgstr "" +"Doku kaynağı boş. Herhangi bir seçim saydam olmayan pikseller içeriyor mu?" + +#: src/resynthesizer/resynthesizer.c:521 +msgid "" +"The output layer is empty. Does any selection have visible pixels in the " +"active layer?" +msgstr "" +"Çıktı katmanı boş. Herhangi bir seçimin etkin katmanda görünür pikselleri " +"var mı?" From b9533d987ac72f40e150ee69cdc2fa3820605168 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sat, 29 Oct 2022 23:08:44 +0900 Subject: [PATCH 14/23] Minor Fix to Turkish translation format. --- configure.ac | 2 +- po/tr.po | 90 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 2e384c3..fe90d58 100644 --- a/configure.ac +++ b/configure.ac @@ -74,7 +74,7 @@ xgettext_args="--keyword=SG_ --keyword=G_" AC_SUBST(xgettext_args) dnl Add the languages which your application supports here. -ALL_LINGUAS="es fr ru pt_BR ja" +ALL_LINGUAS="es fr ru pt_BR ja tr" IT_PROG_INTLTOOL AM_GLIB_GNU_GETTEXT diff --git a/po/tr.po b/po/tr.po index a6f3e4f..30ce1e7 100644 --- a/po/tr.po +++ b/po/tr.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: GIMP resynthesizer plugin master\n" "Report-Msgid-Bugs-To: https://github.com/bootchk/resynthesizer\n" "POT-Creation-Date: 2022-08-29 12:22+0300\n" -"PO-Revision-Date: 2022-08-29 23:22+0300\n" +"PO-Revision-Date: 2022-08-29 12:22+0300\n" "Last-Translator: Sabri Ünal \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -41,17 +41,17 @@ msgstr "" # Menü Öğesi olduğu için başlık düzeni #: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection..." -msgstr "_Seçimi İyileştir..." +msgid "_Heal selection(scm)..." +msgstr "Seçimi İyileştir(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 -msgid "Context sampling width (pixels):" -msgstr "Bağlam örnekleme genişliği (piksel):" +msgid "Context sampling width (pixels)" +msgstr "Bağlam örnekleme genişliği (piksel)" #: PluginScripts/plugin-heal-selection.py:168 -msgid "Sample from:" -msgstr "Örnek kaynağı:" +msgid "Sample from" +msgstr "Örnek kaynağı" #: PluginScripts/plugin-heal-selection.py:168 msgid "All around" @@ -67,8 +67,8 @@ msgstr "Üst ve alt" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 -msgid "Filling order:" -msgstr "Doldurma sırası:" +msgid "Filling order" +msgstr "Doldurma sırası" #: PluginScripts/plugin-heal-selection.py:169 #: PluginScripts/plugin-heal-transparency.py:83 @@ -95,8 +95,12 @@ msgstr "" # Menü Öğesi olduğu için başlık düzeni #: PluginScripts/plugin-heal-transparency.py:77 -msgid "Heal transparency..." -msgstr "Saydamlık İyileştir..." +msgid "_Heal transparency(scm)..." +msgstr "Saydamlık İyileştir(scm)..." + +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "" #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -107,22 +111,28 @@ msgid "" "Transfer style (color and surface) from a chosen source to the active layer. " msgstr "Seçilen kaynaktan aktif katmana biçem (renk ve yüzey) aktar." +#: PluginScripts/plugin-map-style.scm:393 +msgid "" +"Transforms image using art media and style from another image. Maps or " +"synthesizes texture or theme from one image onto another. " +msgstr "" + # Menü öğesi #: PluginScripts/plugin-map-style.py:381 -msgid "Style..." -msgstr "Biçem..." +msgid "_Style(scm)..." +msgstr "Biçem(scm)..." #: PluginScripts/plugin-map-style.py:386 -msgid "Source of style:" -msgstr "Biçem kaynağı:" +msgid "Source of style" +msgstr "Biçem kaynağı" #: PluginScripts/plugin-map-style.py:387 -msgid "Percent transfer:" -msgstr "Aktarım yüzdesi:" +msgid "Percent transfer" +msgstr "Aktarım yüzdesi" #: PluginScripts/plugin-map-style.py:388 -msgid "Map by:" -msgstr "Eşlem ölçütü:" +msgid "Map by" +msgstr "Eşlem ölçütü" #: PluginScripts/plugin-map-style.py:388 msgid "Color and brightness" @@ -140,9 +150,15 @@ msgstr "" "Geçerli görüntü veya seçimden dokulu yeni görüntü oluştur. İsteğe bağlı " "olarak, daha fazla dikişsiz döşeme için uygun görüntü kenarları oluştur. " +#: PluginScripts/plugin-render-texture.scm:250 +msgid "" +"New image is the same scale but seamless and irregular. Use 'Map>Tile' for " +"less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " +msgstr "" + #: PluginScripts/plugin-render-texture.py:193 -msgid "_Texture..." -msgstr "_Doku..." +msgid "_Texture(scm)..." +msgstr "Doku(scm)..." #: PluginScripts/plugin-render-texture.py:199 msgid "Ratio of size of new image to source selection" @@ -158,24 +174,24 @@ msgstr "Görüntüyü genişlet ve keskinleştirmek için sentezle." # Menü öğesi olduğu için başlık düzeni tercih edildi. #: PluginScripts/plugin-resynth-enlarge.py:97 -msgid "Enlarge & sharpen..." -msgstr "Genişlet ve Keskinleştir..." +msgid "_Enlarge & sharpen(scm)..." +msgstr "Genişlet ve Keskinleştir(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 -msgid "Scale by:" -msgstr "Ölçek boyut:" +msgid "Scale by" +msgstr "Ölçek boyut" #: PluginScripts/plugin-resynth-fill-pattern.py:100 msgid "Seamlessly fill with a pattern using synthesis." msgstr "Sentezleme kullanarak desenle dikişsiz doldur." #: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless..." -msgstr "_Desenle Dikişsiz Doldur..." +msgid "_Fill with pattern seamless(scm)..." +msgstr "Desenle Dikişsiz Doldur(scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 -msgid "Pattern:" -msgstr "Desen:" +msgid "Pattern" +msgstr "Desen" #: PluginScripts/plugin-resynth-sharpen.py:94 msgid "Sharpen image by synthesis." @@ -183,12 +199,12 @@ msgstr "Sentezleyerek resmi keskinleştir." # Menü öğesi olduğu için başlık düzeni tercih edildi. #: PluginScripts/plugin-resynth-sharpen.py:99 -msgid "Sharpen by synthesis..." -msgstr "Sentezleyerek Keskinleştir..." +msgid "_Sharpen by synthesis(scm)..." +msgstr "Sentezleyerek Keskinleştir(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 -msgid "Sharpening:" -msgstr "Keskinleştirme:" +msgid "Sharpening" +msgstr "Keskinleştirme" #: PluginScripts/plugin-uncrop.py:86 msgid "A layer must be active, not a channel." @@ -205,8 +221,8 @@ msgstr "" "Mümkünse bunun yerine bir Kırpmayı geri alın! " #: PluginScripts/plugin-uncrop.py:147 -msgid "Uncrop..." -msgstr "Kırpmayı Kaldır..." +msgid "_Uncrop(scm)..." +msgstr "Kırpmayı Kaldır(scm)..." # Yerine uygun çeviri yapıldı. #: PluginScripts/plugin-uncrop.py:152 @@ -347,7 +363,7 @@ msgstr "" #: src/resynthesizer-gui/resynth-gui.h:331 msgid "Neighbourhood size:" -msgstr "Komşuluk boyutu:" +msgstr "Komşuluk boyutu" #: src/resynthesizer-gui/resynth-gui.h:334 msgid "- How many nearby pixels in the output are to be used?\n" @@ -363,7 +379,7 @@ msgstr "- Girdide kaç konum incelenecek?\n" #: src/resynthesizer-gui/resynth-gui.h:341 msgid "Sensitivity to outliers:" -msgstr "Aykırı değerlere duyarlılık:" +msgstr "Aykırı değerlere duyarlılık" #: src/resynthesizer-gui/resynth-gui.h:344 msgid "" From a6941bbaf8f87cc652686619582c86dbc73b064c Mon Sep 17 00:00:00 2001 From: sabriunal Date: Sat, 29 Oct 2022 17:59:54 +0300 Subject: [PATCH 15/23] Update Turkish and fix some minor issues --- po/tr.po | 217 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 113 insertions(+), 104 deletions(-) diff --git a/po/tr.po b/po/tr.po index 30ce1e7..1ff1ecb 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,7 +1,7 @@ -# Turkish translation for GIMP resynthesizer plug-in. +# Turkish translation for GIMP resynthesizer-scm plug-in. # -# Copyright (C) 2022 GIMP resynthesizer plug-in's COPYRIGHT HOLDER -# This file is distributed under the same license as the GIMP resynthesizer plug-in package. +# Copyright (C) 2022 GIMP resynthesizer-scm plug-in's COPYRIGHT HOLDER +# This file is distributed under the same license as the GIMP resynthesizer-scm plug-in package. # # Sabri Ünal , 2022. # @@ -11,10 +11,10 @@ # msgid "" msgstr "" -"Project-Id-Version: GIMP resynthesizer plugin master\n" -"Report-Msgid-Bugs-To: https://github.com/bootchk/resynthesizer\n" -"POT-Creation-Date: 2022-08-29 12:22+0300\n" -"PO-Revision-Date: 2022-08-29 12:22+0300\n" +"Project-Id-Version: GIMP resynthesizer-scm plugin\n" +"Report-Msgid-Bugs-To: https://github.com/itr-tert/gimp-resynthesizer-scm\n" +"POT-Creation-Date: 2022-10-29 17:51+0300\n" +"PO-Revision-Date: 2022-10-29 17:54+0300\n" "Last-Translator: Sabri Ünal \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -24,68 +24,86 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.1.1\n" "X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: _;NC_;G_;N_\n" +"X-Poedit-KeywordsList: _;C_;NC_;G_;N_;SG_\n" "X-Poedit-SearchPath-0: PluginScripts\n" -"X-Poedit-SearchPath-1: src/resynthesizer-gui/resynth-gui.c\n" -"X-Poedit-SearchPath-2: src/resynthesizer-gui/resynth-gui.h\n" -"X-Poedit-SearchPath-3: src/resynthesizer/resynthesizer.c\n" +"X-Poedit-SearchPath-1: src\n" -#: PluginScripts/plugin-heal-selection.py:42 +#: PluginScripts/plugin-heal-selection.scm:84 msgid "You must first select a region to heal." msgstr "İyileşmek için önce bir bölge seçmelisiniz." -#: PluginScripts/plugin-heal-selection.py:157 +# Menü Öğesi olduğu için başlık düzeni +#: PluginScripts/plugin-heal-selection.scm:228 +msgid "_Heal selection(scm)..." +msgstr "Seçimi _İyileştir (scm)..." + +#: PluginScripts/plugin-heal-selection.scm:231 msgid "Heal the selection from surroundings as if using the heal tool." msgstr "" "İyileştirme aracını kullanıyormuş gibi seçimi çervesindekilerle iyileştir." -# Menü Öğesi olduğu için başlık düzeni -#: PluginScripts/plugin-heal-selection.py:162 -msgid "_Heal selection(scm)..." -msgstr "Seçimi İyileştir(scm)..." - -#: PluginScripts/plugin-heal-selection.py:167 -#: PluginScripts/plugin-heal-transparency.py:82 +#: PluginScripts/plugin-heal-selection.scm:232 +#: PluginScripts/plugin-heal-transparency.scm:83 +#: PluginScripts/plugin-map-style.scm:394 +#: PluginScripts/plugin-render-texture.scm:251 +#: PluginScripts/plugin-resynth-enlarge.scm:113 +#: PluginScripts/plugin-resynth-fill-pattern.scm:111 +#: PluginScripts/plugin-resynth-sharpen.scm:114 +#: PluginScripts/plugin-uncrop.scm:244 +msgid "Requires separate resynthesizer plugin." +msgstr "Ayrı yeniden sentezleyici eklentisi gerektirir." + +#: PluginScripts/plugin-heal-selection.scm:244 +#: PluginScripts/plugin-heal-transparency.scm:95 msgid "Context sampling width (pixels)" msgstr "Bağlam örnekleme genişliği (piksel)" -#: PluginScripts/plugin-heal-selection.py:168 +#: PluginScripts/plugin-heal-selection.scm:252 msgid "Sample from" msgstr "Örnek kaynağı" -#: PluginScripts/plugin-heal-selection.py:168 +#: PluginScripts/plugin-heal-selection.scm:253 msgid "All around" msgstr "Her yönden" -#: PluginScripts/plugin-heal-selection.py:168 +#: PluginScripts/plugin-heal-selection.scm:254 msgid "Sides" msgstr "Yanlar" -#: PluginScripts/plugin-heal-selection.py:168 +#: PluginScripts/plugin-heal-selection.scm:255 msgid "Above and below" msgstr "Üst ve alt" -#: PluginScripts/plugin-heal-selection.py:169 -#: PluginScripts/plugin-heal-transparency.py:83 +#: PluginScripts/plugin-heal-selection.scm:256 +#: PluginScripts/plugin-heal-transparency.scm:105 msgid "Filling order" msgstr "Doldurma sırası" -#: PluginScripts/plugin-heal-selection.py:169 -#: PluginScripts/plugin-heal-transparency.py:83 +#: PluginScripts/plugin-heal-selection.scm:257 +#: PluginScripts/plugin-heal-transparency.scm:106 msgid "Random" msgstr "Rastgele" -#: PluginScripts/plugin-heal-selection.py:170 -#: PluginScripts/plugin-heal-transparency.py:84 +#: PluginScripts/plugin-heal-selection.scm:258 +#: PluginScripts/plugin-heal-transparency.scm:107 msgid "Inwards towards center" msgstr "Merkeze doğru" -#: PluginScripts/plugin-heal-selection.py:170 -#: PluginScripts/plugin-heal-transparency.py:84 +#: PluginScripts/plugin-heal-selection.scm:259 +#: PluginScripts/plugin-heal-transparency.scm:108 msgid "Outwards from center" msgstr "Merkezden dışa doğru" -#: PluginScripts/plugin-heal-transparency.py:72 +#: PluginScripts/plugin-heal-transparency.scm:40 +msgid "The active layer has no alpha channel to heal." +msgstr "Etkin katman iyileştirilecek alfa kanalı içermiyor." + +# Menü Öğesi olduğu için başlık düzeni +#: PluginScripts/plugin-heal-transparency.scm:79 +msgid "_Heal transparency(scm)..." +msgstr "Saydamlık _İyileştir (scm)..." + +#: PluginScripts/plugin-heal-transparency.scm:82 msgid "" "Removes alpha channel by synthesis. Fill outward for edges, inward for " "holes." @@ -93,20 +111,16 @@ msgstr "" "Sentezleme yoluyla alfa kanalını kaldır. Kenarlar için dışa, delikler için " "içe doğru doldur." -# Menü Öğesi olduğu için başlık düzeni -#: PluginScripts/plugin-heal-transparency.py:77 -msgid "_Heal transparency(scm)..." -msgstr "Saydamlık İyileştir(scm)..." - -#: PluginScripts/plugin-heal-transparency.scm:40 -msgid "The active layer has no alpha channel to heal." -msgstr "" - -#: PluginScripts/plugin-map-style.py:281 +#: PluginScripts/plugin-map-style.scm:272 msgid "The style source cannot be of mode INDEXED" msgstr "Biçem kaynağı İNDEKLİ kipte olamaz" -#: PluginScripts/plugin-map-style.py:376 +# Menü öğesi +#: PluginScripts/plugin-map-style.scm:389 +msgid "_Style(scm)..." +msgstr "_Biçem (scm)..." + +#: PluginScripts/plugin-map-style.scm:392 msgid "" "Transfer style (color and surface) from a chosen source to the active layer. " msgstr "Seçilen kaynaktan aktif katmana biçem (renk ve yüzey) aktar." @@ -117,32 +131,31 @@ msgid "" "synthesizes texture or theme from one image onto another. " msgstr "" -# Menü öğesi -#: PluginScripts/plugin-map-style.py:381 -msgid "_Style(scm)..." -msgstr "Biçem(scm)..." - -#: PluginScripts/plugin-map-style.py:386 +#: PluginScripts/plugin-map-style.scm:406 msgid "Source of style" msgstr "Biçem kaynağı" -#: PluginScripts/plugin-map-style.py:387 +#: PluginScripts/plugin-map-style.scm:407 msgid "Percent transfer" msgstr "Aktarım yüzdesi" -#: PluginScripts/plugin-map-style.py:388 +#: PluginScripts/plugin-map-style.scm:415 msgid "Map by" msgstr "Eşlem ölçütü" -#: PluginScripts/plugin-map-style.py:388 +#: PluginScripts/plugin-map-style.scm:416 msgid "Color and brightness" msgstr "Renk ve parlaklık" -#: PluginScripts/plugin-map-style.py:388 +#: PluginScripts/plugin-map-style.scm:417 msgid "Brightness only" msgstr "Sadece parlaklık" -#: PluginScripts/plugin-render-texture.py:188 +#: PluginScripts/plugin-render-texture.scm:246 +msgid "_Texture(scm)..." +msgstr "_Doku (scm)..." + +#: PluginScripts/plugin-render-texture.scm:249 msgid "" "Create a new image with texture from the current image or selection. " "Optionally, create image edges suited for further, seamless tiling. " @@ -156,85 +169,81 @@ msgid "" "less randomness. Use 'Edit>Fill resynthesized pattern' for more randomness. " msgstr "" -#: PluginScripts/plugin-render-texture.py:193 -msgid "_Texture(scm)..." -msgstr "Doku(scm)..." - -#: PluginScripts/plugin-render-texture.py:199 +#: PluginScripts/plugin-render-texture.scm:264 msgid "Ratio of size of new image to source selection" msgstr "Yeni görüntünün boyutunun kaynak seçimine oranı" -#: PluginScripts/plugin-render-texture.py:200 +#: PluginScripts/plugin-render-texture.scm:271 msgid "Make new image edges suitable for seamless tiling" msgstr "Dikişsiz döşeme için yeni görüntü kenarlarını uygun hale getir" -#: PluginScripts/plugin-resynth-enlarge.py:92 -msgid "Enlarge image and synthesize to sharpen." -msgstr "Görüntüyü genişlet ve keskinleştirmek için sentezle." - # Menü öğesi olduğu için başlık düzeni tercih edildi. -#: PluginScripts/plugin-resynth-enlarge.py:97 +#: PluginScripts/plugin-resynth-enlarge.scm:109 msgid "_Enlarge & sharpen(scm)..." -msgstr "Genişlet ve Keskinleştir(scm)..." +msgstr "_Genişlet ve Keskinleştir (scm)..." -#: PluginScripts/plugin-resynth-enlarge.py:102 +#: PluginScripts/plugin-resynth-enlarge.scm:112 +msgid "Enlarge image and synthesize to sharpen." +msgstr "Görüntüyü genişlet ve keskinleştirmek için sentezle." + +#: PluginScripts/plugin-resynth-enlarge.scm:125 msgid "Scale by" msgstr "Ölçek boyut" -#: PluginScripts/plugin-resynth-fill-pattern.py:100 +#: PluginScripts/plugin-resynth-fill-pattern.scm:107 +msgid "_Fill with pattern seamless(scm)..." +msgstr "Desenle Dikişsiz Doldur (scm)..." + +#: PluginScripts/plugin-resynth-fill-pattern.scm:110 msgid "Seamlessly fill with a pattern using synthesis." msgstr "Sentezleme kullanarak desenle dikişsiz doldur." -#: PluginScripts/plugin-resynth-fill-pattern.py:105 -msgid "_Fill with pattern seamless(scm)..." -msgstr "Desenle Dikişsiz Doldur(scm)..." - -#: PluginScripts/plugin-resynth-fill-pattern.py:110 +#: PluginScripts/plugin-resynth-fill-pattern.scm:123 msgid "Pattern" msgstr "Desen" -#: PluginScripts/plugin-resynth-sharpen.py:94 -msgid "Sharpen image by synthesis." -msgstr "Sentezleyerek resmi keskinleştir." - # Menü öğesi olduğu için başlık düzeni tercih edildi. -#: PluginScripts/plugin-resynth-sharpen.py:99 +#: PluginScripts/plugin-resynth-sharpen.scm:110 msgid "_Sharpen by synthesis(scm)..." -msgstr "Sentezleyerek Keskinleştir(scm)..." +msgstr "Sentezleyerek _Keskinleştir (scm)..." -#: PluginScripts/plugin-resynth-sharpen.py:103 +#: PluginScripts/plugin-resynth-sharpen.scm:113 +msgid "Sharpen image by synthesis." +msgstr "Sentezleyerek resmi keskinleştir." + +#: PluginScripts/plugin-resynth-sharpen.scm:126 msgid "Sharpening" msgstr "Keskinleştirme" -#: PluginScripts/plugin-uncrop.py:86 +#: PluginScripts/plugin-uncrop.scm:166 msgid "A layer must be active, not a channel." msgstr "Bir kanal değil, bir katman etkin olmalıdır." -#: PluginScripts/plugin-uncrop.py:142 +#: PluginScripts/plugin-uncrop.scm:240 +msgid "_Uncrop(scm)..." +msgstr "_Kırpmayı Kaldır (scm)..." + +#: PluginScripts/plugin-uncrop.scm:243 msgid "" "Enlarge image by synthesizing a border that matches the edge, maintaining " "perspective. Works best for small enlargement of natural edges. Undo a Crop " -"instead, if possible! " +"instead, if possible!" msgstr "" -"Perspektifi koruyarak kenarla eşleşen kenarlık sentezleyerek görüntüyü " +"Perspektifi koruyarak, kenarla eşleşen kenarlık sentezleyerek görüntüyü " "büyüt. Doğal kenarların küçük genişletmelerinde en iyi sonucu verir. " -"Mümkünse bunun yerine bir Kırpmayı geri alın! " - -#: PluginScripts/plugin-uncrop.py:147 -msgid "_Uncrop(scm)..." -msgstr "Kırpmayı Kaldır(scm)..." +"Mümkünse bunun yerine Kırpmayı geri alın!" # Yerine uygun çeviri yapıldı. -#: PluginScripts/plugin-uncrop.py:152 +#: PluginScripts/plugin-uncrop.scm:256 msgid "Percent enlargement" msgstr "Genişletme yüzdesi" -#: src/resynthesizer-gui/resynth-gui.c:156 +#: src/resynthesizer-gui/resynth-gui.c:153 msgid "Make tiles, apply themes, render texture, remove features, etc." msgstr "" "Döşeme yapın, temalar uygulayın, doku işleyin, özellikleri kaldırın, vb." -#: src/resynthesizer-gui/resynth-gui.c:161 +#: src/resynthesizer-gui/resynth-gui.c:158 msgid "_Resynthesize..." msgstr "_Yeniden Sentezle..." @@ -363,7 +372,7 @@ msgstr "" #: src/resynthesizer-gui/resynth-gui.h:331 msgid "Neighbourhood size:" -msgstr "Komşuluk boyutu" +msgstr "Komşuluk boyutu:" #: src/resynthesizer-gui/resynth-gui.h:334 msgid "- How many nearby pixels in the output are to be used?\n" @@ -379,7 +388,7 @@ msgstr "- Girdide kaç konum incelenecek?\n" #: src/resynthesizer-gui/resynth-gui.h:341 msgid "Sensitivity to outliers:" -msgstr "Aykırı değerlere duyarlılık" +msgstr "Aykırı değerlere duyarlılık:" #: src/resynthesizer-gui/resynth-gui.h:344 msgid "" @@ -388,45 +397,45 @@ msgid "" msgstr "" "- Tek pikseldeki kaç kötü eşleşme, bir konumu ne ölçüde gözden düşürür?\n" -#: src/resynthesizer/resynthesizer.c:350 +#: src/resynthesizer/resynthesizer.c:345 msgid "Incompatible image mode." msgstr "Uyumsuz görüntü kipi." -#: src/resynthesizer/resynthesizer.c:373 +#: src/resynthesizer/resynthesizer.c:368 msgid "Resynthesizer failed to get parameters." msgstr "Yeniden sentezleyici parametreleri alamadı." -#: src/resynthesizer/resynthesizer.c:388 +#: src/resynthesizer/resynthesizer.c:383 msgid "" "The input texture and output image must have the same number of color " "channels." msgstr "" "Girdi dokusu ve çıktı görüntüsü aynı sayıda renk kanalına sahip olmalıdır." -#: src/resynthesizer/resynthesizer.c:407 +#: src/resynthesizer/resynthesizer.c:402 msgid "The input and output maps must have the same mode" msgstr "Girdi ve çıktı eşlemleri aynı kipte olmalıdır" -#: src/resynthesizer/resynthesizer.c:412 +#: src/resynthesizer/resynthesizer.c:407 msgid "The input map should be the same size as the input texture image" msgstr "Girdi eşlemi, girdi dokusu görüntüsüyle aynı boyutta olmalıdır" -#: src/resynthesizer/resynthesizer.c:417 +#: src/resynthesizer/resynthesizer.c:412 msgid "The output map should be the same size as the output image" msgstr "Çıktı eşlemi çıktı görüntüsüyle aynı boyutta olmalıdır" -#: src/resynthesizer/resynthesizer.c:503 +#: src/resynthesizer/resynthesizer.c:498 msgid "synthesizing..." msgstr "sentezleniyor..." -#: src/resynthesizer/resynthesizer.c:517 +#: src/resynthesizer/resynthesizer.c:512 msgid "" "The texture source is empty. Does any selection include non-transparent " "pixels?" msgstr "" "Doku kaynağı boş. Herhangi bir seçim saydam olmayan pikseller içeriyor mu?" -#: src/resynthesizer/resynthesizer.c:521 +#: src/resynthesizer/resynthesizer.c:516 msgid "" "The output layer is empty. Does any selection have visible pixels in the " "active layer?" From 8b72d8c697ce077024bb34a72e5fec848bdb7a03 Mon Sep 17 00:00:00 2001 From: itr tert Date: Sun, 30 Oct 2022 00:35:55 +0900 Subject: [PATCH 16/23] Restore deleted accelerator specifiers. Add accelerator specifiers to Japanese. Minor Fix to Turkish translation format. --- po/es.po | 2 +- po/fr.po | 16 ++++++++-------- po/ja.po | 18 +++++++++--------- po/pt_BR.po | 14 +++++++------- po/ru.po | 16 ++++++++-------- po/tr.po | 18 +++++++++--------- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/po/es.po b/po/es.po index 4aac3fc..f399a0c 100644 --- a/po/es.po +++ b/po/es.po @@ -32,7 +32,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "Sintetiza seleccion(scm)..." +msgstr "_Sintetiza seleccion(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 diff --git a/po/fr.po b/po/fr.po index 1f50d62..631a7ea 100644 --- a/po/fr.po +++ b/po/fr.po @@ -32,7 +32,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "Corriger la sélection(scm)..." +msgstr "_Corriger la sélection(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 @@ -85,7 +85,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "Corriger la transparence(scm)..." +msgstr "_Corriger la transparence(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -106,7 +106,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "Style(scm)..." +msgstr "_Style(scm)..." #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -144,7 +144,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "Texture(scm)..." +msgstr "_Texture(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -160,7 +160,7 @@ msgstr "Agrandir l'image et synthétiser pour augmenter la netteté." #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "Agrandir et augmenter la netteté(scm)..." +msgstr "_Agrandir et augmenter la netteté(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -172,7 +172,7 @@ msgstr "Remplir avec un motif raccordable en utilisant la synthèse." #: PluginScripts/plugin-resynth-fill-pattern.py:105 msgid "_Fill with pattern seamless(scm)..." -msgstr "Remplir avec un motif raccordable(scm)..." +msgstr "_Remplir avec un motif raccordable(scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 msgid "Pattern" @@ -184,7 +184,7 @@ msgstr "Augmenter la netteté de l'image par synthèse." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "Augmenter la netteté par synthèse(scm)..." +msgstr "_Augmenter la netteté par synthèse(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -206,7 +206,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "Dérogner(scm)..." +msgstr "_Dérogner(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/ja.po b/po/ja.po index dd4249e..c9e017d 100644 --- a/po/ja.po +++ b/po/ja.po @@ -17,7 +17,7 @@ msgstr "修復する範囲を選択してください。" #: PluginScripts/plugin-heal-selection.scm:228 msgid "_Heal selection(scm)..." -msgstr "選択範囲を修復(scm)..." +msgstr "選択範囲を修復(scm)(_H)..." #: PluginScripts/plugin-heal-selection.scm:231 msgid "Heal the selection from surroundings as if using the heal tool." @@ -81,7 +81,7 @@ msgstr "アクティブレイヤーには修復するためのアルファチャ #: PluginScripts/plugin-heal-transparency.scm:79 msgid "_Heal transparency(scm)..." -msgstr "透過部分を修復(scm)..." +msgstr "透過部分を修復(scm)(_T)..." #: PluginScripts/plugin-heal-transparency.scm:82 msgid "" @@ -95,7 +95,7 @@ msgstr "スタイル(特徴)ソースの画像モードをINDEXEDには出来ま #: PluginScripts/plugin-map-style.scm:389 msgid "_Style(scm)..." -msgstr "スタイル(scm)..." +msgstr "スタイル(scm)(_S)..." #: PluginScripts/plugin-map-style.scm:392 msgid "" @@ -131,7 +131,7 @@ msgstr "輝度のみ" #: PluginScripts/plugin-render-texture.scm:246 msgid "_Texture(scm)..." -msgstr "テクスチャー(scm)..." +msgstr "テクスチャー(scm)(_T)..." #: PluginScripts/plugin-render-texture.scm:249 msgid "" @@ -158,7 +158,7 @@ msgstr "生成画像の端をシームレスに並べられるようにする" #: PluginScripts/plugin-resynth-enlarge.scm:109 msgid "_Enlarge & sharpen(scm)..." -msgstr "拡大して鮮明化(scm)..." +msgstr "拡大して鮮明化(scm)(_E)..." #: PluginScripts/plugin-resynth-enlarge.scm:112 msgid "Enlarge image and synthesize to sharpen." @@ -170,7 +170,7 @@ msgstr "拡大係数" #: PluginScripts/plugin-resynth-fill-pattern.scm:107 msgid "_Fill with pattern seamless(scm)..." -msgstr "シームレスにパターンで塗り潰す(scm)... " +msgstr "シームレスにパターンで塗り潰す(scm)(_S)... " #: PluginScripts/plugin-resynth-fill-pattern.scm:110 msgid "Seamlessly fill with a pattern using synthesis." @@ -182,7 +182,7 @@ msgstr "パターン" #: PluginScripts/plugin-resynth-sharpen.scm:110 msgid "_Sharpen by synthesis(scm)..." -msgstr "合成して鮮明化(scm)..." +msgstr "合成して鮮明化(scm)(_S)..." #: PluginScripts/plugin-resynth-sharpen.scm:113 msgid "Sharpen image by synthesis." @@ -198,7 +198,7 @@ msgstr "画像レイヤーがアクティブである必要があります、ま #: PluginScripts/plugin-uncrop.scm:240 msgid "_Uncrop(scm)..." -msgstr "逆切り抜き(scm)..." +msgstr "逆切り抜き(scm)(_U)..." #: PluginScripts/plugin-uncrop.scm:243 msgid "" @@ -217,7 +217,7 @@ msgstr "タイル化、テーマ適用、テクスチャ下塗り、特徴削除 #: src/resynthesizer-gui/resynth-gui.c:161 msgid "_Resynthesize..." -msgstr "Resynthesize..." +msgstr "_Resynthesize..." #: src/resynthesizer-gui/resynth-gui.h:115 msgid "Context: " diff --git a/po/pt_BR.po b/po/pt_BR.po index 7a9b46c..2eef047 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -33,7 +33,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "Restaurar seleção(scm)..." +msgstr "_Restaurar seleção(scm)..." #: PluginScripts/plugin-heal-selection.py:167 PluginScripts/plugin-heal-transparency.py:82 msgid "Context sampling width (pixels)" @@ -79,7 +79,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "Restaurar transparência(scm)..." +msgstr "_Restaurar transparência(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -97,7 +97,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "Estilo(scm)..." +msgstr "_Estilo(scm)..." #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -135,7 +135,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "Textura(scm)..." +msgstr "_Textura(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -151,7 +151,7 @@ msgstr "Amplie a imagem e sintetize para torná-la mais nítida." #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "Ampliação & nitidez(scm)..." +msgstr "_Ampliação & nitidez(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -175,7 +175,7 @@ msgstr "Aumentar a nitidez da imagem por síntese." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "Nitidez por síntese(scm)..." +msgstr "_Nitidez por síntese(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -196,7 +196,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "Retirar do corte(scm)..." +msgstr "_Retirar do corte(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/ru.po b/po/ru.po index 6ea28ea..f549985 100644 --- a/po/ru.po +++ b/po/ru.po @@ -35,7 +35,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "Восстановить выделение(scm)…" +msgstr "_Восстановить выделение(scm)…" #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 @@ -88,7 +88,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "Восстановить прозрачную область(scm)…" +msgstr "_Восстановить прозрачную область(scm)…" #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -109,7 +109,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "Стиль(scm)…" +msgstr "_Стиль(scm)…" #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -148,7 +148,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "Текстура(scm)…" +msgstr "_Текстура(scm)…" #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -164,7 +164,7 @@ msgstr "Увеличить изображения и повысить резко #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "Увеличить размер и резкость(scm)…" +msgstr "_Увеличить размер и резкость(scm)…" #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -176,7 +176,7 @@ msgstr "Залить текстурой без видимых швов с пом #: PluginScripts/plugin-resynth-fill-pattern.py:105 msgid "_Fill with pattern seamless(scm)..." -msgstr "Залить _бесшовной текстурой(scm)…" +msgstr "_Залить _бесшовной текстурой(scm)…" #: PluginScripts/plugin-resynth-fill-pattern.py:110 msgid "Pattern" @@ -188,7 +188,7 @@ msgstr "Увеличить резкость изображения." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "Увеличить резкость синтезом(scm)…" +msgstr "_Увеличить резкость синтезом(scm)…" #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -210,7 +210,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "Обратное кадрирование(scm)…" +msgstr "_Обратное кадрирование(scm)…" #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/tr.po b/po/tr.po index 30ce1e7..8ca63d7 100644 --- a/po/tr.po +++ b/po/tr.po @@ -42,7 +42,7 @@ msgstr "" # Menü Öğesi olduğu için başlık düzeni #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "Seçimi İyileştir(scm)..." +msgstr "_Seçimi İyileştir (scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 @@ -96,7 +96,7 @@ msgstr "" # Menü Öğesi olduğu için başlık düzeni #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "Saydamlık İyileştir(scm)..." +msgstr "_Saydamlık İyileştir (scm)..." #: PluginScripts/plugin-heal-transparency.scm:40 msgid "The active layer has no alpha channel to heal." @@ -120,7 +120,7 @@ msgstr "" # Menü öğesi #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "Biçem(scm)..." +msgstr "_Biçem (scm)..." #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -158,7 +158,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:193 msgid "_Texture(scm)..." -msgstr "Doku(scm)..." +msgstr "_Doku (scm)..." #: PluginScripts/plugin-render-texture.py:199 msgid "Ratio of size of new image to source selection" @@ -175,7 +175,7 @@ msgstr "Görüntüyü genişlet ve keskinleştirmek için sentezle." # Menü öğesi olduğu için başlık düzeni tercih edildi. #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "Genişlet ve Keskinleştir(scm)..." +msgstr "_Genişlet ve Keskinleştir (scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -187,7 +187,7 @@ msgstr "Sentezleme kullanarak desenle dikişsiz doldur." #: PluginScripts/plugin-resynth-fill-pattern.py:105 msgid "_Fill with pattern seamless(scm)..." -msgstr "Desenle Dikişsiz Doldur(scm)..." +msgstr "_Desenle Dikişsiz Doldur (scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 msgid "Pattern" @@ -200,7 +200,7 @@ msgstr "Sentezleyerek resmi keskinleştir." # Menü öğesi olduğu için başlık düzeni tercih edildi. #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "Sentezleyerek Keskinleştir(scm)..." +msgstr "_Sentezleyerek Keskinleştir (scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -222,7 +222,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "Kırpmayı Kaldır(scm)..." +msgstr "_Kırpmayı Kaldır (scm)..." # Yerine uygun çeviri yapıldı. #: PluginScripts/plugin-uncrop.py:152 @@ -379,7 +379,7 @@ msgstr "- Girdide kaç konum incelenecek?\n" #: src/resynthesizer-gui/resynth-gui.h:341 msgid "Sensitivity to outliers:" -msgstr "Aykırı değerlere duyarlılık" +msgstr "Aykırı değerlere duyarlılık:" #: src/resynthesizer-gui/resynth-gui.h:344 msgid "" From 9f58791ba3bbf53a8490f8c2e5de07c711d190a3 Mon Sep 17 00:00:00 2001 From: itr tert Date: Mon, 31 Oct 2022 18:20:52 +0900 Subject: [PATCH 17/23] Revert "Restore deleted accelerator specifiers." This reverts commit ae8ea64157890371ba23678c1bf5e8e48f7eecef, reversing changes made to a6941bbaf8f87cc652686619582c86dbc73b064c. --- po/es.po | 2 +- po/fr.po | 16 ++++++++-------- po/ja.po | 18 +++++++++--------- po/pt_BR.po | 14 +++++++------- po/ru.po | 16 ++++++++-------- po/tr.po | 3 --- 6 files changed, 33 insertions(+), 36 deletions(-) diff --git a/po/es.po b/po/es.po index f399a0c..4aac3fc 100644 --- a/po/es.po +++ b/po/es.po @@ -32,7 +32,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "_Sintetiza seleccion(scm)..." +msgstr "Sintetiza seleccion(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 diff --git a/po/fr.po b/po/fr.po index 631a7ea..1f50d62 100644 --- a/po/fr.po +++ b/po/fr.po @@ -32,7 +32,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "_Corriger la sélection(scm)..." +msgstr "Corriger la sélection(scm)..." #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 @@ -85,7 +85,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "_Corriger la transparence(scm)..." +msgstr "Corriger la transparence(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -106,7 +106,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "_Style(scm)..." +msgstr "Style(scm)..." #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -144,7 +144,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "_Texture(scm)..." +msgstr "Texture(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -160,7 +160,7 @@ msgstr "Agrandir l'image et synthétiser pour augmenter la netteté." #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "_Agrandir et augmenter la netteté(scm)..." +msgstr "Agrandir et augmenter la netteté(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -172,7 +172,7 @@ msgstr "Remplir avec un motif raccordable en utilisant la synthèse." #: PluginScripts/plugin-resynth-fill-pattern.py:105 msgid "_Fill with pattern seamless(scm)..." -msgstr "_Remplir avec un motif raccordable(scm)..." +msgstr "Remplir avec un motif raccordable(scm)..." #: PluginScripts/plugin-resynth-fill-pattern.py:110 msgid "Pattern" @@ -184,7 +184,7 @@ msgstr "Augmenter la netteté de l'image par synthèse." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "_Augmenter la netteté par synthèse(scm)..." +msgstr "Augmenter la netteté par synthèse(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -206,7 +206,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "_Dérogner(scm)..." +msgstr "Dérogner(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/ja.po b/po/ja.po index c9e017d..dd4249e 100644 --- a/po/ja.po +++ b/po/ja.po @@ -17,7 +17,7 @@ msgstr "修復する範囲を選択してください。" #: PluginScripts/plugin-heal-selection.scm:228 msgid "_Heal selection(scm)..." -msgstr "選択範囲を修復(scm)(_H)..." +msgstr "選択範囲を修復(scm)..." #: PluginScripts/plugin-heal-selection.scm:231 msgid "Heal the selection from surroundings as if using the heal tool." @@ -81,7 +81,7 @@ msgstr "アクティブレイヤーには修復するためのアルファチャ #: PluginScripts/plugin-heal-transparency.scm:79 msgid "_Heal transparency(scm)..." -msgstr "透過部分を修復(scm)(_T)..." +msgstr "透過部分を修復(scm)..." #: PluginScripts/plugin-heal-transparency.scm:82 msgid "" @@ -95,7 +95,7 @@ msgstr "スタイル(特徴)ソースの画像モードをINDEXEDには出来ま #: PluginScripts/plugin-map-style.scm:389 msgid "_Style(scm)..." -msgstr "スタイル(scm)(_S)..." +msgstr "スタイル(scm)..." #: PluginScripts/plugin-map-style.scm:392 msgid "" @@ -131,7 +131,7 @@ msgstr "輝度のみ" #: PluginScripts/plugin-render-texture.scm:246 msgid "_Texture(scm)..." -msgstr "テクスチャー(scm)(_T)..." +msgstr "テクスチャー(scm)..." #: PluginScripts/plugin-render-texture.scm:249 msgid "" @@ -158,7 +158,7 @@ msgstr "生成画像の端をシームレスに並べられるようにする" #: PluginScripts/plugin-resynth-enlarge.scm:109 msgid "_Enlarge & sharpen(scm)..." -msgstr "拡大して鮮明化(scm)(_E)..." +msgstr "拡大して鮮明化(scm)..." #: PluginScripts/plugin-resynth-enlarge.scm:112 msgid "Enlarge image and synthesize to sharpen." @@ -170,7 +170,7 @@ msgstr "拡大係数" #: PluginScripts/plugin-resynth-fill-pattern.scm:107 msgid "_Fill with pattern seamless(scm)..." -msgstr "シームレスにパターンで塗り潰す(scm)(_S)... " +msgstr "シームレスにパターンで塗り潰す(scm)... " #: PluginScripts/plugin-resynth-fill-pattern.scm:110 msgid "Seamlessly fill with a pattern using synthesis." @@ -182,7 +182,7 @@ msgstr "パターン" #: PluginScripts/plugin-resynth-sharpen.scm:110 msgid "_Sharpen by synthesis(scm)..." -msgstr "合成して鮮明化(scm)(_S)..." +msgstr "合成して鮮明化(scm)..." #: PluginScripts/plugin-resynth-sharpen.scm:113 msgid "Sharpen image by synthesis." @@ -198,7 +198,7 @@ msgstr "画像レイヤーがアクティブである必要があります、ま #: PluginScripts/plugin-uncrop.scm:240 msgid "_Uncrop(scm)..." -msgstr "逆切り抜き(scm)(_U)..." +msgstr "逆切り抜き(scm)..." #: PluginScripts/plugin-uncrop.scm:243 msgid "" @@ -217,7 +217,7 @@ msgstr "タイル化、テーマ適用、テクスチャ下塗り、特徴削除 #: src/resynthesizer-gui/resynth-gui.c:161 msgid "_Resynthesize..." -msgstr "_Resynthesize..." +msgstr "Resynthesize..." #: src/resynthesizer-gui/resynth-gui.h:115 msgid "Context: " diff --git a/po/pt_BR.po b/po/pt_BR.po index 2eef047..7a9b46c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -33,7 +33,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "_Restaurar seleção(scm)..." +msgstr "Restaurar seleção(scm)..." #: PluginScripts/plugin-heal-selection.py:167 PluginScripts/plugin-heal-transparency.py:82 msgid "Context sampling width (pixels)" @@ -79,7 +79,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "_Restaurar transparência(scm)..." +msgstr "Restaurar transparência(scm)..." #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -97,7 +97,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "_Estilo(scm)..." +msgstr "Estilo(scm)..." #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -135,7 +135,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "_Textura(scm)..." +msgstr "Textura(scm)..." #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -151,7 +151,7 @@ msgstr "Amplie a imagem e sintetize para torná-la mais nítida." #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "_Ampliação & nitidez(scm)..." +msgstr "Ampliação & nitidez(scm)..." #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -175,7 +175,7 @@ msgstr "Aumentar a nitidez da imagem por síntese." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "_Nitidez por síntese(scm)..." +msgstr "Nitidez por síntese(scm)..." #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -196,7 +196,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "_Retirar do corte(scm)..." +msgstr "Retirar do corte(scm)..." #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/ru.po b/po/ru.po index f549985..6ea28ea 100644 --- a/po/ru.po +++ b/po/ru.po @@ -35,7 +35,7 @@ msgstr "" #: PluginScripts/plugin-heal-selection.py:162 msgid "_Heal selection(scm)..." -msgstr "_Восстановить выделение(scm)…" +msgstr "Восстановить выделение(scm)…" #: PluginScripts/plugin-heal-selection.py:167 #: PluginScripts/plugin-heal-transparency.py:82 @@ -88,7 +88,7 @@ msgstr "" #: PluginScripts/plugin-heal-transparency.py:77 msgid "_Heal transparency(scm)..." -msgstr "_Восстановить прозрачную область(scm)…" +msgstr "Восстановить прозрачную область(scm)…" #: PluginScripts/plugin-map-style.py:281 msgid "The style source cannot be of mode INDEXED" @@ -109,7 +109,7 @@ msgstr "" #: PluginScripts/plugin-map-style.py:381 msgid "_Style(scm)..." -msgstr "_Стиль(scm)…" +msgstr "Стиль(scm)…" #: PluginScripts/plugin-map-style.py:386 msgid "Source of style" @@ -148,7 +148,7 @@ msgstr "" #: PluginScripts/plugin-render-texture.py:188 msgid "_Texture(scm)..." -msgstr "_Текстура(scm)…" +msgstr "Текстура(scm)…" #: PluginScripts/plugin-render-texture.py:194 msgid "Ratio of size of new image to source selection" @@ -164,7 +164,7 @@ msgstr "Увеличить изображения и повысить резко #: PluginScripts/plugin-resynth-enlarge.py:97 msgid "_Enlarge & sharpen(scm)..." -msgstr "_Увеличить размер и резкость(scm)…" +msgstr "Увеличить размер и резкость(scm)…" #: PluginScripts/plugin-resynth-enlarge.py:102 msgid "Scale by" @@ -176,7 +176,7 @@ msgstr "Залить текстурой без видимых швов с пом #: PluginScripts/plugin-resynth-fill-pattern.py:105 msgid "_Fill with pattern seamless(scm)..." -msgstr "_Залить _бесшовной текстурой(scm)…" +msgstr "Залить _бесшовной текстурой(scm)…" #: PluginScripts/plugin-resynth-fill-pattern.py:110 msgid "Pattern" @@ -188,7 +188,7 @@ msgstr "Увеличить резкость изображения." #: PluginScripts/plugin-resynth-sharpen.py:99 msgid "_Sharpen by synthesis(scm)..." -msgstr "_Увеличить резкость синтезом(scm)…" +msgstr "Увеличить резкость синтезом(scm)…" #: PluginScripts/plugin-resynth-sharpen.py:103 msgid "Sharpening" @@ -210,7 +210,7 @@ msgstr "" #: PluginScripts/plugin-uncrop.py:147 msgid "_Uncrop(scm)..." -msgstr "_Обратное кадрирование(scm)…" +msgstr "Обратное кадрирование(scm)…" #: PluginScripts/plugin-uncrop.py:152 msgid "Percent enlargement" diff --git a/po/tr.po b/po/tr.po index 4f209c1..1ff1ecb 100644 --- a/po/tr.po +++ b/po/tr.po @@ -51,9 +51,6 @@ msgstr "" #: PluginScripts/plugin-resynth-sharpen.scm:114 #: PluginScripts/plugin-uncrop.scm:244 msgid "Requires separate resynthesizer plugin." -msgstr "Doku kaynağı: " - -#: src/resynthesizer-gui/resynth-gui.h:278 msgstr "Ayrı yeniden sentezleyici eklentisi gerektirir." #: PluginScripts/plugin-heal-selection.scm:244 From dff12aa638dfaf8a52acc7e82b3ac4897644c427 Mon Sep 17 00:00:00 2001 From: itr tert Date: Tue, 1 Nov 2022 02:00:16 +0900 Subject: [PATCH 18/23] Change .scm scripts installation directory. From "$(prefix)/lib/gimp/2.0/scripts/resynthesizer" to "$(datadir)/gimp/2.0/scripts/resynthesizer-scm" - Move scripts installation location settings from 'Makefile.am' to 'configure.ac'. --- PluginScripts/Makefile.am | 8 +------- configure.ac | 14 ++++++++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/PluginScripts/Makefile.am b/PluginScripts/Makefile.am index f10dac9..832ed82 100644 --- a/PluginScripts/Makefile.am +++ b/PluginScripts/Makefile.am @@ -1,11 +1,5 @@ ## Process this file with automake to produce Makefile.in -## lkk 2011 I hacked this file from gimp../plugins/pygimp/plugins/Makefile.am -## pluginexecdir tells autotools where to install scripts -## scripts tells autotools the list of installable Python language scripts - -pluginexecdir = $(gimpplugindir)/scripts/resynthesizer/ - scripts = \ plugin-heal-selection.scm \ plugin-resynth-sharpen.scm \ @@ -16,6 +10,6 @@ scripts = \ plugin-heal-transparency.scm \ plugin-resynth-fill-pattern.scm -pluginexec_SCRIPTS = $(scripts) +gimpscripts_SCRIPTS = $(scripts) EXTRA_DIST = $(scripts) diff --git a/configure.ac b/configure.ac index fe90d58..91329fa 100644 --- a/configure.ac +++ b/configure.ac @@ -84,13 +84,19 @@ AC_CHECK_FUNCS(bind_textdomain_codeset) dnl Fix for changes in GLib 2.31 AC_CHECK_LIB(gthread-2.0, g_thread_init) -dnl lkk 2011 I copied this from the main gimp configure.in -dnl where $PACKAGE is gimp and gimp_plugin_version is 2.0 -dnl gimpplugindir="$libdir/$PACKAGE/gimp_plugin_version" + gimpplugindir="$libdir/gimp/2.0" +gimpdatadir='${datadir}/gimp/2.0' +dnl Path to install scm scripts . +gimpscriptsdir='$(gimpdatadir)/scripts/resynthesizer-scm' +dnl Path to install locale data. +localedir="${gimpplugindir}/plug-ins/resynthesizer-locale" + AC_SUBST(gimpplugindir) +AC_SUBST(gimpdatadir) +AC_SUBST(gimpscriptsdir) +AC_SUBST(localedir) -localedir="$gimpplugindir/plug-ins/resynthesizer-locale" DATADIR='${datadir}/plugin_name' AC_SUBST(DATADIR) From 295a75fecd7b0e177b0edac593251f844a263e1e Mon Sep 17 00:00:00 2001 From: itr tert Date: Wed, 2 Nov 2022 22:59:02 +0900 Subject: [PATCH 19/23] Clean: Move settings of installation location of help data from each 'Makefile.am' to 'configure.ac' --- configure.ac | 7 +++---- help/en/Makefile.am | 2 +- help/images/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 91329fa..3392447 100644 --- a/configure.ac +++ b/configure.ac @@ -91,15 +91,14 @@ dnl Path to install scm scripts . gimpscriptsdir='$(gimpdatadir)/scripts/resynthesizer-scm' dnl Path to install locale data. localedir="${gimpplugindir}/plug-ins/resynthesizer-locale" +dnl Path to install help data. +helpbasedir='${datadir}/plugin_name/help' AC_SUBST(gimpplugindir) AC_SUBST(gimpdatadir) AC_SUBST(gimpscriptsdir) AC_SUBST(localedir) - -DATADIR='${datadir}/plugin_name' -AC_SUBST(DATADIR) - +AC_SUBST(helpbasedir) AC_MSG_CHECKING([if GTK+ is version 2.7.0 or newer]) if $PKG_CONFIG --atleast-version=2.7.0 gtk+-2.0; then diff --git a/help/en/Makefile.am b/help/en/Makefile.am index 64581a5..458307f 100644 --- a/help/en/Makefile.am +++ b/help/en/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -helpdatadir = $(DATADIR)/help/en +helpdatadir = @helpbasedir@/en helpdata_DATA = \ gimp-help.xml \ diff --git a/help/images/Makefile.am b/help/images/Makefile.am index fee40da..e981c4a 100644 --- a/help/images/Makefile.am +++ b/help/images/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -helpdatadir = $(DATADIR)/help/images +helpdatadir = @helpbasedir@/images helpdata_DATA = \ wilber.png From 5da40b6dde4d56eb166549b953e917a9c3e6282b Mon Sep 17 00:00:00 2001 From: itr tert Date: Thu, 3 Nov 2022 02:47:01 +0900 Subject: [PATCH 20/23] Clean: Move settings of installation location of plugin binaries from each 'Makefile.am' to 'configure.ac' --- configure.ac | 9 ++++++--- src/resynthesizer-gettext/Makefile.am | 2 +- src/resynthesizer-gui/Makefile.am | 2 +- src/resynthesizer/Makefile.am | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 3392447..31a6437 100644 --- a/configure.ac +++ b/configure.ac @@ -85,18 +85,21 @@ dnl Fix for changes in GLib 2.31 AC_CHECK_LIB(gthread-2.0, g_thread_init) -gimpplugindir="$libdir/gimp/2.0" +gimpconfigdir="$libdir/gimp/2.0" gimpdatadir='${datadir}/gimp/2.0' +dnl Path to install binary plugins. +gimppluginsdir="${gimpconfigdir}/plug-ins" dnl Path to install scm scripts . gimpscriptsdir='$(gimpdatadir)/scripts/resynthesizer-scm' dnl Path to install locale data. -localedir="${gimpplugindir}/plug-ins/resynthesizer-locale" +localedir="${gimppluginsdir}/resynthesizer-locale" dnl Path to install help data. helpbasedir='${datadir}/plugin_name/help' -AC_SUBST(gimpplugindir) +AC_SUBST(gimpconfigdir) AC_SUBST(gimpdatadir) AC_SUBST(gimpscriptsdir) +AC_SUBST(gimppluginsdir) AC_SUBST(localedir) AC_SUBST(helpbasedir) diff --git a/src/resynthesizer-gettext/Makefile.am b/src/resynthesizer-gettext/Makefile.am index 012fc67..e9099cb 100644 --- a/src/resynthesizer-gettext/Makefile.am +++ b/src/resynthesizer-gettext/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer_gettext -bindir = $(gimpplugindir)/plug-ins +bindir = @gimppluginsdir@ resynthesizer_gettext_SOURCES = resynthesizer-gettext.c diff --git a/src/resynthesizer-gui/Makefile.am b/src/resynthesizer-gui/Makefile.am index beb70a4..49ce07e 100644 --- a/src/resynthesizer-gui/Makefile.am +++ b/src/resynthesizer-gui/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer_gui -bindir = $(gimpplugindir)/plug-ins +bindir = @gimppluginsdir@ # resynthesizer_gui is plugin that calls resynthesizer plugin resynthesizer_gui_SOURCES = resynth-gui.c diff --git a/src/resynthesizer/Makefile.am b/src/resynthesizer/Makefile.am index 2ab1d7a..51f9fef 100644 --- a/src/resynthesizer/Makefile.am +++ b/src/resynthesizer/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = resynthesizer -bindir = $(gimpplugindir)/plug-ins +bindir = @gimppluginsdir@ # resynthesizer is a GIMP plugin calling libresynthesizer resynthesizer_SOURCES = resynthesizer.c From 5101a92f8e118f5f6dddbd452d172fe1243a11d3 Mon Sep 17 00:00:00 2001 From: itr tert Date: Thu, 3 Nov 2022 03:02:33 +0900 Subject: [PATCH 21/23] Clean: Rename variables used in .ac/.am to match meaning. 'gimpscriptsdir' should refer to GIMP's scripts folder as the name suggests. --- PluginScripts/Makefile.am | 2 +- configure.ac | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PluginScripts/Makefile.am b/PluginScripts/Makefile.am index 832ed82..e662573 100644 --- a/PluginScripts/Makefile.am +++ b/PluginScripts/Makefile.am @@ -10,6 +10,6 @@ scripts = \ plugin-heal-transparency.scm \ plugin-resynth-fill-pattern.scm -gimpscripts_SCRIPTS = $(scripts) +resynthscripts_SCRIPTS = $(scripts) EXTRA_DIST = $(scripts) diff --git a/configure.ac b/configure.ac index 31a6437..fedec26 100644 --- a/configure.ac +++ b/configure.ac @@ -87,10 +87,11 @@ AC_CHECK_LIB(gthread-2.0, g_thread_init) gimpconfigdir="$libdir/gimp/2.0" gimpdatadir='${datadir}/gimp/2.0' +gimpscriptsdir='$(gimpdatadir)/scripts' dnl Path to install binary plugins. gimppluginsdir="${gimpconfigdir}/plug-ins" -dnl Path to install scm scripts . -gimpscriptsdir='$(gimpdatadir)/scripts/resynthesizer-scm' +dnl Path to install scm scripts. +resynthscriptsdir='$(gimpscriptsdir)/resynthesizer-scm' dnl Path to install locale data. localedir="${gimppluginsdir}/resynthesizer-locale" dnl Path to install help data. @@ -99,10 +100,12 @@ helpbasedir='${datadir}/plugin_name/help' AC_SUBST(gimpconfigdir) AC_SUBST(gimpdatadir) AC_SUBST(gimpscriptsdir) +AC_SUBST(resynthscriptsdir) AC_SUBST(gimppluginsdir) AC_SUBST(localedir) AC_SUBST(helpbasedir) + AC_MSG_CHECKING([if GTK+ is version 2.7.0 or newer]) if $PKG_CONFIG --atleast-version=2.7.0 gtk+-2.0; then have_gtk_2_7=yes From 6870e58aee126082f77d79b773396f3e54f78c1d Mon Sep 17 00:00:00 2001 From: itr tert Date: Fri, 11 Nov 2022 14:25:27 +0900 Subject: [PATCH 22/23] Update: Add middle menu labels to translation. Add Resynthesizer-gui to the aggregate menu. --- PluginScripts/plugin-heal-selection.scm | 3 ++- PluginScripts/plugin-heal-transparency.scm | 3 ++- PluginScripts/plugin-map-style.scm | 3 ++- PluginScripts/plugin-render-texture.scm | 3 ++- PluginScripts/plugin-resynth-enlarge.scm | 3 ++- PluginScripts/plugin-resynth-fill-pattern.scm | 3 ++- PluginScripts/plugin-resynth-sharpen.scm | 3 ++- PluginScripts/plugin-uncrop.scm | 4 ++- src/resynthesizer-gui/resynth-gui.c | 25 ++++++++++++++----- 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/PluginScripts/plugin-heal-selection.scm b/PluginScripts/plugin-heal-selection.scm index eba5f7b..131754c 100644 --- a/PluginScripts/plugin-heal-selection.scm +++ b/PluginScripts/plugin-heal-selection.scm @@ -262,7 +262,8 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-heal-selection" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-heal-selection )) diff --git a/PluginScripts/plugin-heal-transparency.scm b/PluginScripts/plugin-heal-transparency.scm index 05d1dae..bdf2565 100644 --- a/PluginScripts/plugin-heal-transparency.scm +++ b/PluginScripts/plugin-heal-transparency.scm @@ -111,7 +111,8 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-heal-transparency" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-heal-transparency )) diff --git a/PluginScripts/plugin-map-style.scm b/PluginScripts/plugin-map-style.scm index 1fb2aa8..1486dc6 100644 --- a/PluginScripts/plugin-map-style.scm +++ b/PluginScripts/plugin-map-style.scm @@ -420,7 +420,8 @@ "/Filters/Map") (script-fu-menu-register "script-fu-map-style" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-map-style )) diff --git a/PluginScripts/plugin-render-texture.scm b/PluginScripts/plugin-render-texture.scm index 6d86547..7b36f56 100644 --- a/PluginScripts/plugin-render-texture.scm +++ b/PluginScripts/plugin-render-texture.scm @@ -276,7 +276,8 @@ "/Filters/Render") (script-fu-menu-register "script-fu-render-texture" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-render-texture )) \ No newline at end of file diff --git a/PluginScripts/plugin-resynth-enlarge.scm b/PluginScripts/plugin-resynth-enlarge.scm index 85a2aec..17dd1a4 100644 --- a/PluginScripts/plugin-resynth-enlarge.scm +++ b/PluginScripts/plugin-resynth-enlarge.scm @@ -136,7 +136,8 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-enlarge-resynthesized" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-enlarge-resynthesized )) diff --git a/PluginScripts/plugin-resynth-fill-pattern.scm b/PluginScripts/plugin-resynth-fill-pattern.scm index 5f6ab64..678604e 100644 --- a/PluginScripts/plugin-resynth-fill-pattern.scm +++ b/PluginScripts/plugin-resynth-fill-pattern.scm @@ -127,7 +127,8 @@ "/Edit") (script-fu-menu-register "script-fu-fill-pattern-resynth" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-fill-pattern-resynth )) diff --git a/PluginScripts/plugin-resynth-sharpen.scm b/PluginScripts/plugin-resynth-sharpen.scm index d8c2616..2d27d47 100644 --- a/PluginScripts/plugin-resynth-sharpen.scm +++ b/PluginScripts/plugin-resynth-sharpen.scm @@ -137,7 +137,8 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-sharpen-resynthesized" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) script-fu-sharpen-resynthesized )) diff --git a/PluginScripts/plugin-uncrop.scm b/PluginScripts/plugin-uncrop.scm index 02d1c4d..340c145 100644 --- a/PluginScripts/plugin-uncrop.scm +++ b/PluginScripts/plugin-uncrop.scm @@ -266,6 +266,8 @@ "/Filters/Enhance") (script-fu-menu-register "script-fu-uncrop" - "/Filters/Resynthesizer(scm)/") + (string-append "/Filters/" + (SG_"Resynthesizer(scm)"))) + script-fu-uncrop )) \ No newline at end of file diff --git a/src/resynthesizer-gui/resynth-gui.c b/src/resynthesizer-gui/resynth-gui.c index 2130177..709914a 100644 --- a/src/resynthesizer-gui/resynth-gui.c +++ b/src/resynthesizer-gui/resynth-gui.c @@ -138,16 +138,23 @@ static void run( } /* Register plugin to Procedural DataBase */ -static void -query() +static void +query() { /* resynth_paramdefs defined in resynth-parameters.h */ GimpParamDef *return_vals = NULL; gint nargs = sizeof(resynth_paramdefs)/sizeof(resynth_paramdefs[0]); gint nreturn_vals = 0; + /* Initialize i18n support */ + bindtextdomain (GETTEXT_PACKAGE, get_resynthesizer_locale_dir()); +#ifdef HAVE_BIND_TEXTDOMAIN_CODESET + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif + textdomain (GETTEXT_PACKAGE); + gimp_plugin_domain_register (RESYNTH_DOMAIN_NAME, get_resynthesizer_locale_dir()); - + gimp_install_procedure( RESYNTH_CONTROLS_PDB_NAME, N_("Make tiles, apply themes, render texture, remove features, etc."), @@ -155,13 +162,19 @@ query() "Paul Francis Harrison, Lloyd Konneker", "2000 Paul Francis Harrison, 2010 Lloyd Konneker", "2010", - N_("_Resynthesize..."), + N_("_Resynthesize..."), "RGB*, GRAY*", GIMP_PLUGIN, nargs, nreturn_vals, resynth_paramdefs, return_vals); - - gimp_plugin_menu_register(RESYNTH_CONTROLS_PDB_NAME, "/Filters/Map"); + + gimp_plugin_menu_register(RESYNTH_CONTROLS_PDB_NAME, "/Filters/Map"); + gchar *menupath = g_strconcat("/Filters/", + _("Resynthesizer(scm)"), + "​", // zero width space to suppress translation + NULL); + gimp_plugin_menu_register(RESYNTH_CONTROLS_PDB_NAME, menupath); + g_free(menupath); } From 38273750359a0e56802baf68619ef490c2088c17 Mon Sep 17 00:00:00 2001 From: samontab Date: Tue, 8 Aug 2023 20:31:14 +1000 Subject: [PATCH 23/23] Add build instructions --- README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 25c9ccc..61db6a1 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,10 @@ -# GIMP Resynthesizer without Python -## about scm version -[see wiki/README](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/README) - -## Installation -[Wiki:Download and Install: GIMP resynthesizer scm](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/Download-and-Install:-GIMP-resynthesizer-scm) - -[Download: .zip file for Windows](https://github.com/itr-tert/gimp-resynthesizer-scm-download/raw/main/gimp-resynthesizer-scm-win.zip) - -[Download: .deb for amd64 Debian/Ubuntu, GNU/Linux](https://github.com/itr-tert/gimp-resynthesizer-scm-download/raw/main/gimp-resynthesizer-scm.deb) - ----- - # GIMP Resynthesizer Plugin Suite A set of plugins for the GIMP image editing app. - Copyright 2000 2008 Paul Francis Harrison - Copyright 2002 Laurent Despeyroux - Copyright 2002 David Rodríguez García + Copyright 2000 2008 Paul Francis Harrison + Copyright 2002 Laurent Despeyroux + Copyright 2002 David Rodríguez García Copyright 2010-2021 Lloyd Konneker [![Build Status](https://travis-ci.org/bootchk/resynthesizer.svg?branch=master)](https://travis-ci.org/bootchk/resynthesizer) @@ -47,6 +34,15 @@ More topics are in the [Resynthesizer wiki](https://github.com/bootchk/resynthes [build from source](https://github.com/bootchk/resynthesizer/wiki/Build-Resynthesizer-from-source) +Build instructions for Ubuntu users with gimp installed with **apt-get install gimp**. This will install the plugins and scripts in the correct folders. +``` +./autogen.sh +./configure --prefix='/usr' +make +sudo make install +``` + + ## Acknowledgements Paul Harrison had the original idea and implementation. He did the hard work, took the leap of faith and experimented with a new algorithm. His [website](http://www.logarithmic.net/pfh/) has many examples of using the Resynthesizer, links to an explanation of the algorithm, and other cool ideas. @@ -55,6 +51,9 @@ I fixed a few bugs (due to changes in GIMP), rewrote the Scheme plugins into Pyt Rob Antonishen contributed the basis for one plugin. Several people have helped with the build process and with translations. +Heal Selection and other scripts were changed to TinyScheme (aka script-fu) from Python by itr-tert to allow their usage before GIMP 3. [see their wiki/README](https://github.com/itr-tert/gimp-resynthesizer-scm/wiki/README) + + ## License GNU General Public License v3.0