Change all colors in an image except black

  • Thread starter Thread starter Hercuflea
  • Start date Start date
  • Tags Tags
    Change Image
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 2K views
Hercuflea
Messages
593
Reaction score
49
Hello,

I have a typesetting software which can export typeset math as normal, nice looking black LaTeX text. However it always puts it on a white background. How can I change the background color of an image (png or jpeg) without changing the black text contained int he image? Should I write a script that can do this or is there already a tool to do so? I want the background of the picture to match the background of my poster.

Thanks
 
Physics news on Phys.org
It's possible to set the background of a jpeg to be transparent. I don't know what the capabilities of your software is though.
 
  • Like
Likes   Reactions: jedishrfu
I was thinking of writing a program to cycle through each pixel and convert it to the color I want, skipping the black pixels, but I don't know if that is overkill or if there is some other easy way to do it.

Edit: cool...I will check that out