Jump to content


Photo

Remove solid black?


  • Please log in to reply
3 replies to this topic

#1 Catsy99

Catsy99

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 25 August 2017 - 12:10 AM

Is it possible to remove solid black from an image, or from a created texture? (ie. I want to remove all the solid black, and replace it with transparency)



#2 Vicces1212

Vicces1212

    Advanced Member

  • Full Members
  • PipPipPipPip
  • 106 posts

Posted 25 August 2017 - 01:52 AM

Yes, it's possible using the Combine node. You can control how "smooth" the result will be, by setting the Colorize node's black color to a greater value. I set it to 0.001 so it will only remove the deepest black (RGB:0,0,0), but if you set it to for example 0.1, then anything between 0-10% bright will be semi-transparent.

 

Attached Images

  • remove_black.png

Attached Files



#3 Catsy99

Catsy99

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 25 August 2017 - 03:11 AM

Thank you so much again! You've saved me so much time and headaches. This works really well on images with solid colors.



#4 Vicces1212

Vicces1212

    Advanced Member

  • Full Members
  • PipPipPipPip
  • 106 posts

Posted 25 August 2017 - 03:15 AM

You can also remove any color (not just black) with a very basic Pixelscript, but this way You don't have control over "smoothness", only exact matches will be removed. Hovewer, you can remove one color in one part of the image, and another color on another part, using an Imported image instead of Solid color as the second imput.

// Current pixel of your first image
color a = input(1, x, y);
// Current pixel of your second image
color b = input(2, x, y);

// If identical, return transparent
if(a == b) {
    result = color(0, 0, 0, 0);
}
// Else return the original color of your first image
else {
    result = a;
}

Attached Files


Edited by Vicces1212, 25 August 2017 - 07:36 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users