It is currently 08 Dec 2021, 10:02

• Featuring Members' Images •
Could be related to 'Mask-If Plug-in (A Photoshop\'s BLEND-IF Substitute)'
gibletsWithShaman
Krikor
tim
tim
david

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
Sponsored content for World Food Program

Mask-If Plug-in (A Photoshop's BLEND-IF Substitute)

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger
1st Place
5640 Post(s)

Mask-If Plug-in (A Photoshop's BLEND-IF Substitute)

Post#1 by tim » 26 Feb 2021, 14:23


Asked for Photoshop BLEND-IF plug-in by n3306tx.
I watched a youtube video on Photoshop Blend-If tutorial.
From what I learned from tutorial is that you can select a low value (which can break into 2 points for soft transitions)
and a high value (which can also break into 2 points for soft transitions)
So I have allowed 4 points in total (Low Minimum & Low Maximum for 2 point soft transition for low point and
High Minimum & High Maximum for point soft transition for high point).
The plug-in is called Mask-If.
Instructions:
  1. Select the layer you'd like apply mask-if to
  2. Run Plug-in, select channel, select 4-point numbers from 0-255 (that you'd like to use like in Photoshop Blend-If)
  3. Click OK
  4. Plug-in will create a layer called/named "Mask-if" for you to play with afterwards (but it'll be set to not visible because it will already apply that mask to your selected layer).
mask-if.py #
(3.99 KiB) Downloaded 82 times
mask-if.py #
Spinner value bug fix.
Spinner value adjustment bug fix. Previous version wouldn't allow spinner values to be incremented/decremented but had to manually enter text/numeric values
(3.99 KiB) Downloaded 57 times
mask-if.py #
Version 3. Fast version (compared to version 1 & 2)
(5.44 KiB) Downloaded 62 times
mask-if.py #
Version 4: Preprocess 0-255 values to reduce overhead processing
(5.34 KiB) Downloaded 62 times
mask-if.py #
Version 5: Slight speed enhancement
(7.67 KiB) Downloaded 61 times
mask-if.py #
Version 6: Even more speed enhancement
(7.9 KiB) Downloaded 66 times
mask-if.py #
Version 7: Undo (Ctrl+Z) in one step (so that user can easily undo and try another setting)
(7.99 KiB) Downloaded 54 times
mask-if.py #
Version 8: less progress updates runs even faster (about 3 seconds for 800px x 800px layer)
(8.2 KiB) Downloaded 60 times
mask-if.py #
Version 9: Remove unneeded casting for more speed (1600px x 1600px now takes about 9 seconds; 800px x 800px now takes under 2 seconds)
(8.32 KiB) Downloaded 139 times
Plug-in Menu Location: Python-Fu/A Mask-If
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot-options.jpg
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot-options.jpg # (34.31 KiB) Viewed 2178 times (Thumbnail | Recognize | Sq Tile | LNFI)
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot1.jpg
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot1.jpg # (17.54 KiB) Viewed 2178 times (Thumbnail | Recognize | Sq Tile | LNFI)
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot2.jpg
PS-BLEND-IF-substitute-in-GIMP-mask-if-screenshot2.jpg # (24.42 KiB) Viewed 2178 times (Thumbnail | Recognize | Sq Tile | LNFI)
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#2 by tim » 26 Feb 2021, 18:35


This plug-in could possibly be known as "Smooth Transition Threshold" as it's similar to threshold in that in converts a range of values to white and outside that range to black but also allows for smooth transition.
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#3 by tim » 26 Feb 2021, 19:29


Speed is a pain right now.
Looks like I could use the pixels access logics from http://gimpchat.com/viewtopic.php?f=9&t=10516#p138722
to speed things up...will update when when I have something.
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#4 by tim » 26 Feb 2021, 21:17


UPDATED with version 3 for super speed enhancement.
See code for get_pixel/set_pixel/put_pixel methods using set_pixel_rgn. Very speedy enhancement.
if anyone is looking for set_pixel_rgn then the code in this plug-in allows shows how to set the pixel_rgn since there is no such method.
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#5 by tim » 27 Feb 2021, 13:47


UPDATED version 7: for super speed and Ctrl+Z (Undo) in one step so users can easily rerun with different settings.
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#6 by tim » 27 Feb 2021, 22:18


Fast pixel access code found and worked with from: https://shallowsky.com/software/arclayer/
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5640 Post(s)

Post#7 by tim » 28 Feb 2021, 12:29


Great, now if you google search for "blend-if gimp plug-in", this topic is shown 2nd place so hopefully many will find it easily and find it useful, we'll convert everyone from PS to GIMP users LOL
aka Tin
World Food Program | Good Deeds Forum

         


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 New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 7 guests