It's used because humans, frequent subjects of graphic manipulation, contain no green pigment, so it's easy to key out green without accidentally keying out part of the central subject. There's nothing magical about the color green or even a particular shade of green. The most common color is green (as you might guess from the term "green screen"). With everything except your graphic selected, choose the color you want to use to designate your alpha matte. Now everything except your graphic is selected. To invert the selection, click on the Select menu and choose Invert. In other words, you need to mark the pixels that will be turned invisible. That's because you're creating an alpha matte to define what in your graphic will be replaced by something else. You have your graphic selected, but what you actually want to select is everything except your graphic. To grow a selection, click the Select menu and choose Grow. I sometimes do this when I want to impose or thicken a border around a graphic. If you feel your selection is too tight, you can give yourself a little slack by growing the selection. In the Paths panel, click the Path to Selection button. Now select the Paths panel from the Windows > Dockable Dialogs menu. Start by opening this graphic of Tux the penguin: I recommend GIMP or Glimpse, but mtPaint or Pinta or even Inkscape can work just as well, depending on the nature of your graphics and your ability to translate these instructions to a different tool. To prepare a graphic with an explicit color reserved exclusively for a chroma key, open the graphic in your favorite graphic editor. For that to work, you must know the colors in your graphic. Instead, you can pick a color and turn it into an alpha value of 0 in your game framework. The value of alpha can range from 0 to 1, with decimal points being valid entries.īecause an alpha channel can be expressed in several different ways, relying on an embedded alpha channel can be problematic. RGBA graphics contain red, green, blue, and alpha. RGB graphics, for example, have red, green, and blue channels. Free online course: RHEL technical overviewĪn alpha channel is information saved in a graphic to identify pixels that are meant to be transparent.That's a simplified explanation, but it demonstrates the origins of what is known as the alpha channel in computer graphics. The chroma key technique (also known as green screening) was originally developed as a chemical process, in which a specific color (blue at first and later green) was deliberately obscured by a matte during the copying of a film negative, allowing another image to be substituted where there once was a blue or green screen. Chrominance, or chroma, describes the saturation or intensity of a pixel. In computer graphics, there are a few values that contribute to how a pixel is rendered. This article describes the most sure-fire way I know to work around that. Other times, your framework and your graphic asset don't agree on where the alpha channel is located (or that an alpha channel exists at all), and you get pixels where you wanted transparency. It's 100% transparent or 0% opaque and functionally "invisible." That means it renders no new pixels where there's alpha, leaving that doughnut hole empty. Sometimes, your programming framework, whether it's Python Arcade, Pygame, LÖVE, or anything else, detects the alpha channel and treats it (after the appropriate function calls) as transparency. For example, if you were to draw a doughnut, the doughnut hole would be filled with alpha, and you could see whatever was behind it.Ī common problem is how to find the alpha part of an image. Alpha is the part of an image you don't see. Alpha is, essentially, the "color" of invisibility or transparency. An advantage of the PNG format, which is not available in a JPEG, is the ability to store an alpha channel. Whether you're programming a game or an app with Python or Lua, you're probably using PNG graphics for your game assets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |