It is currently 25 Jan 2021, 10:47
| ||||
| ||||
|
|

Script to produce B&W image with a colour cast

Script to produce B&W image with a colour cast
After Tim's writing of my luminosity script, I decided to attempt a script of my own.
Having selected a foreground colour in GIMP, running the script produces a black and white image with an overlay of the foreground colour (which does not colour true blacks or whites, only the grey tones) and an overlay created from threshold which can emphasise black and white. Both of these can be adjusted by changing the opacity of the layers.
The script can be found under: Python-Fu/Desat with Colour Cast...
As always comments and criticism welcome!
david.
EDIT: Script has been modified to allow colouring of greyscale images (amended version below)
Having selected a foreground colour in GIMP, running the script produces a black and white image with an overlay of the foreground colour (which does not colour true blacks or whites, only the grey tones) and an overlay created from threshold which can emphasise black and white. Both of these can be adjusted by changing the opacity of the layers.
The script can be found under: Python-Fu/Desat with Colour Cast...
As always comments and criticism welcome!
david.
EDIT: Script has been modified to allow colouring of greyscale images (amended version below)
- Attachments
-
-
desat_col_cast.py #
- (4.13 KiB) Downloaded 139 times
-
Last edited by david on 30 Nov 2019, 17:38, edited 2 times in total.
Thank you David. I will try it but not immediately as some problems Have developed with my computer.
Thanks for this script David, a useful addition to my scripts folder
I'm always interested in reading scripts to see how others think and code
I'm still using gimp 2.8 so had to tweak a couple of lines. Your script worked as in your description on RGB and RGBA images but not GRAYSCALE images
The line of code "RGB*, GRAY*" in the register allows the script to run on GRAYSCALE images, is it meant to on gimp 10, if so to what ends
More often than not the PF Option (PF_COLOUR, "colour", "colour", (255, 0, 0)), would be used to get the script to ask for colour input rather than setting the foreground colour before running, Not a criticism, it's the coders choice
welcome to the addictive world of scripting
steve
I'm always interested in reading scripts to see how others think and code
I'm still using gimp 2.8 so had to tweak a couple of lines. Your script worked as in your description on RGB and RGBA images but not GRAYSCALE images
The line of code "RGB*, GRAY*" in the register allows the script to run on GRAYSCALE images, is it meant to on gimp 10, if so to what ends
More often than not the PF Option (PF_COLOUR, "colour", "colour", (255, 0, 0)), would be used to get the script to ask for colour input rather than setting the foreground colour before running, Not a criticism, it's the coders choice
welcome to the addictive world of scripting
steve
GIMP Learn rocks...
David, Congrats! You have become a creator of codes.
Thanks for your script, it works great and makes it so easy to use.
My first try. I used foreground colour 090985

Thanks for your script, it works great and makes it so easy to use.

My first try. I used foreground colour 090985
- Attachments
Issabella
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Steve Reid,
Thanks for your comments - you spotted my mistake!!!
Script has now been amended in first entry of thread (above) to permit colouring of greyscale images.
david.
Thanks for your comments - you spotted my mistake!!!
Script has now been amended in first entry of thread (above) to permit colouring of greyscale images.
david.
My other try, using a different colour.
Thanks David.
Thanks David.
- Attachments
Issabella
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Issabella,
Looking at your images - did you select a foreground colour before running the script? Because both your photographs are totally black and white.
Using the selected colour I get this result. (This is before any adjustment to the opacity of the layers.)
david.
Looking at your images - did you select a foreground colour before running the script? Because both your photographs are totally black and white.
Using the selected colour I get this result. (This is before any adjustment to the opacity of the layers.)
david.
David, thanks again for your help. Yes, you were right I didn't apply your script correctly. Sorry.
My other try.
My other try.
Issabella
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
I'm not able to upload my images. It seems to have changed the layout of the forum, is it correct for you all or it is only for me? Thanks.
Issabella
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Not only you Issabella, forum looks different and I can't upload images either
steve
steve
GIMP Learn rocks...
| ||||
| ||||
|
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3 Replies
- 1860 Views
-
Last post by RJKD
15 Sep 2020, 15:10
-
- 2 Replies
- 6410 Views
-
Last post by enxio27
22 Feb 2020, 23:21
-
- 6 Replies
- 8726 Views
-
Last post by CtrlAltDel
24 Feb 2020, 22:36
-
- 5 Replies
- 8445 Views
-
Last post by rich2005
27 Feb 2020, 08:10
-
-
Image comment (parasite) concatenation?
by R Soul » 13 Apr 2020, 12:47 » in GIMP Python Fu Scripts/Plug-ins - 2 Replies
- 2352 Views
-
Last post by skinnyhouse
21 Apr 2020, 09:01
-
-
-
How to Un-perspectify an image in GIMP - Mandala Example
by tim » 07 Aug 2020, 14:27 » in GIMP Tutorials - 2 Replies
- 1917 Views
-
Last post by Pat625
09 Aug 2020, 14:50
-
-
-
Center Resize All Layers To Image Size
by tim » 21 Aug 2020, 13:23 » in GIMP Python Fu Scripts/Plug-ins - 1 Replies
- 1181 Views
-
Last post by GJL
22 Aug 2020, 13:32
-
Who is online
Users browsing this forum: No registered users and 36 guests