It is currently Fri Apr 19, 2024 11:37 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: 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: 4736
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: 14709
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 51 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 52 times

_________________
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 9:12 pm  (#41) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Graechan wrote:
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

Nice work, Graechan. Your updates make for a better workflow. :hi5

_________________
“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 9:32 pm  (#42) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
GnuTux I tend to forget things easily which is why I made the mods
(you could delete the merge option if you like and have the script finish with a new layer above the original layer always)
all changes I made are easily identified with the "graechan" text

_________________
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 9:36 pm  (#43) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
I like it fine with the updates you made. Another tag-team on that one. :hehe

_________________
“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: Tue Jan 21, 2014 5:06 am  (#44) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
You guys are good, thanks.... again

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Tue Jan 21, 2014 5:37 am  (#45) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I pasted the new script by Graechan and deleted the old. I copied the instructions and ran the selection on default. The only thing that happens is the selection turns off, it doesn't produce a new layer, As in my screenshot this is what it looks like before running the script. :gaah :gaah

Image

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Tue Jan 21, 2014 6:52 am  (#46) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
paynekj wrote:
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

It shows in the menus but doesn't run when selecting the menu item. :)
I believe though that if had actually taken the correct steps to run the filter it would have most likely worked. I was making a selection then running the filter when i should have copied first. ;)

_________________
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: Tue Jan 21, 2014 7:24 am  (#47) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Your instrucs are correct Graechan but this one line was left out. I should have known that.

Image

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Tue Jan 21, 2014 7:40 am  (#48) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Select none is no longer required with Graechan's updates. Of course, you always have to copy (or cut) before you paste. :hehe

_________________
“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: Tue Jan 21, 2014 7:46 am  (#49) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Well, I was half right, :oops: anyway, nice work guys, you are quite a team. :roll:

I did it again and it works great for this. I selected the flower on the right, blurred it with the script and moved it over to the left to make it look more distant.
Image

_________________
Image


Top
 Post subject: Re: Can't Find "feather_paste.py" in my UI
PostPosted: Tue Jan 21, 2014 8:12 am  (#50) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Updated work flow for using this script.,

1/ Create a selection of the area you want to Feather Paste
2) Copy (or cut)
3) Select destination image/layer
4/ Run Feather Paste
5/ Adjust your blur amount (click OK)
6/ Re-position your new layer and set mode and opacity as desired
7/ Optionally merge down

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


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