How to write a "simple" macro [newbie]
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.
How to write a "simple" macro [newbie] | Mauro Condarelli | 27 Oct 11:46 |
How to write a "simple" macro [newbie] | Carol Spears | 27 Oct 17:43 |
How to write a "simple" macro [newbie] | Carol Spears | 27 Oct 21:04 |
How to write a "simple" macro [newbie] | michael chang | 28 Oct 02:17 |
How to write a "simple" macro [newbie]
Hi,
While I'm a reasonably seasoned programmer my experiece with graphics is in the negative range, so, please, do not shot me on sight :) :)
I have a clear idea of What I need to do, but I'm unable to do it even manually, let alone program a macro to automate the task :(
I need to: 1) Use the magic wand to select a region. 2) This region will be a big region with (possibly) internal sub-regions; if this is the case I need to destroy all the inner regions (i.e.: I need to preserve just the outer region, without any "holes"). 3) Clear the region to a specified colour. 4) Edit a (possibly long) string and fit it into the cleared region (eventually scaling the font to make it fit).
Nice to have: - save the "original" region contents in a layer before killing it. - render the string to a different layer than the background (this would enable to see either the "old" or the "new" content simply marking the two layers visible/not-visible.
I need this in order to translate some comics I scanned. I want to automatise as much as possible the process. Doing it completely manually is impossibly long (for me). Please remember that my graphics ability is zilch :(
Thanks a lot for Your patience and
Thanks in Advance
Mauro.
P.S.: Please copy directly me; I tried to subscribe to the list, but I'm unsure it worked (I didn't receive any message, yet).
How to write a "simple" macro [newbie]
On Thu, Oct 27, 2005 at 11:46:52AM +0200, Mauro Condarelli wrote:
Hi,
While I'm a reasonably seasoned programmer my experiece with graphics is in the negative range, so, please, do not shot me on sight :) :)I have a clear idea of What I need to do, but I'm unable to do it even manually, let alone program a macro to automate the task :(
the good news is (for you then) that gimp does not use macros. this means that you can use full-fledged computer languages to accomplish what you need to. gimp has enclosed a script-fu console and you have access to a gimp python or perl module.
I need to:
1) Use the magic wand to select a region. 2) This region will be a big region with (possibly) internal sub-regions; if this is the case I need to destroy all the inner regions (i.e.: I need to preserve just the outer region, without any "holes").
try to adjust the Threshold value in the tool options until you can select the region that you are interested in.
3) Clear the region to a specified colour.
if you make the Toolbox background color into the selected color (and you do not add an alpha channel to your image) Edit-->Clear, Edit-->Cut or using the Eraser on the selection should "clear the region to a specified colour".
4) Edit a (possibly long) string and fit it into the cleared region (eventually scaling the font to make it fit).
via scripts, there are many many ways to control text. you can see this if you look at Xtns-->PDB Browser and search for text.
Nice to have:
- save the "original" region contents in a layer before killing it.
work on a duplicate of the layer. that would mean that you will need to Edit--Fill your erased or cleared or cut region. or perhaps put another layer of the same color under the one you are working on.
- render the string to a different layer than the background (this would enable to see either the "old" or the "new" content simply marking the two layers visible/not-visible.
the text is on its own layer anyways.
I need this in order to translate some comics I scanned.
each different color might need a different threshold setting.
I want to automatise as much as possible the process. Doing it completely manually is impossibly long (for me).
it will be much easier if you are needing to remove the same color region from each image. one problem with doing things as you mentioned so far is that it might be very difficult to know where to pick the color from.
Please remember that my graphics ability is zilch :(
another thing to consider is gimp gap.
P.S.: Please copy directly me; I tried to subscribe to the list, but I'm unsure it worked (I didn't receive any message, yet).
it is a tradition of this maillist.
carol
How to write a "simple" macro [newbie]
On Thu, Oct 27, 2005 at 08:43:44AM -0700, Carol Spears wrote:
On Thu, Oct 27, 2005 at 11:46:52AM +0200, Mauro Condarelli wrote:
I want to automatise as much as possible the process. Doing it completely manually is impossibly long (for me).
it will be much easier if you are needing to remove the same color region from each image. one problem with doing things as you mentioned so far is that it might be very difficult to know where to pick the color from.
some where, when i first typed this, i lost what i was trying to say. Select by color would be better to use in automation. it will find more than one region though, if more than one exists on the image.
i wrote a script that used fuzzy selection on a directory of images. i knew that i could pick from this one location and it would always work, though.
carol
How to write a "simple" macro [newbie]
On 10/27/05, Mauro Condarelli wrote:
I need to:
1) Use the magic wand to select a region. 2) This region will be a big region with (possibly) internal sub-regions; if this is the case I need to destroy all the inner regions (i.e.: I need to preserve just the outer region, without any "holes").
Sounds like you're trying to erase the contents of a speech bubble and fill it with new text. The magic wand will select the white inside the bubble (assuming it is actually closed, which isn't guaranteed in comics, so you may get some bleeding which would ruin the entire thing) but you'll have to delete the text by doing some sort of combo-selection which will be kinda finicky.
3) Clear the region to a specified colour. 4) Edit a (possibly long) string and fit it into the cleared region (eventually scaling the font to make it fit).
Nice to have: - save the "original" region contents in a layer before killing it. - render the string to a different layer than the background (this would enable to see either the "old" or the "new" content simply marking the two layers visible/not-visible.
2.x text tools put text in a seperate layer...
I need this in order to translate some comics I scanned.
Maybe you want to make a background later, select the area(s) with the magic tool (click magic tool, shift click-click-click as necessary), cut, paste in a new layer, hide the cutout's layer and then create a text layer with your text.
I'm not sure if I'm being clear though, so it might not be helpful enough.
--
~Mike
- Just my two cents
- No man is an island, and no man is unable.