It is currently Thu Mar 28, 2024 6:56 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 4:08 pm  (#1) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4039
Handy script worth adding to the arsenal. To see where the topic originated, see here:

http://registry.gimp.org/comment/reply/25595/

Thanks, Rob A! :)

Once installed it will be in Edit - Paste into current selection

I'm attaching it here:


Attachments:
script-fu_paste_into_selection.scm [5.6 KiB]
Downloaded 235 times

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Last edited by mahvin on Tue Sep 27, 2011 3:11 am, edited 1 time in total.
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 4:56 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
Thanks. Much coolness on you.

BTW...He who dies with the most scripts, wins!

Can I get an AMEN Lyle?

_________________
Image


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 5:21 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
RobA gets more then praise from me Drac. As for this script-fu, I've not run into an issue that really needs it yet (just remember, there are more then one way to skin a cat). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 5:25 pm  (#4) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Draconian wrote:
BTW...He who dies with the most scripts, wins!

Can I get an AMEN
You got it from me, plus he/she with the most fonts wins in the other contest.

Cool script if I can figure out what I want to do with it. Hey, mahvin, how about an example picture?

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 5:44 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
Oregonian wrote:
Draconian wrote:
BTW...He who dies with the most scripts, wins!

Can I get an AMEN
You got it from me, plus he/she with the most fonts wins in the other contest.

Cool script if I can figure out what I want to do with it. Hey, mahvin, how about an example picture?


:rofl :hehe :coolthup I'm proabably a "font hoarder"....173 MB in my font folder! I'm bad about grabbing stuff thinking "ooo that's cool, I might need that someday."

_________________
Image


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 5:54 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I have 375 and I just house cleaner over 200 out of there.

_________________
Image


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 6:14 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Aug 24, 2011
Posts: 1785
Location: Dallas, TX
molly wrote:
I have 375 and I just house cleaner over 200 out of there.



You're sick Molly. Sick, Sick, Sick!

I think that's what I like about you.

(kidding of course) :rofl

_________________
Image


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 6:35 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4039
Make a selection of something on a background image and COPY it, create a new layer, and make a larger selection, then use rob's paste into selection script. You'll see what happens.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 8:24 pm  (#9) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
OK, it copied the clipboard contents into the larger selection. From what I'd read, I thought it was supposed to grow to the size of the new larger selection. Didn't.

So, it's a tool to make a selection, copy and paste it where you want it in the image. Whatever is copied to the clipboard gets pasted into the image where a larger selection is made. Right?

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 8:28 pm  (#10) 
Offline
GimpChat Member

Joined: Jun 04, 2011
Posts: 80
works for me. it shows up as "Paste Into Current Selection" under Edit. not "Paste Into".


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 9:31 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I still see no sense in pasting a small image into a larger selection unless its real high quality (or one solid color), and can take the stretching of pixels, and still retain that quality. :)

_________________
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: Rob A's Paste into selection script
PostPosted: Mon Sep 26, 2011 11:24 pm  (#12) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4039
Rod: Well, it does a fairly good job for enlarging. Have you tried it?

Everyone else: Sorry I wasn't able to elaborate more earlier, I got called away.

Image

This took 5 seconds to process just using a new selection.

Steps:

1. Make a selection of whatever you want to copy. Then Edit - Copy.
2. Then, either on a new layer (recommended) or the same layer (or background) create a new selection. Smaller or larger selection, makes no difference. This is just your preference.
3. Run Edit - Paste into current selection.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 12:42 am  (#13) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
I must be doing something wrong. I make a selection, copy, make a larger selection in another layer, paste into and it remains the size of the original selection.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 1:14 am  (#14) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Mine says Paste Into and a message pops up and says Paste the content into, etc., see pic below.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 1:18 am  (#15) 
Offline
GimpChat Member

Joined: Jun 04, 2011
Posts: 80
its at the bottom of the Edit sub menu in mine ... Paste Into Current Selection


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 1:35 am  (#16) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4039
It's not Paste Into, O. It's Paste into current selection, like Ico says.

Image

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 9:43 am  (#17) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Well, duhhh! Perhaps if I looked beyond the end of my nose ... Oh, well, I sure won't forget where it is now. Thanks for being patient.

Image

Went a bit farther and did some experimenting. The smaller image is the original and was 220x220px on a transparent bg. I enlarged the canvas to 500x500 and added a new transp layer. Then I did alpha to selection on the small image and then Ctrl + A to select the new layer, pasted into it and Voila! It did a pretty decent job enlarging I think. Perhaps I could sharpen it a bit.
Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 12:24 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
I'm assuming the user wanted it to paste into smaller selection, but I could be wrong. I'd doing nothing special beyond your default interpolation. It seemed a quick hack of a script I wrote before (attached here for fun - paste as new layer centered in the current selection/image)

SaulGoode also suggested at the source link that it be changed to register in the "Edit->Paste As" menu, rather than the base "Edit" menu. You can make that change yourself, if desired.

As always YMMV.

-Rob A>


Attachments:
paste-as-new-centered.scm [3.9 KiB]
Downloaded 121 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
 Post subject: Re: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 12:36 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks again Rob. :)
Thank you too Mahvin, that does look pretty good for being pasted as a scaled up 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: Rob A's Paste into selection script
PostPosted: Tue Sep 27, 2011 1:04 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
RobA wrote:
SaulGoode also suggested at the source link that it be changed to register in the "Edit->Paste As" menu, rather than the base "Edit" menu. You can make that change yourself, if desired.

Actually, my suggestion was that the command be registered in the "Paste" subgroup of the Edit Menu (not the "Paste As" submenu).

This is an as yet undocumented (or at least not-well-documented) feature of 'plug-in-menu-register' (I am currently in the process of creating some documentation for it) which affords greater control of where third-party commands get placed in the menu structure.

For example, I registered my Edit->Isolate command using
(script-fu-menu-register "script-fu-sg-isolate"
  "<Image>/Edit/Cut"  )

and that places the command within the "Cut" subgroup of the Edit Menu (PDB-registered commands will appear in alphabetical order after the core GIMP commands in a subgroup).

By default, the "Cut" subgroup comprises just the Edit->Cut command (the next subgroup in the menu is the "Copy" subgroup, though there is no real way of knowing this without examining the GIMP source code)
Attachment:
Cut-placeholder.png
Cut-placeholder.png [ 19.36 KiB | Viewed 1805 times ]

so my Isolate script -- rather than being placed at the very bottom of the Edit Menu -- will be placed directly after the Cut command.
Attachment:
SSisolate.png
SSisolate.png [ 30.69 KiB | Viewed 1805 times ]


Similarly, if RobA's "Paste Into Current Selection" were registered as suggested on the Plugin Registry, it would be placed within the Paste subgroup (rather than at the bottom) of the Edit Menu. I am thinking that perhaps with such placement, fine people such as Oregonian will not have so much difficulty locating it.

By default, the Paste subgroup consists of the two commands shown in the following image (note the distinction from the "Paste As" submenu):
Attachment:
Paste-placeholder.png
Paste-placeholder.png [ 18.58 KiB | Viewed 1805 times ]

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


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

2

No new posts Attachment(s) Is there a script for doing Stroke outside selection?

4

No new posts Attachment(s) Script for selecting, cropping the selection and saving the file

8

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

2

No new posts copy/paste photos disappear when moved.

9



* Login  



Powered by phpBB3 © phpBB Group