It is currently Sat Jul 06, 2024 5:34 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: how to automate the procedure?
PostPosted: Sun Mar 10, 2024 3:06 am  (#1) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
Hello.


Last edited by ezac on Sat Apr 13, 2024 1:59 am, edited 2 times 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: how to automate the procedure?
PostPosted: Sun Mar 10, 2024 4:42 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
When you reach Layer 7, there is no created layer in Step 7, unless you missed a Ctrl-V somewhere?

In Gimp you need a script, and there are several restrictions:

- where the script runs there are no user interaction (so you can't wait for the use to click something). You tell everything to the script before it starts (the two images, the source layer, and the color, in this case)
- the script can't act on the UI (it won't zoom/dezoom, for instance)
- there is no one-to-one correspondence between UI actions and the actions available to a script (some human actions require several script actions, and vice-versa), so describing the process with clicks doesn't help. What do you want to do, in general terms, and can you post some images?

_________________
Image


Top
 Post subject: Re: how to automate the procedure?
PostPosted: Sun Mar 10, 2024 10:23 am  (#3) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
In


Attachments:
File comment: final image
94752_229216_USA218.jpg
94752_229216_USA218.jpg [ 5.34 MiB | Viewed 2201 times ]
File comment: editable image
94752_229216_USA218_orig.jpg
94752_229216_USA218_orig.jpg [ 3.11 MiB | Viewed 2201 times ]
File comment: sample image
94752_229056_USA218.jpg
94752_229056_USA218.jpg [ 3.64 MiB | Viewed 2201 times ]


Last edited by ezac on Sat Apr 13, 2024 2:58 am, edited 3 times in total.
Top
 Post subject: Re: how to automate the procedure?
PostPosted: Sun Mar 10, 2024 11:20 am  (#4) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
If


Last edited by ezac on Sat Apr 13, 2024 2:58 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Sun Mar 10, 2024 4:16 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
So, you stack the two images, and in the top one, select the color of the lighter areas, and delete that selection to make the other image show though, and then boost the chroma?

Are you looking for a specific color (because a script could be given a color to select, without clicking on a pixel of the right color), or are you using human eyes to determine where to click depending on image?

If you are manual, you can zoom in&out with Ctrl-[mouse wheel] on any decent mouse instead of depressing keys.

Instead of copy/pasting layers, you can drag them from the Layers list of an image to the canvas of another

I did your procedure without creating any new layer so what am I missing?

What is scriptable is the [Delete selection/add other layer/merge/chroma boost/save] part, if you need to pick the color in each image, or the whole ting without even using the UI if you are using the same color.
Loading another file to process is also scriptable if the files are all in the same directory.

_________________
Image


Top
 Post subject: Re: how to automate the procedure?
PostPosted: Mon Mar 11, 2024 6:03 am  (#6) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
make


Last edited by ezac on Sat Apr 13, 2024 2:48 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Mon Mar 11, 2024 9:15 am  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
ezac wrote:
ofnuts wrote:
So, you stack the two images, and in the top one, select the color of the lighter areas, and delete that selection to make the other image show though, and then boost the chroma?
Are you looking for a specific color (because a script could be given a color to select, without clicking on a pixel of the right color), or are you using human eyes to determine where to click depending on image?

I need to remove artifacts from an orthophoto: it could be snow, ice, clouds, cloud shadows. I can't imagine how a script can select such objects. So I manually click the mouse to highlight the color
ofnuts wrote:
If you are manual, you can zoom in&out with Ctrl-[mouse wheel] on any decent mouse instead of depressing keys.

Okay, but I'm talking about process automation
ofnuts wrote:
Instead of copy/pasting layers, you can drag them from the Layers list of an image to the canvas of another

Good hint, if it works, we can do it this way
ofnuts wrote:
I did your procedure without creating any new layer so what am I missing?

if it works, we can do it this way. Can you describe your procedure? And is it possible to automate it?
ofnuts wrote:
What is scriptable is the [Delete selection/add other layer/merge/chroma boost/save] part, if you need to pick the color in each image, or the whole ting without even using the UI if you are using the same color.

I need to remove artifacts from an image: I don’t know where they are or how they will be located in the image. This is a white color (snow, ice, clouds) of different intensities, for which I use a threshold of 98. And black color (cloud shadows) of different intensities, for which I use a threshold of 18
ofnuts wrote:
Loading another file to process is also scriptable if the files are all in the same directory.

Great offer. I usually use one sample image for a whole batch of edited images


My procedure:

- Open the image
- Select whatever
- Delete (this creates holes in the image)
- Drag the background image layer from the Layers list of the background to this canvas
- Push that layer down the stack
- Merge down
- Chroma Boost
- Export

_________________
Image


Top
 Post subject: Re: how to automate the procedure?
PostPosted: Mon Mar 11, 2024 11:08 am  (#8) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
Drag


Attachments:
File comment: your final image
94752_229216_USA218.jpg
94752_229216_USA218.jpg [ 4.82 MiB | Viewed 2135 times ]


Last edited by ezac on Sat Apr 13, 2024 2:48 am, edited 2 times in total.
Top
 Post subject: Re: how to automate the procedure?
PostPosted: Mon Mar 11, 2024 11:17 pm  (#9) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
I tried


Last edited by ezac on Sat Apr 13, 2024 2:32 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Mon Mar 11, 2024 11:33 pm  (#10) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
Please


Last edited by ezac on Sat Apr 13, 2024 2:50 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Tue Mar 12, 2024 12:45 pm  (#11) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
I re-analyzed


Last edited by ezac on Sat Apr 13, 2024 2:40 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Tue Mar 12, 2024 1:19 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
ezac wrote:
ofnuts wrote:
I did your procedure without creating any new layer so what am I missing?

Please watch the video of the procedure again. There in the bottom panel of Gimp all the operations that I perform are displayed in text mode


Yes and I still don't understand the purpose of the "New layer from Visible". The initial layer is left unused.

Once the script is started you don't ask anything to a user. You get a dialog at the start where the user gives all required parameters. If the script is written correctly, two parameters are implicit, the image and the layer. The image is the one in the windows from which the script is started (or the one in the active tab in single-window mode) and the layer is the active layer of the image. This means that when the script is started the user is already in the tab of the image...

Since the selection is still done by a human you can't really script that (you can't make the UI zoom by script anyway, and the script wouldn't know where to zoom). You have to make the selection then run a script. There are several ways in Gimp to make sure that your selection is done with the same settings each time (you can save default options for the tool, or save presets).

So the bit that you can automate is:
- deleting the selection,
- adding the layer form the other image,
- merging,
- applying the chroma,
- and exporting the result.

This means that besides the image/layer, the script needs two more parameters:
- the amount of chroma boost,
- and the image/layer to add a background.

If it's a script for personal use, the chroma boost can be baked in and you don't need to make it a parameter. You can also make it a parameter with a default value.

For the background image, if you always use the same image you can also hard-code the file name, or you can look in current loaded images in Gimp for an image/layer with a specific name. Or you can have this as a parameter. If you call the script several times in a Gimp session, the parameter dialog comes up with the values used in the previous run so you just have to strike enter to run again.

Otherwise, the maneuver to copy a layer to another image:

Attachment:
snapshot.jpg
snapshot.jpg [ 237.43 KiB | Viewed 2057 times ]

_________________
Image


Top
 Post subject: Re: how to automate the procedure?
PostPosted: Wed Mar 13, 2024 2:36 am  (#13) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
I still


Last edited by ezac on Sat Apr 13, 2024 2:46 am, edited 1 time in total.

Top
 Post subject: Re: how to automate the procedure?
PostPosted: Wed Mar 13, 2024 7:33 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
ezac wrote:
ofnuts wrote:
I still don't understand the purpose of the "New layer from Visible". The initial layer is left unused.
Otherwise, the maneuver to copy a layer to another image:
Attachment:
snapshot.jpg

I can't do it
<iframe width="640" height="360" frameborder="0" src="https://mega.nz/embed/zdVj2DhJ#KfAsSF898SDeR4CJOD1wFRoRBgLkBunXOLiEUc3zRzc" allowfullscreen ></iframe>

You are dropping on the tab. After the tab switch , move to the canvas of the activated image before dropping.

_________________
Image


Top
 Post subject: Re: how to automate the procedure?
PostPosted: Thu Mar 14, 2024 3:48 am  (#15) 
Offline
GimpChat Member

Joined: Mar 10, 2024
Posts: 10
You


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Automate merge of multiple files horizontally

3

No new posts Can ScriptFu or anything in Gimp automate the creation of layer groups

7

No new posts Attachment(s) check if the procedure is correctly done?

6

No new posts Attachment(s) Procedure Browser Crashes

4

No new posts Assign ICC Color Profile from procedure

1



* Login  



Powered by phpBB3 © phpBB Group