It is currently Fri Apr 26, 2024 8:48 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Sun Feb 14, 2016 2:17 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
I posted this script upon a request coming from a Gimp user.
The assumptions are:
1 - the user had an original black&white drawing
2 - someone did "overpaint" the drawing with light watercolours
3 - the user likes to restore the original, as much as possible

The available Gimp functions (desaturate, grayscale) do not get rid of the gray nuances generated by the converted colours.
This filter is written on the basis of the colours theory (in painting) that any added colour does not really "add" but "remove" instead the complementary colour; for instance, if you have a white area and you overpaint it with pure Yellow, in practice you remove the blue component from White (yellow = red+green).
Ofnuts told me there is a manual quick solution, but -as you know- I'm quite lazy and prefer having a script performing what I want.

Here an example:
1-original b&w drawing
Attachment:
original.png
original.png [ 361.74 KiB | Viewed 2400 times ]

2-overpainted with watercolours
Attachment:
overpainted.jpg
overpainted.jpg [ 133.61 KiB | Viewed 2400 times ]

3-outcome after running the script
Attachment:
after-the-script.jpg
after-the-script.jpg [ 89.12 KiB | Viewed 2400 times ]


output is not perfect (some black pixel was removed during the overpainting), but IMO acceptable

(note that this script makes use of the "tile" mechanism in python, as found on an example of Maldonado; you may use this method any time you have to deal with each byte in an image)

the script is already posted (thanks, Rod !) under GIMP Scripts and Plug-ins, here)

_________________
"Where am I ?"


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: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Sun Feb 14, 2016 3:02 am  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13016
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
Looks like a very handy script/plugin, thanks.
:bigthup

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Sun Feb 14, 2016 3:16 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2247
Location: Poland
Thank you very much for Your plugins.
Small cosmetic attention to the names in the menu (in my language - it merges).

register(
    "python_fu_remove_all_but_gray",
    "remove_all_but_gray",
    "Remove all colours except the gray tones.",
    "JFM-DN",
    "Open source (BSD 3-clause license)",
    "2016",
    #"remove_all_but_gray",
    "Remove all but gray...",
    "RGBA",


Attachments:
Menu cosmetic.png
Menu cosmetic.png [ 5.94 KiB | Viewed 2356 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Sun Feb 14, 2016 3:22 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
thanks, Wallace: its use is a bit "specific" to some situations
thanks, MareroQ: I will take note of your suggestions for my next scripts definitions; for those already posted maybe Rod (who took the burden of posting them) can apply the modification
(he is totally "authorized" to do it....)

_________________
"Where am I ?"


Top
 Post subject: Re: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Mon Feb 15, 2016 1:18 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Otherwise, to do the same thing manually:

- Color>Components>Decompose (RGB)
- Put the top two layers in "lighten only" mode
- Merge down

All of 10 seconds, faster than hunting down the script in the menus :)

_________________
Image


Top
 Post subject: Re: DIEGO_COLOURS_Remove_overpainted_colours
PostPosted: Mon Feb 15, 2016 2:43 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
an advantage of the plug-in is to provide to the script-writers a skeleton to quickly perform pixels manipulation (obviously it was available already in the original Maldonado's script, but this doesn't seem to be "popular" here around)

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) DIEGO Transfer Colours Plug-in for GIMP 2.10

23

No new posts Attachment(s) lock the colours in a palette

8

No new posts Attachment(s) Plays with Colours Mapping

12

No new posts Attachment(s) [Filters/Colours] I feel like such a fool. Please help.

3

No new posts Where has Diego been?

2



* Login  



Powered by phpBB3 © phpBB Group