It is currently Wed Jul 24, 2024 6:29 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 5:56 am  (#21) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
For anyone having problems with the python version of this script, I went ahead and duplicated it in scheme for max compatibility. ;)

Rod, let me know if you get an error in GIMP 2.6.x and I can fix. I don't have 2.6.x handy at the moment.

Just delete the .py script from the plug-ins folder (to avoid duplicate menu entries) and place the attached scheme script in the scripts folder.

Updated script moved to this post.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 7:10 am  (#22) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14728
Location: USA
Thanks Tux.
I am getting an error with the SCM but not sure what it is.
Can you tell me the steps to perform before running the filter?
I ran it like this
1) Opened my Image
2) Selected the image layer.
3) Made a selection (elliptic) on the image.
4) Ran the filter expecting to get a new shrunk , inverted , copied selection on a new layer and then the Gaussian blur dialog with the default script values. Instead i got no response at all. No glauss dialog, no new layer.

EDIT: Looks like i may have found the problem the PDB for GIMP-2.6 calls for an INT32 for levels "HISTOGRAM-VALUE" so i replaced it with a "0"
Refreshing now.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 7:30 am  (#23) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
OK, but after step 3, you need to copy or cut, then select the target layer/image, then click Edit/Feather Paste.

It will pull up the gauss blur dialog. Before running the blur, you can move the pasted layer around (as shown in the video posted earlier).

It's basically just an alternate paste, which allows you to blur the edges, previewing the blur amount by viewing the mask in the gauss plug-in's preview window.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 7:38 am  (#24) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14728
Location: USA
Working now (following the correct steps). :)

Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 6:07 pm  (#25) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
:bump :bump
Thanks Tux,

ok, I downloaded the scm and deleted the .py, I opened an image, I selected her right eye... I went to edit/copy, then ran the script at 275 blur. with the pasted copy selected, (not the mask). I ended up with the original layer but no blur. The blur did show up in the preview. my xcf is below in attachments and my selection here.
If I had the blur set at 275, wouldn't that eye be almost fully blurred?
Image


I watched Rich's video 4 times and I did the same as he did.
Rod, how did you end up with a blank transparent layer?


Attachments:
maggie-in shadowblur.xcf [5.15 MiB]
Downloaded 56 times

_________________
Image
Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Sun Jan 19, 2014 10:58 pm  (#26) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
GnuTux could you add a 'Keep Layers' option to allow for further editing of the pasted layer
(such as opacity and merging mode e.t.c.)
other than that I prefer the .scm file as I was thinking of doing the same thing
Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 7:22 am  (#27) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14728
Location: USA
molly wrote:
Rod, how did you end up with a blank transparent layer?


I created that myself. I assumed the script would need it. :oops:

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 7:29 am  (#28) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Well, I did it the way it showed in Rich's vid and the preview came up and showed the large blur, but when I executed the script, it didn't blur the selection. I keep going back to the vid and I know I did it exactly the way Rich did. This is what I am trying to find out, what I seemed to have missed.

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 7:39 am  (#29) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
molly wrote:
:bump :bump
Thanks Tux,

ok, I downloaded the scm and deleted the .py, I opened an image, I selected her right eye... I went to edit/copy, then ran the script at 275 blur. with the pasted copy selected, (not the mask). I ended up with the original layer but no blur. The blur did show up in the preview. my xcf is below in attachments and my selection here.
If I had the blur set at 275, wouldn't that eye be almost fully blurred?
[ Image ]


I watched Rich's video 4 times and I did the same as he did.
Rod, how did you end up with a blank transparent layer?


Molly, I guess you can't see the blur if you try to paste the blurred selection on exactly the same image.
It's just my guess, but I can tell you that I downloaded your image, duplicated it, SCALED it, then feathered-pasted into the SCALED one and it worked, while trying to feather-paste on the duplicated image without scaling it didn't work.
Don't know why, I'm not a technician

edit: made some other test
it works also on a duplicated not rescaled image, BUT NOT WITH THE SO HUGE VALUE you entered;
your value practically CLEARS (FADE OUT) THE WHOLE SELECTION, try with 150 for instance...

_________________
"Where am I ?"


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 8:38 am  (#30) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
@Molly - I'll bet what you missed is the deselection after the copy, which happens fast on that video.If you try to Feather Paste the copy back into the same image with the selection in place, it doesn't feather because you're limited by the boundaries of the selection.

@Graechan & Rod - I wonder if it would be better to have two menu options. Something like Feather Paste (merge) & Feather Paste (keep layers) or just have another pop-up before/after the Blur popup, where you select to merge or not. Which would be better?

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 8:40 am  (#31) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you dinasset and Tux.
I will give that a try, I didn't move it the way Rich did, I just ran the script so the eye would stay in the same place but it would be blurred. Actually, I was just trying to see what this script could do.
I knew I did something wrong, but just didn't figure out what.... :teeth
Ok, tried it on the calla lily on the right, I wanted to make a blurred copy of that to make a third blurred lily.
Image

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 8:56 am  (#32) 
Offline
New Member

Joined: Jan 19, 2014
Posts: 3
Hi folks -

I am th e original author of this script - having read the various posts, I have a few things to comment over:
1) it was writen as a request for a feature from sircrow on the GIMP users mailing list: the idea was to be able to see visually the amount of feathering on the border before pasting something
2) I figured out that with the _new_ style for plug-ins, that is in GIMP unstable (2.9) - where some of the plug-ins are replaced by GEGL operations which always have a live preview on the image, it would be possible to do what was asked for - that is, a pasted image wuld appear, and one would change the mask feathering in an interactive way before consolidating the paste.
3) However, even in gimp 2.9, there are no PDB calls for the new style plug-ins. So I had to call the traditional gaussian-blur for the pasted-layer mask. That does not allow for the interactive control that was asked for - as soons as we have a way to call interatictivelly the new gaussian blur from a plug-in, this script should be better.
4) Maybe the script should not merge the pasted layer down. Just leaving it as a new layer would offer much greater control, allowing one to position it after the blur is done (not just while the dialog is open),and fine tune the mask afterwards, with curves or hand painting. One can have that behavior now if he will just comment out the call to pdb.gimp_image_merge_down (putting a "#" in front of the line with the call for those who don't know Python)


and now, for the part I am interessed in:

the plug-in SHOULD run in windows, even with the "ã" in my name - if there are no blank lines inserted on the top of the script. So, if the line that goes "# coding: utf-8" is indeed the second (or the first) line of code, and the script gives out "unicode-decode error", I'd like to hear from you - that would mean there is an error in the way Python is being packaged on the Windows installers for GIMP.


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 9:09 am  (#33) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Hi Gwidion,
on the last sentence: in my environment (gimp 2.8 under windows 7 32-bits) characters like the one in your first name are not accepted, I don't get an error, simply the plug-in does not show in the menu; NOTE that the same thing happens also with italian accented characters (like: è é à ò ì ù) also if in a comment line (I am an Italian and I wrote some small python scripts and I made the "error" of putting comments in italian, having accented chars...); this means that is the parser of the python scripts which does not accept those

_________________
"Where am I ?"


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 9:16 am  (#34) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Hi Gwidion,
I too would find that very helpful to have the script work on a new layer, then move it to a different position. thanks for sharing your script with us.

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 9:38 am  (#35) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
gwidion wrote:
Hi folks -
I am th e original author of this script -
the plug-in SHOULD run in windows, even with the "ã" in my name - if there are no blank lines inserted on the top of the script. So, if the line that goes "# coding: utf-8" is indeed the second (or the first) line of code, and the script gives out "unicode-decode error", I'd like to hear from you - that would mean there is an error in the way Python is being packaged on the Windows installers for GIMP.


As I said above, my investigations showed that a direct download of your script works perfectly.

However, just copy-pasting the code into a text editor and blindly saving is keeping the non-ansi character in a ANSI encoded file - hence the (invisible) error.

It's not a problem with your script but potentially a problem with using GitHub - You need a "Download" button ;) to prevent anyone from copy-pasting.

Kevin

p.s. You can safely claim compatibility with GIMP 2.6 as it works fine in Gimp 2.6.7


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 10:44 am  (#36) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4758
gwidion wrote:
4) Maybe the script should not merge the pasted layer down. Just leaving it as a new layer would offer much greater control, allowing one to position it after the blur is done (not just while the dialog is open),and fine tune the mask afterwards, with curves or hand painting. One can have that behavior now if he will just comment out the call to pdb.gimp_image_merge_down (putting a "#" in front of the line with the call for those who don't know Python)


This can be done after a plain cut&paste. In fact the original purpose of your script is to avoid this...

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 10:47 am  (#37) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14728
Location: USA
I am running Windows XP 32 bit Home Edition and GIMP-2.8.10.
My problem is that the python filter shows in the Gimp-2.8.10 menu but doesn't work. Even after making the name change. :ninja

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 11:57 am  (#38) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Hi Rod,
I have exactly your same environment.
I installed and used the python version (name changed).
It works.
If this can help, I sent you 3 images:
- a flower image
- a frame image
- the resulting image after doing the following steps:
1.open the flower image
2.fuzzy select the white color
3.invert the selection
4.copy
5.open the frame image
6.click on Edit->Feathered Paste
7.set feather value around 50
8.click OK
You should get the composed image.
Good luck


Attachments:
Folder-for-Rod.7z [389.23 KiB]
Downloaded 52 times

_________________
"Where am I ?"
Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 12:01 pm  (#39) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Rod wrote:
I am running Windows XP 32 bit Home Edition and GIMP-2.8.10.
My problem is that the python filter shows in the Gimp-2.8.10 menu but doesn't work. Even after making the name change. :ninja


The name change enables it be visible in the menus, so that's OK for you.

Please define what you mean by "doesn't work"
(sorry couldn't resist, we do it to everyone else who turns up here with similar pronouncements ;) )

Kevin


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Mon Jan 20, 2014 8:03 pm  (#40) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Rod I think yours is a problem of how you use the script, !it's very important to select none! after you copy so maybe that should be added to the script, it was also necessary to set the layer [not the mask] as active before moving as well .
I have decided to simplify a script-fu version to portray the changes needed
In this version there is no need to clear the selection or reposition the layer beforehand.
1/ create a selection of the area you want to feather paste
2/ run feather paste in default
3/ adjust your blur
4/ reposition your new layer and set mode and opacity as desired
5/ merge down

Did not do in python but may try soon

below is feather paste simplified

; Feather-Paste V1.1
;
; Created by GnuTux
; Derrived from Feather Paste Python Script by Joao S. O. Bueno
;
; Comments directed to http://gimpchat.com or http://gimpscripts.com
;
; License: GPLv3
;    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 3 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.
;
;    To view a copy of the GNU General Public License
;    visit: http://www.gnu.org/licenses/gpl.html
;
; ------------
;| Change Log |
; ------------
; V1.0 - Initial Release
; V1.1 Changes per graechan
;
;Define Main Procedure
;

(define (script-fu-feather-paste
                             img    ;Incoming Image
                             layer  ;Incoming Layer
                             merge) ;Merge the layers graechan
;
;Declare Variables
;
    (let*
    (
    (sel -1)   ; Selection
     (mask -1)  ; Mask
    )
;
; Save Context
;
(gimp-context-push)

; Start Undo Group

(gimp-undo-push-group-start img)
(gimp-selection-none img)                                                  ; selection none graechan
(set! sel (car (gimp-edit-paste layer FALSE)))                             ; Selection to paste

(gimp-floating-sel-to-layer sel)                                           ; Selection to layer
(gimp-layer-resize-to-image-size sel)                                      ; Resize to image size


(set! mask (car (gimp-layer-create-mask sel ADD-ALPHA-TRANSFER-MASK)))     ; Create Mask

(gimp-layer-add-mask sel mask)                                             ; Add Mask
(gimp-displays-flush)                                                      ; Flush changes to displays


;
; Gaussian Blur Interactive
;
(plug-in-gauss                 
                   0     ; Interactive
                 img     ; Image to apply blur
                mask     ; Layer to apply blur
                   5     ; Blur Radius x 
                   5     ; Blue Radius y
                   1     ; Method (IIR=0 RLE=1)
)

;
; Levels
;

(gimp-levels
              mask                 ; Mask 
              HISTOGRAM-VALUE      ; Channel
              128                  ; Low input
              255                  ; High Input
              1                    ; Gamma
              0                    ; Low output
              255                  ; High output
)

(cond ((= merge TRUE) (gimp-image-merge-down img sel  CLIP-TO-IMAGE)) ; Merge down pasted layer ;graechan
      (else (plug-in-autocrop-layer 1 img sel)                        ; graechan
     (gimp-layer-set-edit-mask sel FALSE)))                          ; graechan

; End Undo Group

(gimp-undo-push-group-end img)

; Update display

(gimp-displays-flush)

; Restore Context

(gimp-context-pop)

) ; End let
) ; End Main Procedure

;
; Register Feather Paste Script
;
(script-fu-register "script-fu-feather-paste"
         "<Image>/Edit/Feather Paste"
         "Feather Paste"
         "GnuTux - http://gimpchat.com"
         "GnuTux - GPLv3"
         "August, 2013"
         "RGB*"
         SF-IMAGE       "Image"                    0
         SF-DRAWABLE    "Drawable"                 0
         SF-TOGGLE     "Merge Down the Layer"   FALSE ; graechan
) ;End register



Attachments:
File comment: Feather Paste V1.1
feather-paste.scm [3.6 KiB]
Downloaded 53 times

_________________
Image
No matter how much you push the envelope, it'll still be stationery.
Top
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Shrink Grow Feather Selection with LIVE PREVIEW

43

No new posts Attachment(s) Feather in gimp gives unwanted lines in picture - SOLVED

9

No new posts copy/paste photos disappear when moved.

9

No new posts Quick Doogle to Cut and Paste - Collage Maker

2

No new posts How to resize image after "paste into selection"?

2



* Login  



Powered by phpBB3 © phpBB Group