[Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread Tristan Miller
Greetings.

In article [EMAIL PROTECTED], 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

-- 
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=In a haiku, so it's hard
(7_\\http://www.nothingisreal.com/ To finish what you

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread Tristan Miller
Greetings.

In article [EMAIL PROTECTED], 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

-- 
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=In a haiku, so it's hard
(7_\\http://www.nothingisreal.com/ To finish what you

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread Joao S. O. Bueno Calligaris
On Thursday 29 December 2005 08:37 am, Tristan Miller wrote:
 Greetings.

 In article [EMAIL PROTECTED], 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
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread Vytautas P.
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  
[EMAIL PROTECTED] 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,

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread Tristan Miller
Greetings.

In article [EMAIL PROTECTED], 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

-- 
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=In a haiku, so it's hard
(7_\\http://www.nothingisreal.com/ To finish what you

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: Placement of pasted selections

2005-12-29 Thread User1001
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 [EMAIL PROTECTED], 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
 

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user