Sign in to follow this  

colour-keying a non-homogeneous surface (GIMP experts here?)

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I fix a sprite with a non-homogeneous colour key background. This usually happens because the sprite is graphically made to blend in with the background. E.g. if the sprite is a black stealth fighter and the background is white, then the edges of the stealth fighter will be greyish. It also happens when people save sprites as jpegs and screw up the colour. Here is an example: http://img153.imageshack.us/img153/3738/mydotshy2.png The top left dots are bmp dots and let's say my background is blue. So I set a white colour key and blit the dots. The bottom left image shows the result. But the top right image is the same dots in jpeg. Seems to look the same, but this time if I set my colour key as white then the whitish blobs will remain there over the blue background, because they're not exactly 0xffffff. I don't mind if the object blends in with a certain bg colour around the edges and whatnot. I would basically like to know how to make it blend in with a different bg colour using the GIMP or some other tool. So that if my background is blue and my object is black, then if it's bluish-black around the edges then that's ok, and would actually look more realistic. Thanks for any suggestions,

Share this post


Link to post
Share on other sites
I wouldn't use JPEG. It looks good for rectangular photographs, but the way it compresses its data (to save space. for an example, compare any bmp with an identical jpeg.) makes strange dots go all over. It won't even save a black and white picture correctly!

Use PNG or BMP (preferably PNG: it has smaller filesizes) for your sprites. I haven't found any extraneous dots on a picture with either format.

Now as for fixing those images... I do it by hand and chastise myself for not saving in PNG!

EDIT: I just realized this doesn't really answer your question, but I hope it helps. This only applies to you making new sprites, not ones that already have a messed up background.

Share this post


Link to post
Share on other sites
Yeah you're right, I use png most of the time. The problem is with sprites that I find on the internet.

Here is a better example:
http://img177.imageshack.us/img177/7167/f117al3.png

The sprite on the left is a png sprite with a homogeneous white background. This sprite is not destroyed by compression, but it suffers from the problem I described.

When I apply a pure white colour key and blit it onto a blue background, you can clearly see the whitish dots (around the edges). This is because between the white background and the black stealth fighter there is a colour gradient of greyish tones which makes it look photo-realistic I guess..

So my question is, what can I do with GIMP/Photoshop to transform that gradient from whitish-black to bluish-black so that it blends in with a blue background, for example.

:)

Share this post


Link to post
Share on other sites
You may find the magic wand tool usefull in situations like this. For your ball scenario, you can select the whole background after setting the threshold up a bit, so it disregards the small color differences. You can then easily fill it with a single color.

For your stealth fighter scenario, things get a little trickier, though. The original stealth fighter probably had an edge with decreasing alpha values, so it would blend nicely with any background. Now, however, it has been painted onto a white background, so that alpha information is lost. You'll have to restore that in some way. Now personally, I paint my own sprites, so I never need to do things like this. That means I can't tell you how to do this efficiently, also because I don't use The GIMP or Photoshop (I use Paint.NET). Well, maybe you could do something with masking, using the outline as a transparancy mask or such, I don't know. Just an idea. :)

Share this post


Link to post
Share on other sites

This topic is 3630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this