Suggestion - Fill Color Range

2012-01-07
2013-03-27
  • Johny Yukon
    Johny Yukon
    2012-01-07

    I had this idea after using a Gimp change color tool.

    Color range could work like this example:

    gm convert -transparent "#1-e,f,0,6,7,8" src dest
    

    This means that I want to apply transparency to all RGB colors in the interval: 1ef0678, 2ef0678, 3ef0678, 4ef0678…

    And I could do this for every color hex.

    Another example selecting grey colors:

    gm convert -transparent "#f,0-e,f0-e,f,0-e" src dest
    
     
  • Johny Yukon
    Johny Yukon
    2012-01-07

    So I gave the interval wrong…

    The correct would be 1f0678, 2f0678, 3f0678, 4f0678…

     
  • I think you can already accomplish the grayscale interval with
    convert -fuzz 8 -transparent "#070707"

    For color with different range per channel we'd need an
    extended -fuzz option that takes multiple channels.

       -fuzz 8,20,10 -transparent "#074008"

    Everyplace that IM uses -fuzz would have to be
    revised to take per-channel fuzz.

     
  • Except (of course) that this a GM forum. :-)

    The current fuzz approach is based on the 3D distance vector approach so it would be quite a change to go for the multiple 1D distance approach.  There is also the small problem of how to accomplish this sort of change without blowing the existing ABI since 'fuzz' is encoded as a double value in some existing structures.

    It would be easier to add the suggested feature as a whole new function unrelated to the existing fuzz mechanism.

    Bob

     
  • Oops, I thought both apps handled -fuzz similarly.  But you're right, the Euclidian "distance" from black to white is sqrt(3.0), even when the colorspace is gray in GM.  So forget my idea about using the -fuzz option (it would work, but the user would have to remember to multiply the desired range by 1.7321).