Whenever I import a picture, (from a sprite sheet for example) into a costume there is always some colour, usually white, around it. You can't notice it if the background's the same colour but otherwise it's really annoying. I can edit the costume and erase all around to delete the colour but it takes ages. Can anyone help?
Offline
Use the fill tool (it looks like a paint bucket), select the bottom right colour from the colour pallet (the one that looks like a checkerboard) and click on the white area. Your image might still have a tiny bit of white around the edges but it should work well enough
Offline
Different image editors have different capabilities for solving this problem but it also depends on the image.
On the editors side, the Fill tool is commonly used to erase the colored "outside" portion of a ripped sprite (or whatever.) Scratch's editor has the handy ability to fill areas with transparency. But it fails to give the user any fine control over that fill. A fill tool starts by judging the color you click on against the next closest pixels. If those colors are similar enough in then it adds them to pool of pixels to be recolored and checks the next closest pixels again but always against that originally clicked color.
Most editors allow the user to select a Tolerance level, or how close or far apart the colors need to be to either be filled by the tool or to not be included. I like Scratch's default tolerance because it is loose enough to fill chunks of even an already graduated color shape. But of course I would love to be able to adjust the tolerance, and here is why..
On the images side of your question, most sprite sheets are made with this knowledge in mind ahead of time. They will use a solid background color that is not used at least in the bordering pixels of any of the sprites placed on that sheet. The whole point is so that as you cut and paste them into something (in this case Scratch) you should be able to easily trans fill and erase the surrounding background color leaving behind perfect sprites.
Which makes your case a little curious. The symptom you describe usually occurs from say Googled images or photographs rather than sprite sheets. In these cases you usually don't have a perfect, solid color surrounding the image you want to use. So you have to figure out the best ways to do what you say you don't want to do, hand cut the images for re-use. Some areas may respond better than others to fill-type cutting out. But you will inevitably areas that when selected or filled leak into the inside of the image you are cutting out.
That white line you are seeing results from a fill tool or selection (magic wand) tool that is having to create a hard line (the edge of the selection or fill) where there simply is not a hard line in the image. Imagine drawing a thick, straight line down a piece of paper with a pencil. You could easily see where the white paper ends and the sides of the dark line are so a program could cut or fill this perfectly. Now imagine smearing that line crazily with your hand. How well can you or a computer program say where the edges of that line are? So what happens is the computer picks in-between the darkest part and the lightest part, and the light part gets added to the pixels remaining at the edge of the image you are cutting around.
In an editor with adjustable tolerance, you can try tightening the tolerance (adjust closer to zero) and experiment using undoes till you get a good cut. Depending on the image, sometimes this works great and sometimes not at all.
In Scratch, I use a variety of tools. I use a solid rectangle in transparent color often when zoomed out to cut out around images. Honestly, if you are down to a thin, light line around a sprite, you may either want to find an easier image to work with or accept that you are simply part-way done with a necessary process. After I cut out an area around a sprite I am trimming (either in trans or often in a solid color that contrasts to whatever I am working on so I can see better while I work, then trans fill to erase when finished with sprite detail) I zoom in and start cutting. I will still use the fill tool but first I like to use a (most of the time) single pixel-wide line tool to do any long, straight cuts first. Then I will fill everything I can get away with before getting down to the fun job of painting out any remaining stubborn areas.
You should always keep some things in mind. Is the sprite symmetrical like a top down view of a race car? If so, you might be able to make a solid color mask (border shape) that you can flip over and cut out the other side with. Sometimes when cutting around an arc, like the outside of a circle, I will use the eraser tool or as big of a brush size as I can get away with to nibble out little pieces around the arc.
What program are you cutting your sprites with? I have been big-pimping my fave lately but only because I love it, Irfanview. Is free and works great, just zoom if needed, select (you can drag your selection sides to alter later if needed) hit edit/Crop selection and then Save your result for use in Scratch! If you are having this trouble with sprite sheets, I suspect that you are having problems adding the transparent part in your editor. Just cut out a square with a little bit of the solid border all the way around, import it into Scratch and then fill it with the transparent color. Should be no more white line
ps. I just figured out (not claiming to be the first though!!) how to do semi-transparent cut and pastes using nothing but Scratch. Thinking about making a little tutorial.
Offline