It is currently 31 May 2020, 22:41

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Script to produce B&W image with a colour cast

Share your Python Fu Scripts/plug-ins for GIMP here
david
Forum Member

Script to produce B&W image with a colour cast

Post#1 by david » 27 Nov 2019, 17:37


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)
Attachments
desat_col_cast.py
(4.13 KiB) Downloaded 66 times
Last edited by david on 30 Nov 2019, 17:38, edited 2 times in total.
2

Pat625
Tutorial Creator

Post#2 by Pat625 » 28 Nov 2019, 04:26


Thank you David. I will try it but not immediately as some problems Have developed with my computer.
0

Steve Reid
Script Coder

Post#3 by Steve Reid » 29 Nov 2019, 20:30


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
GIMP Learn rocks...
0

Issabella
Script Tester

Post#4 by Issabella » 30 Nov 2019, 07:33


David, Congrats! You have become a creator of codes. :gimp_clap:
Thanks for your script, it works great and makes it so easy to use. :happy_purple:
My first try. I used foreground colour 090985
Attachments
81e76f5a_Maidenhead.JPG
81e76f5a_Maidenhead.JPG (178.89 KiB) Viewed 2289 times
81e76f5a-Desat_With_Colour_Cast.JPG
81e76f5a-Desat_With_Colour_Cast.JPG (174.11 KiB) Viewed 2289 times
Issabella

Don’t be afraid to start over. It’s a new chance to rebuild what you want.
1

david
Forum Member

Post#5 by david » 30 Nov 2019, 12:11


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.
0

Issabella
Script Tester

Post#6 by Issabella » 30 Nov 2019, 13:45


My other try, using a different colour.
Thanks David.
Attachments
81e76f5a_Maidenhead_DesatWithColourCast_Issa_700d35.JPG
81e76f5a_Maidenhead_DesatWithColourCast_Issa_700d35.JPG (174.02 KiB) Viewed 2268 times
Issabella

Don’t be afraid to start over. It’s a new chance to rebuild what you want.
0

david
Forum Member

Post#7 by david » 30 Nov 2019, 23:42


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.
Attachments
colour_selection.png
colour_selection.png (20.52 KiB) Viewed 2242 times
81e76f5a_Maidenhead_1.JPG
81e76f5a_Maidenhead_1.JPG (271.74 KiB) Viewed 2242 times
0

Issabella
Script Tester

Post#8 by Issabella » 01 Dec 2019, 07:52


David, thanks again for your help. Yes, you were right I didn't apply your script correctly. Sorry.
My other try.
Issabella

Don’t be afraid to start over. It’s a new chance to rebuild what you want.
0

Issabella
Script Tester

Post#9 by Issabella » 01 Dec 2019, 10:48


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.
0

Steve Reid
Script Coder

Post#10 by Steve Reid » 01 Dec 2019, 11:16


Not only you Issabella, forum looks different and I can't upload images either

steve
GIMP Learn rocks...
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 16 guests