Placement of pasted selections
This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
Placement of pasted selections | Tristan Miller | 28 Dec 19:04 |
Placement of pasted selections | Sven Neumann | 28 Dec 21:53 |
Placement of pasted selections | David Herman | 29 Dec 05:37 |
Placement of pasted selections | Tristan Miller | 29 Dec 11:37 |
Placement of pasted selections | Joao S. O. Bueno Calligaris | 29 Dec 14:22 |
Placement of pasted selections | Tristan Miller | 29 Dec 11:43 |
Placement of pasted selections | Vytautas P. | 29 Dec 15:54 |
200512300404.29149.gwidion@... | Joao S. O. Bueno Calligaris | 30 Dec 07:04 |
Python-fu script for Placement of pasted selections | Joao S. O. Bueno Calligaris | 30 Dec 18:28 |
Placement of pasted selections | Tristan Miller | 29 Dec 19:25 |
Placement of pasted selections | User1001 | 29 Dec 19:45 |
Placement of pasted selections | Owen | 30 Dec 01:57 |
Placement of pasted selections | wayne | 14 Jan 01:12 |
Placement of pasted selections
Greetings.
Say I have two images of the same size (9952×7016) open. I select an arbitrary region from the first image and Edit->Copy it. Then I switch to the second image and Edit->Paste. Unfortunately, GIMP seems to put the selection wherever it wants; I would rather it appear in the exact same place as in the original image. Since the images are so big, it's difficult for me to drag the selection with the mouse to the exact spot it should appear. Is there some way I can modify GIMP's default selection placement behaviour?
(It was previously suggested to me that I copy the entire image and paste it as a new layer in the second image, and then copy between layers instead of between images. However, this is undesirable due to the large size of images I'm working with. It can take over a minute to copy the entire image into a new layer; I just want to be able to copy small areas of one image into another.)
Regards, Tristan
Placement of pasted selections
Hi,
Tristan Miller writes:
(It was previously suggested to me that I copy the entire image and paste it as a new layer in the second image, and then copy between layers instead of between images. However, this is undesirable due to the large size of images I'm working with. It can take over a minute to copy the entire image into a new layer; I just want to be able to copy small areas of one image into another.)
Are you using a clipboard daemon such as Klipper? It shouldn't take that long to create a copy.
Sven
Placement of pasted selections
On Wednesday 28 December 2005 10:04 am, Tristan Miller wrote:
Greetings.
Say I have two images of the same size (9952×7016) open. I select an arbitrary region from the first image and Edit->Copy it. Then I switch to the second image and Edit->Paste. Unfortunately, GIMP seems to put the selection wherever it wants; I would rather it appear in the exact same place as in the original image. Since the images are so big, it's difficult for me to drag the selection with the mouse to the exact spot it should appear. Is there some way I can modify GIMP's default selection placement behaviour?
(It was previously suggested to me that I copy the entire image and paste it as a new layer in the second image, and then copy between layers instead of between images. However, this is undesirable due to the large size of images I'm working with. It can take over a minute to copy the entire image into a new layer; I just want to be able to copy small areas of one image into another.)
I was trying to do something similar to this last week, I eventually gave up because my results were just as you describe, but reading your mail today made it all seem clear and simple to me.
Use one of your selection tools to select the desired portion of your image
go to the menu, Script-Fu -> Selection -> To Brush
follow the directions in the dialog (give the brush a name and a file name) and spacing info if needed.
Press ok and wait while your brushes are updated. Then you can use your selection as a brush wherever you desire.
It won't put your selection in exactly the same place but should allow you to place the brush wherever you desire, and you won't be working with a gigantic buffer slowing things down.
All of this assumes you have set up gimp so that it can save brushes somewhere that you have write permissions - like your home directory.
Hope this helps
Placement of pasted selections
Greetings.
In article , Sven Neumann wrote:
(It was previously suggested to me that I copy the entire image and paste it as a new layer in the second image, and then copy between layers
instead of between images. However, this is undesirable due to the large
size of images I'm working with. It can take over a minute to copy the entire image into a new layer; I just want to be able to copy small areas of one image into another.)Are you using a clipboard daemon such as Klipper? It shouldn't take that long to create a copy.
No, I'm not using a clipboard daemon. When you're working with huge images (24-bit 600 dpi A3 or A4 scans) and don't have the latest and greatest in hardware, then yes, it certainly can take a long time to create a copy. Keep in mind that the method proposed above more than triples the amount of memory used (100% to create the clipboard copy, plus 133% to create a new layer with alpha channel, plus who knows how much for the undo history). On a system without much RAM this can cause a lot of swapping and possibly even thrashing.
Regards, Tristan
Placement of pasted selections
Greetings.
In article , David Herman wrote:
Say I have two images of the same size (9952×7016) open. I select an arbitrary region from the first image and Edit->Copy it. Then I switch to the second image and Edit->Paste. Unfortunately, GIMP seems to put the selection wherever it wants; I would rather it appear in the exact same place as in the original image. Since the images are so big, it's difficult for me to drag the selection with the mouse to the exact spot it should appear. Is there some way I can modify GIMP's default selection placement behaviour?
Use one of your selection tools to select the desired portion of your image
go to the menu, Script-Fu -> Selection -> To Brush
follow the directions in the dialog (give the brush a name and a file name) and spacing info if needed.
Press ok and wait while your brushes are updated. Then you can use your selection as a brush wherever you desire.
This saves some time and memory, but then you still have the problem of having to manually place the brush (i.e., copied selection) in the new image at the right place. The images I'm working with are too large for me to do this accurately.
It occurs to me, however, that if one assumes that the selection is rectangular, then there must be a way to use a script-fu program to do this copy/paste automatically. It would need only implement the following algorithm, which assumes there are two images open and a selection is active in the active window:
1. Store the top left coordinates (x,y) of the selection.
2. Copy the selection.
3. Switch to the second image.
4. Paste.
5. Move the selection to (x,y).
6. Anchor the selection.
The only trouble is, since I don't know Scheme and don't know the script-fu Gimp API, writing this six-line program will probably take me a few hours of research. I will eventually end up doing this unless someone here can come up with a better solution, or perhaps generously offer to write the script for me. :)
Regards,
Tristan
Placement of pasted selections
On Thursday 29 December 2005 08:37 am, Tristan Miller wrote:
Greetings.
In article , Sven Neumann wrote:
(It was previously suggested to me that I copy the entire image and paste it as a new layer in the second image, and then copy between layers
instead of between images. However, this is undesirable due to the large
size of images I'm working with. It can take over a minute to copy the entire image into a new layer; I just want to be able to copy small areas of one image into another.)Are you using a clipboard daemon such as Klipper? It shouldn't take that long to create a copy.
No, I'm not using a clipboard daemon. When you're working with huge images (24-bit 600 dpi A3 or A4 scans) and don't have the latest and greatest in hardware, then yes, it certainly can take a long time to create a copy. Keep in mind that the method proposed above more than triples the amount of memory used (100% to create the clipboard copy, plus 133% to create a new layer with alpha channel, plus who knows how much for the undo history). On a system without much RAM this can cause a lot of swapping and possibly even thrashing.
I see you had not actually tried it. :-) The GIMP can handle this quite efficiently. First, neither the GIMP nor any program I know actually make a memory copy of an object that was copied to the clipboard - the clipboard is just given a reference to the object.
And when pasting, as far as the tiles are not changed, the same data in memory is shared by both images.
So, all you have to do is paste the new layer, close the original image, and then crop the pasted layer. The memory in use will not exceed the memory needed to keep both images open at the same time.
You can also work a python-fu /script-fu script to do a "paste located" stuff - the way I can think of you will have toi manually type in the destination coordinates, but I think it will suit your needs for know.
Let me know if you'd need such a script, and tell me if you have gimp-python running - as I'd prefere doing it in Python than in script-fu.
JS
->
Regards,
Tristan
Placement of pasted selections
If images are equal size and coordinates are the same, you can do this manually, I think. Just remember coordinates from selection. Select area in first image, copy it, make selection of the same size and location in second one and then paste. And you can make separate layer from that pasted part for fine tuneing. I'd do so if I were you :)
On Thu, 29 Dec 2005 12:43:25 +0200, Tristan Miller wrote:
It occurs to me, however, that if one assumes that the selection is rectangular, then there must be a way to use a script-fu program to do this copy/paste automatically. It would need only implement the following
algorithm, which assumes there are two images open and a selection is active in the active window:1. Store the top left coordinates (x,y) of the selection. 2. Copy the selection.
3. Switch to the second image.
4. Paste.
5. Move the selection to (x,y).
6. Anchor the selection.The only trouble is, since I don't know Scheme and don't know the script-fu
Gimp API,
Placement of pasted selections
Greetings.
In article , Joao S. O. Bueno Calligaris wrote:
I see you had not actually tried it. :-)
Well, I had, but I was making assumptions about the causes of any delays.
You can also work a python-fu /script-fu script to do a "paste located" stuff - the way I can think of you will have toi manually type in the destination coordinates, but I think it will suit your needs for know.
Let me know if you'd need such a script, and tell me if you have gimp-python running - as I'd prefere doing it in Python than in script-fu.
Sure, I would be grateful for any help in making a script to do this work. I don't have gimp-python, but I suppose I could install it. As I mentioned in another post, I think the script will be very simple to write, provided one already knows script-fu (or python-fu):
Assuming there are two images open and a selection is active in the active window:
1. Store the top left coordinates (x,y) of the selection.
2. Copy the selection.
3. Switch to the second image (or: pop up a dialog asking the user to
select the destination image).
4. Paste.
5. Move the selection to (x,y).
6. Anchor the selection.
Regards, Tristan
Placement of pasted selections
There is also a Perl interface for GIMPv2 at
http://search.cpan.org/~sjburges/Gimp-2.2pre1/Gimp.pm
but I have not coded anything to use it so can't offer any insight to its use.
Tristan Miller wrote:
Greetings.
In article , Joao S. O. Bueno Calligaris wrote:
I see you had not actually tried it. :-)
Well, I had, but I was making assumptions about the causes of any delays.
You can also work a python-fu /script-fu script to do a "paste located" stuff - the way I can think of you will have toi manually type in the destination coordinates, but I think it will suit your needs for know.
Let me know if you'd need such a script, and tell me if you have gimp-python running - as I'd prefere doing it in Python than in script-fu.
Sure, I would be grateful for any help in making a script to do this work. I don't have gimp-python, but I suppose I could install it. As I mentioned in another post, I think the script will be very simple to write, provided one already knows script-fu (or python-fu):
Assuming there are two images open and a selection is active in the active window:
1. Store the top left coordinates (x,y) of the selection. 2. Copy the selection.
3. Switch to the second image (or: pop up a dialog asking the user to select the destination image).
4. Paste.
5. Move the selection to (x,y).
6. Anchor the selection.Regards, Tristan
Placement of pasted selections
This probably comes up as a new thread as I don't have the original, this is off the archives
Tristan Miller did write;
Say I have two images of the same size (9952×7016) open. I select an arbitrary region from the first image and Edit->Copy it. Then I switch to the second image and Edit->Paste. Unfortunately, GIMP seems to put the selection wherever it wants; I would rather it appear in the exact same place as in the original image. Since the images are so big, it's difficult for me to drag the selection with the mouse to the exact spot it should appear. Is there some way I can modify GIMP's default selection placement behaviour?
I think this is repeatable
1. Image 1 - Make selection
2. Selection to Path
3. Export Path
4. Go to second Image, make new tranparent layer
5. Import Path
6. Path to Selection
7. Go to image one and cut out selection
8. Go to image 2, paste into transparent layer
That places it in exactly the same spot as in image one
Owen
Python-fu script for Placement of pasted selections
On Friday 30 December 2005 04:04 am, Joao S. O. Bueno Calligaris wrote:
On Thursday 29 December 2005 08:43 am, Tristan Miller wrote:
1. Store the top left coordinates (x,y) of the selection. 2. Copy the selection.
3. Switch to the second image.
4. Paste.
5. Move the selection to (x,y).
6. Anchor the selection.
Hi,
Tristam wrote me to note that there are conflicting licencing terms in the "sel_transfer.py" script I attached in the previous e-mail.
Indeed, it is intended as public domain - but there are remaining comment lines from the plug-in I templated it from that say it is GPLed.
It is such simple script that I doubt anyone will actually be expanding on it. But in any case it is intended as public domain.
Regards,
JS
->
Placement of pasted selections
On Thursday 29 December 2005 02:57 pm, Owen wrote:
This probably comes up as a new thread as I don't have the original, this is off the archives
Tristan Miller did write;
Say I have two images of the same size (9952×7016) open. I select an arbitrary region from the first image and Edit->Copy it. Then I switch to the second image and Edit->Paste. Unfortunately, GIMP seems to put the selection wherever it wants; I would rather it appear in the exact same place as in the original image. Since the images are so big, it's difficult for me to drag the selection with the mouse to the exact spot it should appear. Is there some way I can modify GIMP's default selection placement behaviour?
I think this is repeatable
1. Image 1 - Make selection 2. Selection to Path
3. Export Path
4. Go to second Image, make new tranparent layer 5. Import Path
6. Path to Selection
7. Go to image one and cut out selection 8. Go to image 2, paste into transparent layerThat places it in exactly the same spot as in image one
Isn't there a simpler way? Like select, cut, paste.
Wayne