#!
/usr/bin/env python
from gimpfu import *
def adjust_color_levels(image, drawable):
# Start an undo group, so the operation can be undone in one step
pdb.gimp_image_undo_group_start(image)
# Adjust the levels
# Parameters: drawable, channel (0=value, 1=red, 2=green, 3=blue, 4=alpha), low-input, high-input,
gamma, low-output, high-output
pdb.gimp_levels(drawable, 0, 125, 255, 1.0, 0, 255) # Adjust value channel (0)
# End the undo group
pdb.gimp_image_undo_group_end(image)
# Register the script in GIMP
register(
"python_fu_adjust_color_levels", # Unique name for the script
"Adjust Color Levels", # Short description
"Increase low input levels from 0 to 100.", # Long description
"Your Name", "Your Name", "2023", # Author, copyright, date
"<Image>/Image/Adjust Color Levels", # Menu path
"RGB*, GRAY*", # Image types (works on RGB and grayscale images)
[], # No input parameters
[], # No output parameters
adjust_color_levels) # Function to call
main()