Using white as transparent color

Moderator
Posts: 133
Joined: 2008.05
Post: #1
I've been told to use white as a transparent color. Cool.

However, it really sucks when I have a set of sprites where there is a few pixels that are a few splashes from white, and I really can't tell in Photoshop. Is there a trick to get around this, or do I have to go in and clean them up on my own?
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #2
Use Select->Color Range, set the Fuzziness to a little more than zero, click a white pixel in the image and OK the dialog. Make sure that your foreground colour is white and press Alt-Backspace to fill the selection with white.

You might have to experiment with the settings but you should get most of it that way!

[I moved your thread for hopefully obvious reasons.]

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
ClarustheDogCow
Unregistered
 
Post: #3
If you have photoshop 5 (probably through 6 too) it is under image->adjust->selective color.
In TheGimp 1.2 it is right click->select->by color.
In TheGimp 1.3 (beta) it is select->by color (select is a menu on top of the window)
Quote this message in a reply
Member
Posts: 35
Joined: 2002.11
Post: #4
Quote:Originally posted by NCarter
Make sure that your foreground colour is white and press Alt-Backspace to fill the selection with white.

wait... "alt"?
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #5
Quote:Originally posted by erazorhead
wait... "alt"?

Haven't you ever had that discussion which goes:

"OK, now press option-e."

"Uh... what's option?"

"The key which says 'alt' on it. That's the option key."

"Why doesn't it say 'option' on it?"

"Er, well it used to. But now it doesn't. I don't know why. Just get on with it."

I know it's called option, you know it's called option, but many, many other people don't, so I usually refer to it by the name on the keycap. Force of habit!

BTW, thanks for the clarification, ClarustheDogCow. I keep forgetting that Adobe like to change the menu layout with every new version!

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
My option key says option on it very loudly... what kind of keyboard do you have?!
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #7
[Checks all the Macs in the office]

All of the Macs here have 'alt' keys! There's an old iMac style keyboard, four G4 keyboards and a couple of beige G3 ones and they all have the word alt on them. I haven't seen a keyboard which says 'option' for years!

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #8
My G4 keyboard comes with an 'option' key... And so did all the iMacs which were in my school. Could it be that you live in the UK?

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #9
How did you guess? Smile

Are you saying that only UK keyboards have the word alt instead of option, or is there some other localisation thing going on?

Do you think we're off topic enough yet? Grin

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #10
The fact that the little sidebar by your name says 'London, UK' is a clue... Smile
My key actually has both - option is printed in large letters, and alt in smaller letters in the corner.

And, definitely no!!! Cool

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #11
Quote:Originally posted by LongJumper
I've been told to use white as a transparent color. Cool.

However, it really sucks when I have a set of sprites where there is a few pixels that are a few splashes from white, and I really can't tell in Photoshop. Is there a trick to get around this, or do I have to go in and clean them up on my own?


So I'm assuming you want to get rid of the stray white pixels? If you have things in separate layers it is easy. Just use Levels and set the output on the white side of things slightly less, so in effect it will turn the whitest value into a shade of off-white very light gray. Then re-flatten and save your images and you should be fine. There isn't a way to magically figure out which pixels are masked and unmasked if you just have some .png or .tiff files though. You'll have to do it semi-manually. Use Color Range with fuzzyness of 0 to find all the white pixels, and manually select what areas you want changed. Then do the Levels thing.

Wouldn't it be easier just to include a 1-bit mask in a separate file, or use a filetype that supports masks? Then again, I've done this type of sprite masking in games too :-) (But I was using black instead of white)

-Jon
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #12
No, he wants, for example, the color RGB(254,254,254) to be treated as completely white and thus transparent. But I think levels could be used for that, too...

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Member
Posts: 79
Joined: 2002.08
Post: #13
My keyboard that came with the Quicksilver G4 has two keys with both alt AND option on them. How about that! Smile

KenD

CodeBlender Software - http://www.codeblender.com
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2010.11
Post: #14
I've been using macs for 10 years and every one I've seen has
alt
Option on it.
Quote this message in a reply
Member
Posts: 81
Joined: 2002.12
Post: #15
Quote:Originally posted by OneSadCookie
My option key says option on it very loudly... what kind of keyboard do you have?!


Check the new keyboards on the G5 and eMacs (and basically any new desktop Mac). It might be changed on that one. This new keyboard has an over-sized esc key. I *think* I might have seen the option-less alt key on that kind of keyboard.
Quote this message in a reply
Post Reply